[Podofo-users] Add image in existing pdf
A PDF parsing, modification and creation library.
Brought to you by:
domseichter
|
From: Paolo G. <pao...@gm...> - 2013-02-16 16:52:04
|
Hi all,
I'm new with this library, so I need your help for (I think) a very simple
issue.
All that I have to do is to add an image in an existing pdf (not a created
one with podofo).
I try the example in test/CreationTest/CreationTest.cpp, but it doesn't
work (no errors, just there isn't the image in the positon of the page that
I consider).
This is my code:
PdfMemDocument document("path/to/existing/document.pdf");
PdfPage * p;
p=document.GetPage(0); //the page in which I want to insert my image
painter.SetPage( p );
PdfImage image( &document );
image.LoadFromFile("path/to/my/image.png");
painter.DrawImage( 70.0, writer.GetPage(0)->GetPageSize().GetHeight() -
image.GetHeight(), &image );
No errors, but my image is missing. Maybe is there another way?
Thanks for your support.
|