On 12/20/2012 2:19 AM, Per Jessen wrote:
Brian K. White wrote:
On 12/19/2012 4:38 AM, Per Jessen wrote:
I'm experimenting with adding a watermark/letterhead to a cups printing queue. I've seen a couple of suggestions on the net, the most promising ones by way of a cups filter and some postscript trickery. My problem is right now that the printjobs are sent as PJL, which ps2pdf, pdftk etc. cannot or will not deal with.
My situation is essentially - I have a letterhead document (in odt, pdf or ps format) that I would like to add to every page printed in a dedicated cups queue. I don't want to fiddle with the *office setup on any individual PC, I want this to happen transparently.
PJL? Really all PJL not just a little pjl header in front of pcl?
Well, yes, just a few lines in front and back. I don't have much experience with printing etc.
I'm now wondering if I could just separate the PJL lines from the postscript, do my merging/overlay, then add the PJL back?
Does pcl2pdf or pcl2ps render the files?
I did find some PCL-parser package, but not those two.
Sorry I thought you knew about the the ghostpdl package I have on OBS since you were familiar with pdftk which I also maintain, but pdftk is in the actual distro and ghostpdl isn't so I guess that wasn't a given.
This build is configured somewhat narrowly. It only has a few of the most generically useful output drivers compiled in. For all other oddball printers and graphics formats, I say just use any number of other converters from any of the common formats this can output.
It also has all X11 support stripped.
Then again this has one thing added that's not there by default, which is built-in tiffg3 output. It can produce output that is exactly perfectly native input for hylafax so that hylafax will not do any converting internally. Saves a lot of cpu and ram work when 50 application servers with hundreds of users each are all sending faxes over the net to one hylafax server.
It does take in PCL (PCL5 and lower) and PXL (PCL6) and output ps, pdf, png, jpg, tiffg3, tiffg4, a handful of others I don't remember but all I ever use is pdf and tiffg3.
In other words it's optimized for non-interactive headless use in print/fax/email filters and web cgi's etc.
You shouldn't have to strip the PJL from your print files. Many of my own print jobs include PJL routinely. ghostpcl interprets it at least as far as I've encountered. Any new print job that hasn't actually been tried yet may include commands or constructs that the interpreter fails to handle, but in general it understands pjl, pcl and I think hpgl too. "PCL" and "hplaser" usually actually means all three together.
Install the appropriate yast repo from the link above, then "zypper in ghostpdl"
If you're on 12.2 or newer, using the 12.1 version of either the rpm or the entire repo should be no problem.
After install, just run "pcl2pdf file.pcl"
It should generate a file.pdf
If your print files are named *.pcl then it will strip .pcl and add .pdf to make the output filename if none specified: pcl2pdf infile.pcl creates infile.pdf
If your print files are not named *.pcl then it will just append .pdf to the full input filename: pcl2pdf report.prn creates report.prn.pdf
If you specify an output filename it will do exactly that: pcl2pdf /path/to/inputfile /path/to/outputfile creates /path/to/outputfile
You can replace either input or output or both with "-" for stdin/stdout mypclwriter |pcl2pdf - output.pdf pcl2pdf somefile.pcl - |mypdfreader mypclwriter |pcl2pdf - - |mypdfreader
You can also use with no options if both in and out are piped: mypclwriter |pcl2pdf |mypdfreader