Print Page | Close Window

CopyPageRanges results with blank pages

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=455
Printed Date: 08 May 24 at 9:52PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: CopyPageRanges results with blank pages
Posted By: Pirmin
Subject: CopyPageRanges results with blank pages
Date Posted: 05 Jul 06 at 2:18AM

Hi

Extracting pages from one document and inserting them in a new document is what I am trying to do with CopyPageRanges.

For many documents this works perfectly. However I have some documents where just blank pages result in the new document.
I have not found a topic dealing this problem here.
I'm not sure if my problem is a bug and should be placed on the "Bug Reports" Forum or if it's just a programming mistake.

As I have not much experience with this feature maybe I have overlooked something and somebody could give me a hint.

The code I'm using to do the extraction looks like this:

aPageNo := 1;
qp.LoadFromFile('MergesBlank1.pdf');
DocIdSrc := qp.SelectedDocument();
DocIdTrg := qp.NewDocument;
res := qp.CopyPageRanges(DocIdSrc, IntToStr(aPageNo));
qp.DeletePages(1, 1); // allways one leading empty pages is produced
res := qp.SaveToFile('MergeOutput.pdf');

The return values from the function calls allways is 1 (success).
Here is a document which results only blank pages with CopyPageRanges: http://www.pirmin.gmxhome.de/MergesBlank1.pdf - www.pirmin.gmxhome.de/MergesBlank1.pdf
Even the "iSEDQuickPDF 5.11 Reference Guide.pdf" results in blank pages with CopyPageRanges.

Kind Regards
Pirmin




Replies:
Posted By: Pirmin
Date Posted: 05 Jul 06 at 8:13AM
If there is no workaround (different function or whatever) for the above mentioned problem, maybe somebody can recommend me an affordable royalty free different library which I can try to use to overcome the problem.


Posted By: bogey
Date Posted: 05 Jul 06 at 11:24AM

Most of the time I have found blank pages are the result of document security preventing access to the document.

Check the security properties of the source file to ensure extraction is permitted.



Posted By: Pirmin
Date Posted: 05 Jul 06 at 3:08PM

Yeah!!!

You are perfectly right. Thank you!
Every document where CopyPageRanges resulted in blank pages had values for some SecurityItems which the others did not have.
I'm more confident about our library now.
Here is a list with typical Security properties I read from some documents.

                                   Documents with  CopyPageRanges  CopyPageRanges  CopyPageRanges
SecurityItem                         no Problem     failed Doc 1    failed Doc 2    failed Doc 3
------------                        -------------  --------------  --------------  --------------
Security Method                     None           Adobe Standard  Adobe Standard  Adobe Standard
User Password                       No             No              No              No
Master Password                     No             No              Yes             Yes
Printing                            Fully Allowed  Fully Allowed   Fully Allowed   Fully Allowed
Changing the Document               Allowed        Allowed         Not Allowed     Not Allowed
Content Copying or Extraction       Allowed        Allowed         Allowed         Allowed
Authoring Comments and Form Fields  Allowed        Allowed         Allowed         Not Allowed
Form Field Fill-in or Signing       Allowed        Not Allowed     Not Allowed     Not Allowed
Content Accessibility
Enabled       Allowed        Not Allowed     Not Allowed     Not Allowed
Document Assembly                   Allowed        Not Allowed     Not Allowed     Not Allowed
Encryption Level                    Blank          40-bit RC4      40-bit RC4      40-bit RC4

I think it's the SecurityItem 8 (Content Accessibility) which prevents the function CopyPageRanges to work, isn't it?



Posted By: chicks
Date Posted: 05 Jul 06 at 8:29PM
Accessibility has to do with things like text-to-speech, etc. for the disabled. More likely the Document Assembly item is causing the problem.

If you know the owner password for the PDFs, you can unlock them using SetPassword() and Unencrypt().


Posted By: Pirmin
Date Posted: 08 Jul 06 at 12:45PM

Hi

There must be a different problem.
I have installed the trial software from http://www.verypdf.com/pdfpg - www.verypdf.com/pdfpg and extracted some pages from http://www.pirmin.gmxhome.de/MergesBlank1.pdf - www.pirmin.gmxhome.de/MergesBlank1.pdf and from "iSEDQuickPDF 5.11 Reference Guide.pdf" without any problem.
Trying the same pages with the above code always fails.
Any idea?

Pirmin



Posted By: chicks
Date Posted: 08 Jul 06 at 1:02PM
From their web site:

Supports "owner" password protected PDF files;

Does this mean, unlike QuickPDF, that it bypasses owner password protection?

Most legitimate products respect the protection, but since the PDF spec details how it works, it can be bypassed.

For example, when I try to "burst" the "iSEDQuickPDF 5.11 Reference Guide.pdf" with pdftk, it refuses to do so without the owner password.


Posted By: chicks
Date Posted: 08 Jul 06 at 1:35PM
Interesting - I downloaded it out of curiosity, and it definitely bypasses the PDF's security.

More interestingly, it appears to be using the open-source iText PDF library, and the compilation techniques shown by Sid Steward with his open-source pdftk project.

Then they are turning around a selling a product based on these open-source projects, without adding a bit of value to them. There are several free GUI front-ends for pdftk.

I suppose there are lots of people who don't know about the open-source projects this is based on who are paying for this. At least they give credit to Bruno Lowagie and GNU...




Posted By: Pirmin
Date Posted: 13 Jul 06 at 11:54AM

Hi

I was wondering if it is possible to make our library to support owner password protected PDF files as well and have been trying to find the concerning code for some hours without any success.

Just for curiosity, if somebody takes the time and succeeds, I am interested to see the result.

Remark: I'm not sure if I can answer your posts during one month.

Pirmin




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