Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - CopyPageRanges results with blank pages
  FAQ FAQ  Forum Search   Register Register  Login Login

CopyPageRanges results with blank pages

 Post Reply Post Reply
Author
Message
Pirmin View Drop Down
Team Player
Team Player
Avatar

Joined: 28 Nov 05
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pirmin Quote  Post ReplyReply Direct Link To This Post Topic: CopyPageRanges results with blank pages
    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: www.pirmin.gmxhome.de/MergesBlank1.pdf
Even the "iSEDQuickPDF 5.11 Reference Guide.pdf" results in blank pages with CopyPageRanges.

Kind Regards
Pirmin

Back to Top
Pirmin View Drop Down
Team Player
Team Player
Avatar

Joined: 28 Nov 05
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pirmin Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Pirmin View Drop Down
Team Player
Team Player
Avatar

Joined: 28 Nov 05
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pirmin Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post 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().
Back to Top
Pirmin View Drop Down
Team Player
Team Player
Avatar

Joined: 28 Nov 05
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pirmin Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jul 06 at 12:45PM

Hi

There must be a different problem.
I have installed the trial software from www.verypdf.com/pdfpg and extracted some pages from 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



Edited by Pirmin
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post 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.


Edited by chicks
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post 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...


Back to Top
Pirmin View Drop Down
Team Player
Team Player
Avatar

Joined: 28 Nov 05
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pirmin Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store