Re: hplip-printer-app hangs and oddities (Re: Cups automatic duplex printing problems)

Valentijn Sessink <[email protected]> Tue, 9 Jul 2024 10:19:02 +0200
Newsgroups dev.linux.lists.printing-users
Message-ID <[email protected]>
Hi Michael, hello list,

On 09-07-2024 00:21, Michael Sweet wrote:
> Does the PPD file in question have any JCL options (look for JCLOpenUI)?

Yes it does (please see bug report, sorry it wasn't clickable due to the 
missing "h"). For your convenience:
https://github.com/OpenPrinting/hplip-printer-app/issues/17

> It is possible that the JCL code is missing a trailing newline which could cause this - in which case we should append one to make sure the JCL code doesn't prevent language switching...

Nope, there actually is a <0A> at the end, I did check that.

But please note that the %% is at the *beginning* of a PJL line, i.e. 
there are postscript comments already, where PJL is still being sent to 
the printer:

ยท%-12345X@PJL
@PJL JOB NAME = "Test Page" DISPLAY = "4 valentyn Test Page"
@PJL SET USERNAME = "valentyn"
%%@PJL ENTER LANGUAGE = PostScript
%!PS-Adobe-3.0

I can't figure out the code path. But if I change the code at the end of 
ppdEmitJCL() to:

   ppdEmit(ppd, fp, PPD_ORDER_JCL);
   fputs(ppd->jcl_end, fp);
   fputs(ppd->jcl_ps, fp);

... _and_ change the PPD file to say:
*JCLEnd: "END-OF-TASK<0A>"

... then the output to the printer says:

@PJL SET USERNAME = "valentyn"
%%END-OF-TASK
@PJL ENTER LANGUAGE = PostScript
%!PS-Adobe-3.0

So somewhere, something says "%%" to the printer, while there is still 
some PJL to be sent. But as said: I can't figure out the code path.

I can't think of anything else to try. Tried to get DEBUG_printf to work 
but my grasp of the whole cups/filtering stuff is too small to actually 
be able to get that to work. Also, "debian/rules clean" for some reason 
messes up the code base and I'm sort of unable to rebuild cleanly 
without re-unpacking the debian source. But that's all in the category 
of "I'm not an actual programmer" so you shouldn't bother.

But it is an actual bug that could potentially bug all printers with a 
ppd file that has PJL commands.

Best regards,

Valentijn
-- 
Durgerdamstraat 29, 1507 JL Zaandam; telefoon 075-7100071