Wow, that was all the hint I needed! In fact, I didn't even need to
change my PdfPainter:DrawImage call. I simply needed to move my
PdfImage instantiation and LoadfromFile call outside my page insertion
loop and all was well. My output PDF seems to have only one copy of the
image (based on file size), but yet there are hundreds of pages that
show the image.
Thank you so much for the quick and concise response nudging me to the
solution.
Great library, BTW.
Lynn (D)
On 6/11/2017 7:32 AM, zyx wrote:
On 9.6.2017 23:51, Lynn W. Deffenbaugh (Mr) wrote:
Is there a way to insert the actual image once and refer to it from each
inserted page?
Hi,
you can do that by adding the image as an XObject and then draw that
XObject instead of re-adding the image every time.
I suppose you draw the image with PdfPainter::DrawImage(), but you can
do the same (using similar arguments) with PdfPainter::DrawXObject().
See the implementation of the PdfPainter::DrawImage().
As PdfImage() is a descendant of PdfXObject() you've most/all of
the work done. You can even copy what the Draw functions do and modify
it to your likings.
Bye,
zyx
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users