EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How to use TElPDFSignatureWidgetProps::AddImage()

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#32587
Posted: 03/11/2015 05:57:58
by Koichi Wada (Basic support level)
Joined: 02/17/2015
Posts: 8

I'm trying TElPDFSignatureWidgetProps::AddImage() in C++, but I haven't seen any effect yet.

Preparation to get props:
Code
TElPDFDocument pdf(NULL);
TFileStream pdfStream("file.pdf", filemodeOpenReadWrite);
pdf.Open(pdfStream);

int idx = pdf.AddSignature();
TElPDFSignature *pSig = pdf.get_Signatures(idx);
pSig->set_Invisible(false);

TElPDFSignatureWidgetProps *props = pSig->get_WidgetProps();


First, I tried Background. The code below worked fine with some width, height and data.
Code
props->set_BackgroundStyle(pbsCustom);
TElPDFImage *pBg = props->get_Background();
pBg->set_ImageType(pitJPEG);
pBg->set_Width(width);
pBg->set_Height(height);
pBg->set_Data(data);


Then I tried the code below with same width, height and data. But I didn't see any change by this code.
Code
TElPDFImage *pImage = new TElPDFImage();
pImage->set_ImageType(pitJPEG);
pImage->set_Width(width);
pImage->set_Height(height);
pImage->set_Data(data);
props->AddImage(pImage);


Could you tell me what is wrong with this? Or is there a sample for AddImage()?

Thanks,
Koichi Wada
#32588
Posted: 03/11/2015 06:20:48
by Dmytro Bogatskyy (EldoS Corp.)

Thank you for contacting us.

Quote
Could you tell me what is wrong with this? Or is there a sample for AddImage()?

Without offset and size parameters the AddImage method adds the image into the pdf document that could be used later using its resource name (use set_ResourceName() method to set a resource name).
You can specify the image offset and size in the overloaded AddImage method, e.g.:
Code
props->AddImage(pImage, 10.0, 10.0, 20.0, 20.0);

Reply

Statistics

Topic viewed 433 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!