I need to do one or more of the following:
- Convert stream to image, place in signature box
Convert stream to image, place in form text field
Convert stream to image, place in text box
Convert stream to image, place on button
Convert stream to image, place in any object that can be used as a bounding box
Code: Select all
var
page: IPXC_Page;
pgTxt: IPXC_PageText;
opts: IPXC_GetPageTextOptions;
idx: Cardinal;
txtInfo: IPXC_TextBlockInfo;
arect: PXC_RectF;
bmp: Vcl.Graphics.TBitmap;
sigPad: TfrmSignaturePad;
strmAdpt: TStreamAdapter;
img: IPXC_Image;
dHandle: DWORD;
begin
// pdf form field editor class instance
FFields := TPDFFormFieldEditor.Create(Self);
Inst.Doc[0].CoreDoc.Pages.Get_Item(0,page);
if Assigned(Page) then
begin
if page.GetText(opts,true,pgTxt) = S_OK then
if pgTxt.Get_BlockInfo(idx,txtInfo) = S_OK then
if txtInfo.Get_BBox(arect) = S_OK then
begin
sigPad := TfrmSignaturePad.Create(Nil);
if sigPad.ShowModal = mrOk then
begin
bmp := Vcl.Graphics.TBitmap.Create;
bmp.Assign(sigPad.SignatureImg);
if bmp.HandleAllocated then
dHandle := DWORD(bmp.Handle);
// now what??? get the image into some kind of... IPXC_Image???
if img.Get_Handle(dHandle) = S_OK then // img is null, so errors out here...
Thank you.