Print Page | Close Window

Corupted PDF using ExtractFilePages

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2605
Printed Date: 29 Apr 25 at 11:34AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Corupted PDF using ExtractFilePages
Posted By: tomkuipers
Subject: Corupted PDF using ExtractFilePages
Date Posted: 21 Apr 13 at 8:54AM
Hello,

I am using the Quick PDF Library ExtractFilePages to split an pdf in seperate pages that come from a scanner. Te problem is the 2'nd page and up can be opened by acrobat reader but gives me an error "De paginastructuur van het document bevat een ongeldig element" wich would be something like the page structure of the document has an false element.

I have one PDF with two pages:
http://www.emsf.eu/test.pdf - http://www.emsf.eu/test.pdf 

When i extract the pages
The 1st page is ok:  http://www.emsf.eu/test_1.pdf - http://www.emsf.eu/test_1.pdf
The 2nd page is giving the error:   http://www.emsf.eu/test_2.pdf - http://www.emsf.eu/test_2.pdf  

Using the latest Demo, or older versions all have the same outcome.

This is anoying for the users who are opening the PDF's. Does anyone have an idea how to solve this?




Replies:
Posted By: Ingo
Date Posted: 21 Apr 13 at 7:01PM
Hi Tom!

What about other functions like CopyPageRanges?
The same error with your pdf-documents?
ExtractFilePages isn't a new function so i won't expect real basic errors.
Could you post your relevant code part here?
Perhaps someone could have an eye on it...

Cheers and welcome here,
Ingo



Posted By: tomkuipers
Date Posted: 22 Apr 13 at 8:12AM
The Code i am using that allso runs on the Demo:
QP.ExtractFilePages("c:\\test.pdf", "", "c:\\test_1.pdf", "1");
QP.ExtractFilePages("c:\\test.pdf", "", "c:\\test_2.pdf", "2");
DisplayPDFReader("c:\\test_2.pdf");

The second shot with:
QP.ExtractFilePages("c:\\test.pdf", "", "c:\\test_extracted_page_2.pdf", "2");
DisplayPDFReader("c:\\test_extracted_page_2.pdf");

Gives me the same problem error on opening the pdf from the 2nd page and up.




Posted By: AndrewC
Date Posted: 22 Apr 13 at 10:26AM
Tom,

Many of the scanner manufacturers produce very poorly written PDF's that contain lots of errors. It is easier for Acrobat or any other viewer to display a PDF than it is to split a PDF and have the output readable.  We would need to see the PDF to see what the problem is.  I suspect other PDF libraries could also have similar problems with these malformed PDF's.

Please create a new support case using  http://www.debenu.com/support/contact/ - http://www.debenu.com/support/contact/  and then send us the original PDF that you are trying to extract pages from.

Andrew.


Posted By: tomkuipers
Date Posted: 22 Apr 13 at 11:30AM
I submitted for support, hope for an solution!

It is comming from different types of Develop multifunction devices. Most of the online PDF splitters do split into correct files, so i hope that an update of the PDF Library wil fix this!

I will update the topic when i have recieved an solution.


Posted By: pindemad
Date Posted: 01 May 13 at 12:58PM
I get the same error

I have also tried using ExtractPages function and SaveToFile
However it fails on the last page and exports the next to last page instead of exporting the last page
        for (i=1;i<=numpages;i++)
        {
...
            QP.LoadFromFile(CString(filename),CString(L""));
            QP.ExtractPages(i,1);
            QP.SaveToFile(s);
        }


What is your recommendation for splitting a PDf with multiple pages to single page PDFs?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk