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 - ExtractPageRanges
  FAQ FAQ  Forum Search   Register Register  Login Login

ExtractPageRanges

 Post Reply Post Reply
Author
Message
mhc View Drop Down
Beginner
Beginner


Joined: 29 Dec 09
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhc Quote  Post ReplyReply Direct Link To This Post Topic: ExtractPageRanges
    Posted: 29 Dec 09 at 9:41PM
I have a PDF that I need to extract certain pages out and create another pdf with just those pages.  ISED seems to have the function:

QP.ExtractFilePages Input, Output, Pages

What I am passing is this:
QP.ExtractFilePages PDFName, NewPDF, "1-2"

When I do this the NewPDF does not get created.

Any help on why this does not work?
Back to Top
mhc View Drop Down
Beginner
Beginner


Joined: 29 Dec 09
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhc Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 09 at 9:57PM
Update:
I got it to create the file now but it only creates 1 page correctly.  Page 1 is correct and then Page 2 is blank.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 31 Dec 09 at 5:20PM
Hi mhc!

Here you'll find all you need for your first steps:
http://www.quickpdf.org/forum/quickpdf-the-first-steps_topic1242.html

Cheers and welcome here!
Ingo

Back to Top
mhc View Drop Down
Beginner
Beginner


Joined: 29 Dec 09
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhc Quote  Post ReplyReply Direct Link To This Post Posted: 31 Dec 09 at 5:26PM
Originally posted by Ingo Ingo wrote:

Hi mhc!

Here you'll find all you need for your first steps:
http://www.quickpdf.org/forum/quickpdf-the-first-steps_topic1242.html

Cheers and welcome here!
Ingo



Thanks Ingo,
This function does not work for some of our PDF's.  I tried another PDF it works but not others.   Do you have any ideas why it would work for some PDF's but not others?  I can email you the PDF it doesn't work for if you want.
Back to Top
shimax View Drop Down
Beginner
Beginner


Joined: 03 Oct 09
Location: Japan
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote shimax Quote  Post ReplyReply Direct Link To This Post Posted: 03 Jan 10 at 1:01AM

Hello mhc,

I confirmed what you have described.
It can be confirmed by simply downloading A Customizable Demo For Quick PDF Library at:
http://www.quickpdflibrary.com/blog/2009/10/a-customizable-demo-for-quick-pdf-library/

and by editing the sample code of ExtractFilePages like below:

//QP.ExtractFilePages(GetInputFolder() + "sign_me.pdf", GetOutputFolder() + "extracted_page_range.pdf", "2-5, 8, 10, 13-19");
QP.ExtractFilePages(GetInputFolder() + "Moby_Dick_NT.pdf", GetOutputFolder() + "extracted_page_range.pdf", "2-5, 8, 10, 13-19");

sign_me.pdf works but Moby_Dick_NT.pdf does not work well and 13 pages of blank pages are produced.

And I tested with other PDF files which I have, and encountered the strange things.
Some files failed in being extracted ( error code is 409: Invalid file structure, file is damaged.) but if I copy them from C drive to F drive, they success in being extacted.
I wonder why the same files show different results.

Maybe this phenomena is because of my special environment. My OS is Japanese (But in my tests, no unicode paths are involved. ), and I develop with PHP and ActiveX.

Anyway, I think your description can be confirmed in my environment.

Back to Top
DELBEKE View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert
Avatar

Joined: 31 Oct 05
Location: France
Status: Offline
Points: 151
Post Options Post Options   Thanks (0) Thanks(0)   Quote DELBEKE Quote  Post ReplyReply Direct Link To This Post Posted: 03 Jan 10 at 10:51AM
I think the problem come with an unusual  contruction of the Pages directory in the pdf
 
Usualy, a pages directoy look like this
  1 0 obj
  <<
  /Type /Pages
  /Count 2
  /Kids [ 2 0 R 134 0 R ] 
  >>
The count entry say how much pages are defined in the pdf and the kids entry show where the pages begin
 
When a Kid entry points to another page directory, ExtrafilePage is lost
 
In the sample the page 1 entry look like this
  2 0 obj
  <<
  /Type /Page
  /Parent 1 0 R
  /MediaBox [ 0 0 612 792 ]
  /CropBox [ 0 0 612 792 ]
  /Resources <<
  /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
  /XObject <<
  /iSQPIm1fead741 133 0 R
  >>
  >>
  /Contents [ 5 0 R ]
  >>
And the second one
  134 0 obj
  <<
  /Type /Pages
  /Count 1
  /Kids [ 135 0 R ]
  /Parent 1 0 R
  >>
  endobj
 
This one is a sub-page directory and if this construction is not a bad one, it is also unusual.
 
The ExtratPageFile can't handle it.
 
 


Edited by DELBEKE - 03 Jan 10 at 10:55AM
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