View Single Post
Old 12-16-2006, 05:08 PM   #32
alex_d
Addict
alex_d doesn't litteralex_d doesn't litter
 
Posts: 303
Karma: 187
Join Date: Dec 2006
Device: Sony Reader
mosh, but do those tools crop automatically? For page splitting i'm using pdftk (which seems a bit buggy, but I dunno). Another tool I could use is a good pdf decryptor (since pdftk doesn't want to touch encrypted files).

kovidgoyal, the pdfcrop script is very buggy and doesn't seem capable of dealing with Windows paths. It doesn't understand spaces within quotes (ie "c:\documents and settings\") and even passing it temp\stage1\0001.pdf yields:

Code:
F:\Books\Sony Reader formatted\PDFrasterFarian 0.9.9>pdfcrop.exe --verbose --gscmd gs\gs8.54\bin\gswin32c.exe  --margins 0 temp\stage1\0001.pdf temp\stage1\0001.crop.pdf
PDFCROP 1.5, 2004/06/24 - Copyright (c) 2002, 2004 by Heiko Oberdiek.
* Running ghostscript for BoundingBox calculation ...
* Page 1: 0 14 540 736
* Running pdfTeX ...
This is pdfeTeX, Version 3.141592-1.30.6-2.2 (MiKTeX 2.5)
entering extended mode
(tmp-pdfcrop-41252.tex
! Undefined control sequence.
\pdffile ->temp\stage
                      1\0001.pdf
\page ...box 0=\hbox {\pdfximage page #1{\pdffile
                                                  }\pdfrefximage \pdflastxim...
l.43 \page 1 [0 14 540 736]

! Undefined control sequence.
\pdffile ->temp\stage 1\0
                         001.pdf
\page ...box 0=\hbox {\pdfximage page #1{\pdffile
                                                  }\pdfrefximage \pdflastxim...
l.43 \page 1 [0 14 540 736]


Error:  (file temp1001.pdf): cannot find image file
 ==> Fatal error occurred, the output PDF file is not finished!
!!! Error: pdfTeX run failed!
Why does it think there is a space between "stage" and "1"? Do you think you could take a look at the perl? I don't know that language. It would also be nice to know what pdfetex is doing and if something simpler could replace it. EDIT: If ghostscript is calculating the actual autocropping, why do I need anything besides ghostscript?

Anyway, at least I got automatic page resizing working (no need to enter DPI anymore).

I keep putting off fixing the image filter, but that's probably more important than autocropping.

Last edited by alex_d; 12-16-2006 at 05:47 PM.
alex_d is offline   Reply With Quote