• Problem with cups printing a bill

    From William Unruh@2:250/1 to All on Sun Oct 18 01:16:58 2020
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version. (stuff that is special to my bill--
    my name, address, due date, amount) is on the print version, but most of
    the text common to all bills (except the graphics type stuff) comes out
    blank.

    The bill s themselves at "stream" type.
    iHere is an exerpt
    .......
    7 0 obj^M
    << /Filter /FlateDecode /Length 021277 >>^M
    stream^M
    H<89>¤÷Í<8e>,9^Q<86>aì<8f>tî¡Ö,<9a>ú¯ê-^BFb^G^ZÍ^M Í° <85><80>^E·ÏûÙn·ÃN;#Ni¤©Êçtf:í<88>Ï
    ..........

    If I use qpdf to decode the stream and try to print the result, using lp
    once again all the boilerplate is gone. If I print from okular,
    the boiler plate prints.

    If I print from xpdf, the print job never exits and cups/error.log has
    lines like
    ....
    D [17/Oct/2020:16:53:20 -0700] [Job 635] envp[17]=\"CONTENT_TYPE=application/postscript\"
    ....
    D [17/Oct/2020:16:53:20 -0700] [Job 635] envp[34]=\"_=/usr/lib/cups/filter/gstoraster\"
    D [17/Oct/2020:16:53:20 -0700] [Job 635] Error: /undefined in ImData_44_0
    D [17/Oct/2020:16:53:20 -0700] [Job 635] Operand stack:
    D [17/Oct/2020:16:53:20 -0700] [Job 635] true false 96 2752 1344 160 D [17/Oct/2020:16:53:20 -0700] [Job 635] Execution stack:
    D [17/Oct/2020:16:53:20 -0700] [Job 635] %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1992 2 3 %oparray_pop 1991 2 3 %oparray_pop 1979 2 3 %oparray_pop 1833 2 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- rectfill (gx_device_pdf) (gs_pattern1_instance_t) (NULL) 6 %pattern_paint_finish --nostringval--
    D [17/Oct/2020:16:53:20 -0700] [Job 635] Dictionary stack:
    D [17/Oct/2020:16:53:20 -0700] [Job 635] --dict:735/1123(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)-- --dict:67/75(L)-- --dict:735/1123(ro)(G)-- --dict:67/75(L)-- --dict:18/25(L)-- --dict:9/15(L)-- --dict:9/15(L)-- --dict:0/15(L)--
    D [17/Oct/2020:16:53:20 -0700] [Job 635] Current allocation mode is local
    D [17/Oct/2020:16:53:20 -0700] [Job 635] GPL Ghostscript 9.27 Unrecoverable error, exit code 1

    which is a bit strange since it is a pdf file. Does xpdf automatically
    convert pdf to ps? Why would it?

    okular seems to do the same, also with contenttype postscript, but now
    it uses the filter gstopdf, rather than gstoraster.

    If I do
    lp telus/TTELUS-234551025-2020-10-14.pdf
    The CONTENT_TYPE=application/pdf, it gets sent through pdftopdf, and I
    lose the boilerplate text.
    If I just sent it directly through pdftopdf
    cat telus/TTELUS-234551025-2020-10-14.pdf |/lib/cups/filter/pdftopdf 1000 unruh test 1 - >/tmp/aa.pdf

    Then using xpdf or okular still sees the boilerplate.

    The printer is an HP M402 printer which IS supposed to be able to handle postscript.

    What is going on here? Any clues?

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Carlos E.R.@2:250/1 to All on Sun Oct 18 02:30:55 2020
    On 18/10/2020 02.16, William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version.

    They are probably not using standard plain pdf, but some extension. I
    would print directly from okular. If okular doesn't print it all, then I
    would go for some proprietary viewer, like Foxit perhaps.

    Just a quick guess, I'm going off to bed :-)

    Otherwise, just a plain bug. lp converts to text (a mistake) and skips
    the graphics (pdf2text?)

    --
    Cheers, Carlos.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Oct 18 02:48:42 2020
    On 2020-10-18, Carlos E.R. <robin_listas@es.invalid> wrote:
    On 18/10/2020 02.16, William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version.

    They are probably not using standard plain pdf, but some extension. I
    would print directly from okular. If okular doesn't print it all, then I would go for some proprietary viewer, like Foxit perhaps.

    Sure, but this certainly sounds like a bug. I tried printing from
    Acrobat, and again it seems to have converted it to postscript, then
    gone throught gstoraster, various rster manipulations and then
    rastertopdf, which is of course insane.

    Is there any way I can send the pdf file directly to the printer,
    without going through cups to see if it is cups rather than the printer
    that is the problem? The printer is attached to my computer via
    usb.


    Just a quick guess, I'm going off to bed :-)

    Otherwise, just a plain bug. lp converts to text (a mistake) and skips
    the graphics (pdf2text?)

    No, it converts to raster, not text which seems even more insane, and
    then back to pdf. Note that grphics on the page comes out fine, just not
    the text inside the graphics boxes.


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Jasen Betts@2:250/1 to All on Sun Oct 18 11:16:40 2020
    On 2020-10-18, William Unruh <unruh@invalid.ca> wrote:
    On 2020-10-18, Carlos E.R. <robin_listas@es.invalid> wrote:
    On 18/10/2020 02.16, William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version.

    They are probably not using standard plain pdf, but some extension. I
    would print directly from okular. If okular doesn't print it all, then I
    would go for some proprietary viewer, like Foxit perhaps.

    Sure, but this certainly sounds like a bug. I tried printing from
    Acrobat, and again it seems to have converted it to postscript, then
    gone throught gstoraster, various rster manipulations and then
    rastertopdf, which is of course insane.

    Is there any way I can send the pdf file directly to the printer,
    without going through cups to see if it is cups rather than the printer
    that is the problem? The printer is attached to my computer via
    usb.

    Is there a character device associated with the printer? you could try
    catting it to that. (but seeing as HP maybe not)

    Another trick is to prepend 5 NUL bytes to the file, that will turn
    off translation and send the raw data to the printer.

    No, it converts to raster, not text which seems even more insane, and
    then back to pdf. Note that grphics on the page comes out fine, just not
    the text inside the graphics boxes.

    It could be the text is omitted, or it could be a layering problem.


    --
    Jasen.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: JJ's own news server (2:250/1@fidonet)
  • From Vincent Coen@2:250/1 to William Unruh on Sun Oct 18 17:09:07 2020
    Hello William!

    Sunday October 18 2020 02:48, William Unruh wrote to All:

    On 2020-10-18, Carlos E.R. <robin_listas@es.invalid> wrote:
    On 18/10/2020 02.16, William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western
    Canada) and the bill looks fine in both okular and xpdf. However if
    I try to print the bill (lp bill.pdf) Almost all of the boilerplate
    text disappears from the printed version.

    They are probably not using standard plain pdf, but some extension.
    I would print directly from okular. If okular doesn't print it all,
    then I would go for some proprietary viewer, like Foxit perhaps.

    Sure, but this certainly sounds like a bug. I tried printing from
    Acrobat, and again it seems to have converted it to postscript, then
    gone throught gstoraster, various rster manipulations and then
    rastertopdf, which is of course insane.

    Is there any way I can send the pdf file directly to the printer,
    without going through cups to see if it is cups rather than the
    printer that is the problem? The printer is attached to my computer
    via usb.


    Just a quick guess, I'm going off to bed :-)

    Otherwise, just a plain bug. lp converts to text (a mistake) and
    skips the graphics (pdf2text?)

    No, it converts to raster, not text which seems even more insane, and
    then back to pdf. Note that grphics on the page comes out fine, just
    not the text inside the graphics boxes.


    Check what you have set up for the printer as the issue is there.
    If not using install cups and install the printer within using a different
    name and retry printing .


    Had some thing like it but it was coming from a m/f pdf file.

    Vincent


    SEEN-BY: 250/1 3
  • From F Russell@2:250/1 to All on Sun Oct 18 13:07:25 2020
    On Sun, 18 Oct 2020 01:48:42 +0000, William Unruh wrote:


    Is there any way I can send the pdf file directly to the printer,
    without going through cups


    Ghostscript can operate on a PDF file directly. For testing, just
    use ghostscript to output to a PNG image file:

    gs -q -dBATCH -dQUIET -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile=file%02d.png file.pdf

    This will produce one PNG image per page. Viewing the PNG
    images will show the PDF as it is. If it looks FUBAR, then
    the PDF is FUBAR.

    Note that the size of utility bills is usually NOT 8.5x11.

    To bypass CUPS and print directly to the printer is easy.

    Your printer is supported by hpijs:

    https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index

    Thus, just do:

    gs -q -dBATCH -dQUIET -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs \ -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="????" \ -dDEVICEWIDTHPOINTS=??? -dDEVICEHEIGHTPOINTS=??? -dDuplex=false -r600 \ -dIjsUseOutputFD -sOutputFile=/dev/usb/lp0 FILE.PDF

    Consult the printer manual for specific parameters.

    I would recommend just to excise CUPS completely. It is bloated
    junk. The direct output method is always the best and will
    never fail.



    --

    systemd free - always and forever
    DE free - always and forever

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: NewsGuy - Unlimited Usenet $23.95 (2:250/1@fidonet)
  • From Carlos E.R.@2:250/1 to All on Sun Oct 18 13:44:26 2020
    On 18/10/2020 03.48, William Unruh wrote:
    On 2020-10-18, Carlos E.R. <robin_listas@es.invalid> wrote:
    On 18/10/2020 02.16, William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version.

    They are probably not using standard plain pdf, but some extension. I
    would print directly from okular. If okular doesn't print it all, then I
    would go for some proprietary viewer, like Foxit perhaps.

    Sure, but this certainly sounds like a bug. I tried printing from
    Acrobat, and again it seems to have converted it to postscript, then
    gone throught gstoraster, various rster manipulations and then
    rastertopdf, which is of course insane.

    Is there any way I can send the pdf file directly to the printer,
    without going through cups to see if it is cups rather than the printer
    that is the problem? The printer is attached to my computer via
    usb.

    Only if the printer talks pdf directly. Mine handles ps, not pdf.

    Yes, it is called "raw printer".

    absolutely raw printer - from my notes:

    lpadmin -p QUEUE -v DeviceURI -E



    Just a quick guess, I'm going off to bed :-)

    Otherwise, just a plain bug. lp converts to text (a mistake) and skips
    the graphics (pdf2text?)

    No, it converts to raster, not text which seems even more insane, and
    then back to pdf. Note that grphics on the page comes out fine, just not
    the text inside the graphics boxes.



    --
    Cheers, Carlos.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Mike Easter@2:250/1 to All on Sun Oct 18 18:15:50 2020
    William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version. (stuff that is special to my bill--
    my name, address, due date, amount) is on the print version, but most of
    the text common to all bills (except the graphics type stuff) comes out blank.

    I have no experience w/ this.

    The chromium browser can display and print .pdf. Chromium can use
    configured printer/s or Google Cloud Print.

    Unfortunately, cloud print is going away at the end of this year.

    --
    Mike Easter

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Mike Easter@2:250/1 to All on Sun Oct 18 18:27:26 2020
    Mike Easter wrote:
    Google Cloud Print.

    Unfortunately, the HP page which is supposed to tell which printers can
    do cloud print is b0rken

    HP LaserJet M402dw

    Check here to verify whether or not your printer supports Google Cloud
    Print. http://support.hp.com/us-en/document/c04550279

    --
    Mike Easter

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Mike Easter@2:250/1 to All on Sun Oct 18 18:40:56 2020
    Mike Easter wrote:
    Unfortunately, the HP page which is supposed to tell which printers can
    do cloud print is b0rken

    Google's page suggests that HP LaserJet M402 members will probably work.

    --
    Mike Easter

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Andrei Z.@2:250/1 to All on Sun Oct 18 20:37:56 2020
    William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version. (stuff that is special to my bill--
    my name, address, due date, amount) is on the print version, but most of
    the text common to all bills (except the graphics type stuff) comes out blank.

    <snip>

    The printer is an HP M402 printer which IS supposed to be able to handle postscript.

    What is going on here? Any clues?


    FWIW

    Ubuntu package hplip-doc
    https://packages.ubuntu.com/en/focal/hplip-doc

    HP Linux Imaging and Printing (HPLIP) Help
    - Printing with HP Device Manager Print (hp-print)

    <quote>
    To print using HPLIP you can click the "Actions" Tab in hp-toolbox or
    run hp-print. Then the hp-print utility will run and will appear as
    shown below:
    ....
    From the Device Manager - Print Screen, you can see the file types that
    are supported as well as selecting which files to print, number of
    copies and so forth."
    </quote>

    HP Device Manager - MIME Types
    ...., application/pdf, application/postscript, ...

    man hp-print
    DESCRIPTION
    A simple print UI front-end to lp/lpr.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Oct 18 23:16:21 2020
    On 2020-10-18, Mike Easter <MikeE@ster.invalid> wrote:
    William Unruh wrote:
    I get my bills for Telus ( a local telphone company in western Canada)
    and the bill looks fine in both okular and xpdf. However if I try to
    print the bill (lp bill.pdf) Almost all of the boilerplate text
    disappears from the printed version. (stuff that is special to my bill--
    my name, address, due date, amount) is on the print version, but most of
    the text common to all bills (except the graphics type stuff) comes out
    blank.

    I have no experience w/ this.

    The chromium browser can display and print .pdf. Chromium can use configured printer/s or Google Cloud Print.

    Most other pdfs print fine, through lp, xpdf, okular. It is these pdfs
    which either only print half of the contents(lp), or crash cups (xpdf)
    or print fine (okular).

    Unfortunately, cloud print is going away at the end of this year.

    Why?


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Mike Easter@2:250/1 to All on Sun Oct 18 23:25:17 2020
    William Unruh wrote:
    Mike Easter wrote:

    Unfortunately, cloud print is going away at the end of this year.

    Why?

    It is one of a history of google 'experiments' which it decides to
    terminate; they/it doesn't usually give an explanation.

    --
    Mike Easter

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)