philpem / printer-driver-ptouch

P-Touch PT-series and QL-series printer driver for Linux (under CUPS)
GNU General Public License v2.0
96 stars 24 forks source link

QL-700 no print, cups error about pfdtops-renderer #29

Closed rhaamo closed 1 year ago

rhaamo commented 1 year ago

I have installed the driver from git on manjaro (cups 2.4.2) and used the driver after that in cups Brother QL-700 Foomatic/ptouch-ql (recommended) (grayscale).

I've tried to use the brother templates in libreoffice with a 38x90mm label roll and CUPS yells at me:

"Use "pdftops-renderer" option (see cups-filters README file) to use Ghostscript or MuPDF for the PDF -> PostScript conversion."

and nothing comes out of the printer but the led blinks red until I press the power button.

I have no idea what to do to debug that issue, from random tries the files convert properly to raster and ptch. Attached is one PDF grabbed from CUPS spool dir. d00027-001.pdf

~/Downloads ❯ /usr/lib/cups/filter/gstoraster 999 unused unused 1 "" d00027-001.pdf > d00027-001.raster
DEBUG: OUTFORMAT="<none>", so output format will be CUPS/PWG Raster
DEBUG: Color Manager: Calibration Mode/Off
DEBUG: Color Manager: Invalid printer name.
DEBUG: Color Manager: Invalid input - Unable to find profile.
DEBUG: Color Manager: ICC Profile: None
DEBUG: Ghostscript using Any-Part-of-Pixel method to fill paths.
DEBUG: Ghostscript command line: gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dShowAcroForm -sstdout=%stderr -sOutputFile=%stdout -sDEVICE=cups -sMediaClass=PwgRaster -sOutputType=Automatic -r600x600 -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=19 -dcupsBorderlessScalingFactor=0.0000 -dcupsInteger0=1 -dcupsInteger1=1 -dcupsInteger2=1 -scupsPageSizeName=na_letter_8.5x11in -I/usr/share/cups/fonts -c -f -_
DEBUG: envp[0]="_tide_color_separator_same_color="
...
DEBUG: envp[74]="SSH_AUTH_SOCK=/tmp/ssh-XXXXXX04G1Yt/agent.1672"
INFO: Start rendering...
INFO: Processing page 1...
INFO: Processing page 2...
INFO: Rendering completed
~/Downloads ❯ /usr/lib/cups/filter/rastertoptch -i d00027-001.raster "" -o d00027-001.ptch
DEBUG: rastertoptch: job options: 
DEBUG: rastertoptch: PageSize: 0.00x0.00 pt / 0.00x0.00 mm / 0.00x0.00 px
DEBUG: rastertoptch: ImagingBoundingBox: 0.00 0.00 0.00 0.00 pt / 0.00 0.00 0.00 0.00 mm /0.00 0.00 0.00 0.00 px
DEBUG: rastertoptch: HWResolution: 600x600dpi
DEBUG: rastertoptch: Width Height: 2125 900
DEBUG: rastertoptch: NegativePrint: 0
INFO: printing page 1, 100% done
PAGE: 1 1
~/Downloads ❯ lpoptions -d Brother_QL-700 -l
PageSize/Page Size: Custom.WIDTHxHEIGHT 12mm 12mm-circular 17x54mm 17x87mm 23x23mm 24mm-circular 29mm 29x90mm 38mm 38x90mm 50mm 54mm 58mm-circular *62mm 62x29mm 62x100mm
PrintQuality/Print Quality: *High Fast
MirrorPrint/Mirror Print: True *False
PrintDensity/Print Density: *0PrinterDefault 1VeryLight 2Light 3Medium 4Dark 5VeryDark
AutoCut/Auto Cut: *True False
AutoEject/Auto Eject: *True False
CutLabel/Cut every: *0 1 2 3 4 5 6 7 8 9 10
ExtraMargin/Extra Margin (ignored for die-cut tape): *0mm 1mm 2mm 3mm 4mm 5mm 6mm 7mm 8mm 9mm 10mm 11mm 12mm 13mm 14mm 15mm 16mm 17mm 18mm 19mm 20mm 21mm 22mm 23mm 24mm 25mm 26mm 27mm
MediaType/Media Type: Labels *Tape

