Closed nlessmann closed 11 years ago
I think this issue may have to do with the version of the PDF being imported. I believe at the time a large chunk of the parsing functionality was written for the PDF component, it was only built to support PDF v1.4 or v1.5, I think. So that being said, can you share with me some info about the PDF you're trying to import, namely the PDF version? Thanks.
I've tried it with PDFs in Versions 1.4, 1.5. and 1.7, none did work. Two of them were simple documents with only the word "Test" written on a single page (A and B), and the third was a more complex document.
Ok, thanks for sharing the PDF samples. I've downloaded them and will poke around and see if I can find the issue. I'll let you know what I find. Also, what program did you originally create these PDFs in? Something like Illustrator or InDesign? Or another program?
Thanks for taking the time to look into this! The PDFs A and B were created using html2pdf, which is based on TCPDF, which are both tools to create PDFs in PHP. The Magento document was probably created using OpenOffice.
Alright - I think I may have fixed this issue. I've tested it over here and it looks like it works. Would you like to grab the latest commit from the PopPHP 1.4.0 branch and test it on your end?
Basically, the import function was setting up a bad/invalid pointer to the /Resources reference object within the Page objects, and I've corrected that.
Let me know if the patch works for you - thanks.
Also - I wrote in support for OCG's (Optional Content Groups) which came about in PDF v1.5+. That probably still needs to be tested further, but initially, it looks like it's picking them up from your test PDFs and keeping them intact.
Thanks a lot, works just fine!
I've been trying to load a PDF via
This only works with PDFs also generated by the PDF component. With other PDFs, I always end up with the correct amount of pages, also in the correct size, but with no content.