Re: GS 7.05 / PDF & pages count
"Pascal Chapuis" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.bugs |
|---|---|
| Organization | Guest of ProXad - France |
| Message-ID | <[email protected]> |
I'll send you an email I fairly interested in a "light" PDF parsing ! Many many thanks for advice. Pascal Chapuis "Russell Lang" <[email protected]> a écrit dans le message news: [email protected]... > > "Pascal Chapuis" <[email protected]> wrote in message > news:[email protected]... > > Here's what i'm doing : > > > > I print on a pseudo printer (postscript compliant) to get a spool file > > (.SPL) which one I intercept. > > > > I convert it to PDF with "gsapi_init_with_args" with argv: > > > ps2pdf -dNOPAUSE -q - -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=Test.PD > > F TEST.SPL > > > > and call "gsapi_run_string" (on PS file) with : > > "statusdict /pagecount known {statusdict begin pagecount 10 string cvs > > print end flush} if" > > > > Then a TStdioFunction output callback function (set in gsapi_set_stdio) > is > > called with OutputValue (%%Page...). > > I parse this OutputValue to find out the greater page number. > > > > Is there a shorter way to do that or is this correct ? > > That's a reasonable way to get the true page count of a PostScript > file (unless somebody wrote some code that produces a random > number of pages). > > > PS: I can't get the pages number with Pdf page object because it's > > unavailable with only "Acrobat Viewer"... The COM object implementation > > seems to be in "Acrobat" or "Acrobat Exchange" and I don't want to deploy > > extra software with my solution. > > I have recently written some code to scan PDF files to extract > the page count and each page orientation and size. > Send me email if you are interested in using this. > My email address is in the GSview documentation. > > >