[OS X TeX] [pdftk] MacOS Roman -> Western ISO Latin 9

David Watson dewatson at me.com
Sun Dec 14 04:30:49 CET 2008

On Dec 13, 2008, at 2:36 PM, Friedrich Vosberg wrote:

> Morning.
> I've changed the coding of my TeX source files to ISO Latin 9. But  
> unfortunately now my TeXShop script using pdftk doesn't work  
> anymore. And I have not a clue of an idea what may cause this fault.  
> The console reports:
> request id is Kellerdrucker-3754 (1 file(s))
> /Users/fv/Library/TeXShop/Engines/fvprint2.engine: line 4:  1306  
> Segmentation fault      pdftk "${basefname}.pdf" background ~/ 
> Pictures/Watermarks/bgabschrift.pdf output printfile.pdf
> lp: Error - unable to access "printfile.pdf" - No such file or  
> directory
> rm: printfile.pdf: No such file or directory
> The engine is:
> #!/bin/sh
> basefname="`basename "$1" .tex`"
> lp -o media=a4 "${basefname}.pdf"
> pdftk  "${basefname}.pdf" background ~/Pictures/Watermarks/ 
> bgabschrift.pdf output printfile.pdf
> lp -o sides=two-sided-long-edge -o media=a4 printfile.pdf
> rm printfile.pdf
> Does somebody know, why the workarround failed.

I am a little bit confused by your script.
To understand what you are doing here I would surmise from line 2:
You are setting a variable basefname to contain the result of basename  
"$1".tex, which is probably going to contain the argument to the  
script, which in texshop is probably going to be the name of the input  
So, this is going to give you the name of your input file, minus the  
".tex" extension.

Now, you are using "lp" with the option to set the media to a4, which  
is all well and good, but here is where you lose me:
you are trying to "lp" the file $(basefname).pdf
but at this point, nothing has been done to create the file $ 

You might want to do something like "pdflatex" or "pdfluaLaTeX" before  
you do this, because otherwise, you are never going to generate a pdf  
version as you seem to want to do.

Without the pdf file in hand, pdftk is just going to choke.
If you have successfully generated a pdf file at some point in history  
with the basename of your ".tex" input, then your script will happily  
run, although I think that is not what you intended.

> TIA and kind regards, Friedrich
> --
> »Der schlimmste Feind des Historikers ist der Zeitzeuge.«
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://www.esm.psu.edu/mac-tex/list/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/macostex-archives/attachments/20081213/34f8226e/attachment.html>

More information about the macostex-archives mailing list