🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19258

Re: How many PDF pages? [VB6-ID2]

#19258
From: Shane Stanley
Date: Mon, 30 Dec 2002 21:37
16 lines
1584 bytes
in article 1de72c92.-1@WebX.la2eafNXanI, Dave Rowland wrote:

> Is there anyway (without using Acrobat script) to count the pages in a PDF?

You have to parse the PDF. There was a discussion here about it a long time
ago; it might be in the archives. My code is AppleScript and uses text item
delimiters, which means it probably doesn't translate to VB very well.

Essentially, you look for lines that begin with "/Type" and also contain
"/Pages", check that "/Parent" doesn't appear before the following "endobj",
and if not look for the number following "/Count".

Sounds worse than it is...

-- 
Shane Stanley,  sstanley@myriad-com.com.au
Technical Details
Message-ID: <BA3707C9.49286%sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de72c92.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,d3471fa3e7b7e7c1
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-12-30 13:38:06 PST
From: Shane Stanley <sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: How many PDF pages? [VB6-ID2]
Message-ID: <BA3707C9.49286%sstanley@myriad-com.com.au>
Date: Mon, 30 Dec 2002 13:37:29 -0800
References: <1de72c92.-1@WebX.la2eafNXanI>
Lines: 22
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.6
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit