Hello everyone,

Is itpossible to add .png image with transparency background on PDF? I'm trying 
thefollowing code without success:

void__fastcall TWorkerThread::LCreateSignImg(TLitePDF *pLpdf, String 
pImage,unsigned int pSigIndex, int pWidth, int pHeight)

{

               Graphics::TCanvas *canvas = newGraphics::TCanvas();

               if (!canvas)throw(Exception("Error: Low memory or something went 
wrong while creatingcanvas."));

               HDC hdc = NULL;

               hdc =pLpdf->AddResource(pLpdf->MMToUnit(pWidth), 
pLpdf->MMToUnit(pHeight),pWidth*10, pHeight*10, LitePDFDrawFlag_None);

               canvas->Handle = hdc;

               TPicture *xPicture = newTPicture();

               xPicture->LoadFromFile(pImage);

               canvas->StretchDraw(Rect(0, 0,pWidth*10, pHeight*10), 
xPicture->Graphic); //BrushBmp/PNG

               
pLpdf->SetSignatureAppearance(pSigIndex,LitePDFAppearance_Normal, 
pLpdf->FinishResource(hdc), 0, 0);

}

 

Maybe PdfPainterobject could help to achieved it?

Kind regards,

Francisco

_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to