Is it possible to preserve external links in the produced PDF with
pdfcrop? (because of the loose of the PDF structure, I understand with
internal links cannot be kept, but the external ones can)
Thanks!
--
Maxime CHUPIN -- Membre de GUTenberg
http://mc.notezik.com -- http://www.gutenberg.eu.org
> Is it possible to preserve external links in the produced PDF with
> pdfcrop? (because of the loose of the PDF structure, I understand with
> internal links cannot be kept, but the external ones can)
pdfcrop uses pdfTeX to rewrite the pdf with changed media box.
This way all annotations, bookmarks, ... are lost.
You could use a PDF library that allows reading and writing
PDF files preserving its structure and change the
MediaBox and/or CropBox entries to your needs.
Without object stream compression these entries
can even be changed in the PDF file directly if
the size of the object does not change (The file offsets
of the objects are recorded in the xref table).
Another way is to get the BoundingBox using the
bbox device of ghostscript:
gs -sDEVICE=bbox -dBATCH -dNOPAUSE test.pdf
Then these values can be used to set the
CropBox (or MediaBox) during the generation of
the PDF file.
--
Heiko Oberdiek
> Chupin Maxime <m...@invalid.invalid> wrote:
>
> > Is it possible to preserve external links in the produced PDF with
> > pdfcrop? (because of the loose of the PDF structure, I understand
> > with internal links cannot be kept, but the external ones can)
>
> pdfcrop uses pdfTeX to rewrite the pdf with changed media box.
> This way all annotations, bookmarks, ... are lost.
>
Ok.
> Another way is to get the BoundingBox using the
> bbox device of ghostscript:
> gs -sDEVICE=bbox -dBATCH -dNOPAUSE test.pdf
Ok.
> Then these values can be used to set the
> CropBox (or MediaBox) during the generation of
> the PDF file.
>
So I did:
gs -sDEVICE=pdfwrite -o intro-crop.pdf -c "[/CropBox [139 575 472
666] /PAGES pdfmark" -f intro.pdf
Many thanks.