[Printing-architecture] Number of copies in pure PDF workflow

Tobias Hoffmann lprint-list at thax.hardliners.org
Wed Oct 15 10:50:16 UTC 2014


On 14/10/14 23:09, Tobias Hoffmann wrote:
> On 14/10/14 21:17, Alex Korobkin wrote:
>> Shouldn't pdftopdf just insert PJL SET COPIES=X without any related 
>> code in PPD? PJL SET COPIES seems to be a standard PJL command.
>

Hmm, the biggest problem seems to be that everything from ppd->jcl_begin 
(i.e. for PCL: "\033%-12345X@") until ppd->jcl_ps (set to 
*JCLToPDFInterpreter in pdftopdf, i.e."ENTER LANGUAGE") is written by 
cups's ppdEmitJCL() function.
As far as I understand it, this are the options:

a) stick to what cups provides in terms of PPD settings (and probably 
move the Copies replacement code before ppdEmitJCL),

b) patch cups, namely ppdEmitJCL() in emit.c.
   As cups does detect PCL as JCL here and sets "JOB NAME", "DISPLAY" or 
"RDYMSG DISPLAY" that would be the best place to add PJL SET COPIES.
   But this will affect all PPDs with JCL, e.g. when pure PostScript is 
used... and, in case the patch is not accepted upstream, cups-filters 
has to ship it(?)

c) do not use ppdEmitJCL at all. We would loose e.g. JOB NAME, but have 
better control over the output...
   If you don't set *JCLToPDFInterpreter, and use *pdftopdfJCLBegin, 
together with more pdftopdfJCL* keywords, this could work. The current 
emitJCLOptions implementation does not insert newlines, though. I'm not 
sure if the PPD value could instead contain it, instead...
   I think Koji Otani only used the pdftopdfJCL* insertion to pass stuff 
to pdftoopvp, in a format that only used one line, separated by ";".
   One of his examples is:
>   *OpenUI *PageSize/Page Size: PickOne
>   *DefaultPageSize: A4
>   *PageSize A4/A4:
>   *pdftopdfJCLPageSize A4/A4: "PS=A4;"
>   *PageSize Letter/US Letter:
>   *pdftopdfJCLPageSize Letter/US Letter: "PS=LT;"
>   *CloseUI: *PageSize
   I do not understand his original design fully, yet.

d) We can try a hacky workaround: In pdftopdf_jcl.c, emitPreamble(), set 
ppd->jcl_ps to an empty string. Then ppdEmitJCL will not skip JCL 
processing all together, but it also will not write ENTER LANGUAGE at 
the end. But it will result in an empty line. Would that be a problem in 
PCL? After that we can write SET COPIES and ENTER LANGUAGE ourselves.
Or something like ppd->jcl_ps=concat("...SET COPIES...\n", 
JCLToPDFInterpreter->value) ?

And yes, Till basically has to decide how to proceed.

   Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/printing-architecture/attachments/20141015/0f6f312d/attachment.html>


More information about the Printing-architecture mailing list