Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

adding crop marks to pdf

499 views
Skip to first unread message

Lutrin

unread,
Oct 8, 2008, 4:41:32 PM10/8/08
to
Hi

assuming I want add crop marks to pdf (directly to pdf) How can I do this
task? I'm working in Linux but, if any program is, working in wine, I can
use this in Linux
--
Puppy Linux wiki: http://puppylover.netsons.org/dokupuppy
Puppy Linux Forum: http://puppylinux.ilbello.com
Windows me genuit, Ubuntu rapuere / tenet nunc Puppy Linux...

Rowan

unread,
Oct 9, 2008, 6:36:16 AM10/9/08
to

Unfortunately there's a serious lack of PDF tools for Linux at the
moment. What you're trying to do could be accomplished on Windows
using PDF Enhancer or either Quite Imposing or PitStop Pro, which are
both plug-ins for Acrobat. But, that's probably not what you're
looking for.

Hopefully someone has a suggestion for a work around because I wasn't
able to find any tools for Linux that would let you add crop marks
directly to a PDF.

Rowan
------------------------------------------------------------------
4xPDF - PDF News, Articles, Tips and Rants
http://www.pdfpdfpdfpdf.com/

Martin Heller

unread,
Oct 9, 2008, 9:07:57 AM10/9/08
to
Lutrin skrev:

> assuming I want add crop marks to pdf (directly to pdf) How can I do this
> task? I'm working in Linux but, if any program is, working in wine, I can
> use this in Linux

You can use pdflatex. If foobar.pdf is a document formatted on
a5paper then you can print it on a4 and add cropmarks by running
pdflatex on a document like below:

\documentclass{article}
\usepackage{pdfpages}
\usepackage[a5paper]{geometry}
\usepackage[cam,a4,center,pdftex]{crop}

\begin{document}

\includepdf[pages=-]{foobar}

\end{document}

rpresser

unread,
Oct 9, 2008, 12:18:35 PM10/9/08
to
On Oct 9, 6:36 am, Rowan <rowan.ha...@gmail.com> wrote:
> On Oct 8, 10:41 pm, Lutrin <elic...@olympo.it> wrote:
>
> > Hi
>
> > assuming I want add crop marks to pdf (directly to pdf) How can I do this
> > task? I'm working in Linux but, if any program is, working in wine, I can
> > use this in Linux
> > --
> > Puppy Linux wiki:  http://puppylover.netsons.org/dokupuppy
> > Puppy Linux Forum:http://puppylinux.ilbello.com
> > Windows me genuit, Ubuntu rapuere / tenet nunc Puppy Linux...
>
> Unfortunately there's a serious lack of PDF tools for Linux at the
> moment. What you're trying to do could be accomplished on Windows
> using PDF Enhancer or either Quite Imposing or PitStop Pro, which are
> both plug-ins for Acrobat. But, that's probably not what you're
> looking for.
>
> Hopefully someone has a suggestion for a work around because I wasn't
> able to find any tools for Linux that would let you add crop marks
> directly to a PDF.

If you generate your cropmarks on another blank PDF -- using
OpenOffice, or direct postscript distilled to PDF, or whatever --
pdftk (on Linux) can place them on top of the original.

Or, 20 minutes could get you a java program using the iText library
(in java) that could do the whole thing ab initio.

But pdflatex, as Martin suggests, is even easier if you grok it.

Lutrin

unread,
Oct 9, 2008, 2:47:01 PM10/9/08
to
On Thu, 09 Oct 2008 09:18:35 -0700, rpresser ci disse:

> If you generate your cropmarks on another blank PDF --

[...]
interesting

> using OpenOffice,
[...]
unfortunately OpenOffice don't gives any chance to create automatically
crop marks, but, I can create manually and then export as pdf

> or direct postscript distilled to PDF, or whatever

[...]
with a tryout version of Indesign, I can set a page (17x24 cm in my case)
with same margins as my pdf file and then export with crop marks. Indesign
don't work good in Wine on Linux, but I think yhis feature is available at
least

> pdftk (on Linux) can place them on top of the original.

[...]
as layer? very good, but how do this? what part of pdftk manual I must
read to perform this task?

Lutrin

unread,
Oct 9, 2008, 2:49:27 PM10/9/08
to
On Thu, 09 Oct 2008 15:07:57 +0200, Martin Heller ci disse:

> You can use pdflatex. If foobar.pdf is a document formatted on a5paper
> then you can print it on a4 and add cropmarks by running pdflatex on a
> document like below:

[...]
Yes, I have already LaTeX package installed, only my trouble is my page
has format 17 x 24 cm, so I don't know if this page format is already in
LaTeX. if not, I think I must add this pageformat before to run your code

Martin Heller

unread,
Oct 9, 2008, 3:21:45 PM10/9/08
to
Lutrin skrev:

> On Thu, 09 Oct 2008 15:07:57 +0200, Martin Heller ci disse:
> Yes, I have already LaTeX package installed, only my trouble is my page
> has format 17 x 24 cm, so I don't know if this page format is already in
> LaTeX. if not, I think I must add this pageformat before to run your code

You just have to specify which paper size you are using:

% foobar-crop.tex
\documentclass{article}
\usepackage{pdfpages}
\usepackage[paperwidth=17cm,paperheight=24cm]{geometry}
\usepackage[cam,a4,center,pdftex]{crop}

\begin{document}

\includepdf[pages=-]{foobar}

