wxPdfDocument to image is it possible?

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 425
Joined: Fri Dec 09, 2016 7:28 am
Contact:

wxPdfDocument to image is it possible?

Post by cutecode »

I scoped to insert images to wxPdfDocument, and now I need to extract those images back from PDF file. Is it possible?
I looked at API docs and didn't find any function for it.
But may be someone knows...?
wx 3.1.6 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDocument to image is it possible?

Post by utelle »

cutecode wrote:I scoped to insert images to wxPdfDocument, and now I need to extract those images back from PDF file. Is it possible?
I looked at API docs and didn't find any function for it.
There is no pre-defined function for this purpose. Keep in mind that wxPdfDocument is meant for generating PDF documents, not for editing and/or manipulating existing PDF files.

The class wxPdfParser has the building blocks to read an existing PDF file and to extract objects from it, but you have to know a lot about the PDF format and how to interpret it. That is, in principle it would be possible to extract images from a PDF file, but not out-of-the-box.

You would still have the problem to identify the images you need to extract. For this you might need to interpret the page content ... and wxPdfDocument has no support for this.

Conclusion: Not totally impossibe, but probably not easy to accomplish. Tools like PDFedit are most likely better suited for the purpose.

Regards,

Ulrich
User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 425
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: wxPdfDocument to image is it possible?

Post by cutecode »

Thank you very much for full answer.

Actually I need images of every page, not an individual image with precise coordinates.
What library would you recommend? Will wxPdfDC satisfy my needs?
wx 3.1.6 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDocument to image is it possible?

Post by utelle »

cutecode wrote:Actually I need images of every page, not an individual image with precise coordinates.
What library would you recommend? Will wxPdfDC satisfy my needs?
No, wxPdfDC is just a wxWidgets drawing context, not able to manipulate existing PDF files at all.

Maybe you could use PDFedit for this purpose.

Regards,

Ulrich
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxPdfDocument to image is it possible?

Post by PB »

I have never used it but it seems PoDoFo can also manipulate PDFs; it seems a bit less dead and has more permissive licence than PDFEdit?
Post Reply