I have also tried lpadmin -p Brother_QL-700 -o pdftops-renderer-default=gs and after that no more warning but still nothing printed and blinky red :(

I have switched cups logs to debug, and there isn't really anything interesting (no errors) except maybe that part I guess:

D [26/Mar/2023:14:06:50 +0200] [Job 72] File contains 1 pages.
D [26/Mar/2023:14:06:50 +0200] [Job 72] Starting process \"pdf-to-ps\" (generation 1)
D [26/Mar/2023:14:06:50 +0200] [Job 72] Printer make and model: Brother QL-700
D [26/Mar/2023:14:06:50 +0200] [Job 72] Running command line for pstops: pstops 72 dashie \'38mm - 90mm.odt\' 1 \' PageSize=38x90mm job-uuid=urn:uuid:9ae33c3c-99fc-3c78-7dae-66e4f9890845 pdftops-renderer=gs job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1679832410 time-at-processing=1679832410 document-name-supplied=03bBy4\'
D [26/Mar/2023:14:06:50 +0200] [Job 72] No resolution information found in the PPD file.
D [26/Mar/2023:14:06:50 +0200] [Job 72] Using image rendering resolution 300 dpi
D [26/Mar/2023:14:06:50 +0200] [Job 72] Deactivation of Ghostscript\'s image compression for Brother printers to workarounmd PS interpreter bug
D [26/Mar/2023:14:06:50 +0200] [Job 72] Running command line for gs: gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS -sstdout=%stderr -sDEVICE=ps2write -dShowAcroForm -sOUTPUTFILE=%stdout -sProcessColorModel=DeviceGray -sColorConversionStrategy=Gray -dLanguageLevel=2 -r300 -dCompressFonts=false -dNoT3CCITT -dEncodeMonoImages=false -dEncodeColorImages=false -dNOINTERPOLATE -c \'save pop\' -f /var/spool/cups/tmp/foomatic-ARLsx1
D [26/Mar/2023:14:06:50 +0200] [Job 72] Started filter gs (PID 58004)
D [26/Mar/2023:14:06:50 +0200] [Job 72] Started post-processing (PID 58005)
D [26/Mar/2023:14:06:50 +0200] [Job 72] Started filter pstops (PID 58006)
D [26/Mar/2023:14:06:50 +0200] [Job 72] Inserted workaround PostScript code for Brother printers
D [26/Mar/2023:14:06:50 +0200] [Job 72] Page = 108x255; 4,8 to 104,247
D [26/Mar/2023:14:06:50 +0200] [Job 72] slow_collate=0, slow_duplex=0, slow_order=0
D [26/Mar/2023:14:06:50 +0200] [Job 72] Before copy_comments - %!PS-Adobe-3.0
D [26/Mar/2023:14:06:50 +0200] [Job 72] %!PS-Adobe-3.0
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%Invocation: gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS -sstdout=? -sDEVICE=ps2write -dShowAcroForm -sOUTPUTFILE=? -sProcessColorModel=DeviceGray -sColorConversionStrategy=Gray -dLanguageLevel=2 -r300 -dCompressFonts=false -dNoT3CCITT
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%+ -dEncodeMonoImages=false -dEncodeColorImages=false -dNOINTERPOLATE ? ? -f ?
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%BoundingBox: 0 0 108 255
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%HiResBoundingBox: 0 0 108.00 255.00
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%Creator: GPL Ghostscript 10000 (ps2write)
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%LanguageLevel: 2
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%CreationDate: D:20230326140650+02\'00\'
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%Pages: 1
D [26/Mar/2023:14:06:50 +0200] [Job 72] %%EndComments
D [26/Mar/2023:14:06:50 +0200] [Job 72] Before copy_prolog - %%BeginProlog
D [26/Mar/2023:14:06:50 +0200] [Job 72] Filetype: PostScript
D [26/Mar/2023:14:06:50 +0200] [Job 72] Reading PostScript input ...
D [26/Mar/2023:14:06:50 +0200] [Job 72] --> This document is DSC-conforming!
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found %RBINumCopies: 1
D [26/Mar/2023:14:06:50 +0200] [Job 72] -----------
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginProlog
D [26/Mar/2023:14:06:50 +0200] [Job 72] Inserting option code into \"Prolog\" section.
D [26/Mar/2023:14:06:50 +0200] [Job 72] PID 58004 (gs) exited with no errors.
D [26/Mar/2023:14:06:50 +0200] [Job 72] Before copy_setup - %%Page: 1 1
D [26/Mar/2023:14:06:50 +0200] [Job 72] Before page loop - %%Page: 1 1
D [26/Mar/2023:14:06:50 +0200] [Job 72] Copying page 1...
D [26/Mar/2023:14:06:50 +0200] [Job 72] pagew = 99.4, pagel = 238.2
D [26/Mar/2023:14:06:50 +0200] [Job 72] bboxx = 0, bboxy = 0, bboxw = 108, bboxl = 255
D [26/Mar/2023:14:06:50 +0200] [Job 72] PageLeft = 4.3, PageRight = 103.7
D [26/Mar/2023:14:06:50 +0200] [Job 72] PageTop = 246.6, PageBottom = 8.4
D [26/Mar/2023:14:06:50 +0200] [Job 72] PageWidth = 108.0, PageLength = 255.0
D [26/Mar/2023:14:06:50 +0200] [Job 72] Wrote 1 pages...
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%EndProlog
D [26/Mar/2023:14:06:50 +0200] [Job 72] -----------
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginSetup
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *MediaType Tape
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: MediaType=Tape
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: MediaType=Tape
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: MediaType=Tape
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *PageSize 38x90mm
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: PageSize=38x90mm
D [26/Mar/2023:14:06:50 +0200] [Job 72] --> Option will be set by PostScript interpreter
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *CutLabel 0
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: CutLabel=0
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: CutLabel=0
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: CutLabel=0
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *ExtraMargin 0mm
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: ExtraMargin=0mm
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: ExtraMargin=0mm
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: ExtraMargin=0mm
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *AutoCut True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: AutoCut=True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: AutoCut=True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: AutoCut=True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *MirrorPrint False
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: MirrorPrint=False
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: MirrorPrint=False
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: MirrorPrint=False
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *AutoEject True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: AutoEject=True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: AutoEject=True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: AutoEject=True
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *PrintDensity 0PrinterDefault
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: PrintDensity=0PrinterDefault
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: PrintDensity=0PrinterDefault
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: PrintDensity=0PrinterDefault
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginFeature: *PrintQuality High
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: PrintQuality=High
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %% FoomaticRIPOptionSetting: PrintQuality=High
D [26/Mar/2023:14:06:50 +0200] [Job 72] Option: PrintQuality=High
D [26/Mar/2023:14:06:50 +0200] [Job 72] Setting option
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%EndSetup
D [26/Mar/2023:14:06:50 +0200] [Job 72] -----------
D [26/Mar/2023:14:06:50 +0200] [Job 72] New page: %%Page: 1 1
D [26/Mar/2023:14:06:50 +0200] [Job 72] \"Setup\" section is missing, inserting it.
D [26/Mar/2023:14:06:50 +0200] [Job 72] Inserting option code into \"Setup\" section.
D [26/Mar/2023:14:06:50 +0200] [Job 72] Found: %%BeginPageSetup
D [26/Mar/2023:14:06:50 +0200] [Job 72] Inserting option code into \"PageSetup\" section.
D [26/Mar/2023:14:06:50 +0200] [Job 72] PID 58006 (pstops) exited with no errors.
D [26/Mar/2023:14:06:50 +0200] [Job 72] PID 58005 (Post-processing) exited with no errors.
D [26/Mar/2023:14:06:50 +0200] [Job 72] Flushing FIFO.
D [26/Mar/2023:14:06:50 +0200] [Job 72] Starting renderer with command: \"gs -sstdout=%stderr  -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=cups  -r300x300 -sOutputFile=%stdout -_ | rastertoptch \' QL  PixelXfer=ULP  BytesPerLine=90  Align=Right  MediaType=Tape  SoftwareMirror  LabelPreamble  MinMargin=8.4  Margin=0  CutLabel=0  noChainPrinting  AutoCut  PrintDensity=0  PrintQuality=High \'\"
D [26/Mar/2023:14:06:50 +0200] [Job 72] Starting process \"kid3\" (generation 1)
D [26/Mar/2023:14:06:50 +0200] [Job 72] Starting process \"kid4\" (generation 2)
D [26/Mar/2023:14:06:50 +0200] [Job 72] Starting process \"renderer\" (generation 2)
D [26/Mar/2023:14:06:50 +0200] [Job 72] JCL: \033%-12345X@PJL
D [26/Mar/2023:14:06:50 +0200] [Job 72] <job data> 
D [26/Mar/2023:14:06:50 +0200] [Job 72] rastertoptch: job options:  QL  PixelXfer=ULP  BytesPerLine=90  Align=Right  MediaType=Tape  SoftwareMirror  LabelPreamble  MinMargin=8.4  Margin=0  CutLabel=0  noChainPrinting  AutoCut  PrintDensity=0  PrintQuality=High 
D [26/Mar/2023:14:06:50 +0200] [Job 72] Start rendering...
D [26/Mar/2023:14:06:50 +0200] cupsdMarkDirty(---J-)
D [26/Mar/2023:14:06:50 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [26/Mar/2023:14:06:50 +0200] [Job 72] Set job-printer-state-message to "Start rendering...", current level=INFO
D [26/Mar/2023:14:06:50 +0200] [Job 72] Processing page 1...
D [26/Mar/2023:14:06:50 +0200] cupsdMarkDirty(---J-)
D [26/Mar/2023:14:06:50 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [26/Mar/2023:14:06:50 +0200] [Job 72] Set job-printer-state-message to "Processing page 1...", current level=INFO
D [26/Mar/2023:14:06:50 +0200] cupsdMarkDirty(----S)
D [26/Mar/2023:14:06:50 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [26/Mar/2023:14:06:50 +0200] cupsdMarkDirty(----S)
D [26/Mar/2023:14:06:50 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
philpem commented 1 year ago

Can you please answer a couple of questions?

The PDF renderer thing sounds like a CUPS issue, but it's one I've never seen myself. It seems like LibreOffice is asking CUPS to print a PDF, but CUPS doesn't know how to handle it. I've had issues printing labels from LibreOffice in the past, and for this reason I usually use GLabels. Though I have to confess I haven't tried LibreOffice recently.

The angry blinking red light can pop up for a couple of reasons, but the most common is a mismatch between the label size and the labels in the printer. The following settings need to match the label stock:

To actually figure out what it's upset about involves sending a QL "read status" command, and sadly that's something the driver doesn't do -- as far as I know, raster drivers have no way of doing bidirectional communications with the printer.

Looking at your logs (thanks for including those by the way!) you're setting the printer up for 38x90mm labels, using continuous label tape. That means the printer is expecting you to have Brother DK-22225 continuous tape labels loaded.

I'm going to take a wild guess that you have the Brother DK-11208 38x90mm labels loaded - as most of my QL printers came with a sample roll of these in the box.

If you send a continous-length-labels job to a printer which has die-cut labels loaded, the printer will reject the job and blink the red light.

To get your printer to print on these, you need to set the MediaType field to Labels -- in the Print Settings this should appear as Media Type: Die-Cut Labels. (it's probably set to "continuous-length tape")

The printers can communicate error codes back to the host as part of the "status request" response (see https://download.brother.com/welcome/docp000678/cv_qlseries_eng_raster_600.pdf) but sadly I don't know how to add support for this to CUPS.

In the longer term I'd like to add QL and P-touch support to LPrint (https://github.com/michaelrsweet/lprint), and that will likely include some form of status monitoring and data massaging - i.e. if the job requests diecut labels but the printer has continuous tape loaded, that job could be printed provided the label width matches the job.

rhaamo commented 1 year ago

Thanks! You were right on the media type, I did had it on the default which was Tape, changed it for Labels and ... it works.

I thought I had tested that but I might not, or had some other thing causing it to fails.