\end{document}

compiling with
$ pdflatex foobar-crop.tex

will get you foobar-crop.pdf.

To see the documentation og the used packages run

$ texdoc geometry
$ texdoc pdfpages
$ texdoc crop

in a terminal.

Martin Heller

unread,
Oct 9, 2008, 3:28:38 PM10/9/08
to
Lutrin skrev:

> as layer? very good, but how do this? what part of pdftk manual I must
> read to perform this task?

Did you try

$ pdftk --help


I think

$ pdftk foobar.pdf stamp crop.pdf output foobar-crop.pdf

should do the job. But the crop marks will not be added as a an
Optional Contents Group (OCG), if that is what you mean by layer.
I don't think that is possible with pdftk.

Lutrin

unread,
Oct 9, 2008, 4:07:01 PM10/9/08
to
On Thu, 09 Oct 2008 21:28:38 +0200, Martin Heller ci disse:

> I think
>
> $ pdftk foobar.pdf stamp crop.pdf output foobar-crop.pdf
>
> should do the job.

[...]

result of command:

pdftk foobar.pdf stamp crop.pdf output foobar_crop.pdf

Error: Failed to open PDF file:
stamp
Errors encountered. No output created.
Done. Input errors, so no output created.

it seems that don't recognizes *stamp* command, I will further investigate

Peter Flynn

unread,
Oct 9, 2008, 5:55:08 PM10/9/08
to
Rowan wrote:
> On Oct 8, 10:41 pm, Lutrin <elic...@olympo.it> wrote:
>> Hi
>>
>> assuming I want add crop marks to pdf (directly to pdf) How can I do this
>> task? I'm working in Linux but, if any program is, working in wine, I can
>> use this in Linux
>> --
>> Puppy Linux wiki: http://puppylover.netsons.org/dokupuppy
>> Puppy Linux Forum:http://puppylinux.ilbello.com
>> Windows me genuit, Ubuntu rapuere / tenet nunc Puppy Linux...
>
> Unfortunately there's a serious lack of PDF tools for Linux at the
> moment. What you're trying to do could be accomplished on Windows
> using PDF Enhancer or either Quite Imposing or PitStop Pro, which are
> both plug-ins for Acrobat. But, that's probably not what you're
> looking for.
>
> Hopefully someone has a suggestion for a work around because I wasn't
> able to find any tools for Linux that would let you add crop marks
> directly to a PDF.

You can pass the PDF through LaTeX, using the pdfpages package and the
crop package. This does assume, however, that the print-area on each
page of the original PDF is in the same relative place (or at least
shifts predictably, like the L-R margin shift in a book).

///Peter

Martin Heller

unread,
Oct 10, 2008, 3:48:34 AM10/10/08
to
Lutrin skrev:

> On Thu, 09 Oct 2008 21:28:38 +0200, Martin Heller ci disse:
>
>> I think
>>
>> $ pdftk foobar.pdf stamp crop.pdf output foobar-crop.pdf
>>
>> should do the job.
> [...]
>
> result of command:
>
> pdftk foobar.pdf stamp crop.pdf output foobar_crop.pdf
>
> Error: Failed to open PDF file:
> stamp
> Errors encountered. No output created.
> Done. Input errors, so no output created.
>
> it seems that don't recognizes *stamp* command, I will further investigate

Did you create the file crop.pdf containing the crop marks you
want to add? I get an error if the file I am trying to use as
stamp does not exist:

Error: Failed to open stamp PDF file:
xyz.pdf
No output created.

Martin Heller

unread,
Oct 10, 2008, 4:03:18 AM10/10/08
to
Lutrin skrev:

> it seems that don't recognizes *stamp* command, I will further investigate

It seems that you need at least version 1.40 of pdftk in order to
have the stamp operation available. If your version of pdftk is
older you will have to update or use the background operation.

From the pdftk version history:

1.40 - September 19, 2006

* Added the stamp operation, a natural complement to the
existing background operation.

Lutrin

unread,
Oct 10, 2008, 6:23:10 AM10/10/08
to
On Fri, 10 Oct 2008 10:03:18 +0200, Martin Heller ci disse:

> If your version of pdftk is
> older you will have to update or use the background operation

[...]
in fact I was using 1.12 version, I tried today to update pdftk version,
but I have problems with libgcc_s.so.1

libgcc_s.so.1: version `GCC_4.2.

because my libgcc_s.so.1 is not that version and upgrading may cause
system instability

it's possible to do same task without upgrading or not?

Martin Heller

unread,
Oct 10, 2008, 7:18:54 AM10/10/08
to
Lutrin skrev:

> On Fri, 10 Oct 2008 10:03:18 +0200, Martin Heller ci disse:
>
>> If your version of pdftk is
>> older you will have to update or use the background operation
> [...]
> in fact I was using 1.12 version, I tried today to update pdftk version,

> it's possible to do same task without upgrading or not?

As I said you can use the background operation.

Or use the LaTeX approach suggested by Peter Flynn and myself.

Lutrin

unread,
Oct 10, 2008, 8:00:40 AM10/10/08
to
On Fri, 10 Oct 2008 13:18:54 +0200, Martin Heller ci disse:

> As I said you can use the background operation.
>
> Or use the LaTeX approach suggested by Peter Flynn and myself.

[...]
thanks. solved with pdftk 1.12 and background command but I'll try also
LaTeX way. thanks again

0 new messages