A little experiment - running the filters by hand as described here...
http://www.penguintutor.com/linux/printing-cups See if you can take a the CUPS testprint page, create a PDF, and run the pdftops filter successfully by hand.... Code:
export PPD=/etc/cups/ppd/HP_Color_LaserJet_CM2320nf_MFP.ppd |
Hi Ferrari,
I have executed the commands and this are the results: Code:
pi@raspberrypi:~ $ /usr/lib/cups/filter/bannertopdf 1 tim '' 1 '' </usr/share/cups/data/testprint >bannertopdf.pdf Code:
pi@raspberrypi:~ $ /usr/lib/cups/filter/pdftops 1 tim '' 1 '' <bannertopdf.pdf >pdftops.ps Seeing the error (DEBUG: Could not open PPD file '/etc/cups/ppd/HP_Color_LaserJet_CM2320nf_MFP.ppd') as user pi I have tried also to execute it from root Code:
root@raspberrypi:/home/pi# /usr/lib/cups/filter/bannertopdf 1 tim '' 1 '' </usr/share/cups/data/testprint >bannertopdf.pdf Code:
root@raspberrypi:/home/pi# /usr/lib/cups/filter/pdftops 1 tim '' 1 '' <bannertopdf.pdf >pdftops.ps Code:
pi@raspberrypi:~ $ gs -sDEVICE=cups -dNOPAUSE -dBATCH -sOutputFile=out Visite.pdf Code:
pi@raspberrypi:~ $ /usr/lib/cups/filter/pdftoraster 1 tim '' 1 '' <bannertopdf.pdf >pdftoraster.ras |
Ok, that pdftops filter test seems to have executed without issue. BTW, you should be able to view the created pdftops.ps file with gs like this
Code:
gs pdftops.ps BTW, there was no need to test gs specifically - it is called by pdftops for rendering anyway. The pdftoraster filter is also not involved in the filter chain for your printer, so irrelevant here. |
Hi Ferrari,
cups-filter version is 1.11.6 Code:
apt-cache policy libcupsfilters1 Gian Carlo |
Quote:
The pdftops filter uses Ghostscript by default, but it is possible to switch from Ghostscript to Poppler if required. This might be worth a shot here. You can run the following commands in a terminal window for switching between Ghostscript and Poppler: lpadmin -p <printer> -o pdftops-renderer-default=gs lpadmin -p <printer> -o pdftops-renderer-default=pdftops Reference: CUPS bug report So, for your printer you could try Code:
lpadmin -p HP_Color_LaserJet_CM2320nf_MFP -o pdftops-renderer-default=pdftops Code:
Option pdftops-renderer pdftops |
3 Attachment(s)
Hi Ferrari,
I have added Code:
Option pdftops-renderer pdftops Code:
lpadmin -p HP_Color_LaserJet_CM2320nf_MFP -o pdftops-renderer-default=pdftops This are the results in the order that I have tested: TEST 1 Sent an email with txt in the body and attached PDF txt converted by my script to PS printed correctly (JOB 1263) PDF not printed (JOB 1264): Printed a page with the following informations: ERROR: syntaxerror OFFENDING COMMAND: J b= @7Z $ / STACK sfnts, --mark--,--string--,--string--,--string--,--string--,--string--,--string--,--string--, --string--,--string--,--string--,--string--,--string--,--string--,--string--,--string--, --string--,--string--,--string--,--string--,--string--,--string--,--string--,--string--, --string--,--string--,--string--,--string--,--string--,--string--,--string--,--string--, --string--,--string--,--string--,--string--,--string--,--string--,--string--,--string--, --string--,--string--,--string--,--string--,--string--,--string--, pdfinfo of the PDF Code:
Author: Gian TEST 2 Sent an email with txt in the body and attached PDF Since the beginning of this post is the first time that I can print this PDF pdfinfo of the file Code:
Subject: File: EK001E00 Job: QPRTJOB System: CHEMKS01 PDF is JOB 1266 both printed correctly TEST 3 Retry to print TEST 2. with the same results: both files printed correctly TXT is JOB 1267 PDF is JOB 1268 TEST 4 txt converted by my script to PS and printed correctly (JOB 1269) PDF printed correctly but CUPS show as status canceled (JOB 1270). Since the beginning of this post is the first time that I can print this PDF pdfinfo: Code:
Title: untitled I have attached an the CUPS error logfile: error-log CM2320nf_MFP20180828-2.txt I have also attached a screen-shot of the CUPS JOBS status. I noticed that when the TXT file indicates unknown pages after the PDF is shown as canceled. I don't know if there is a relation.... It seems we are on the right way .... with still some problems Regards Gian Carlo |
That does read like progress, and ultimately a CUPS bug report would probably bee needed to progress this further. However, since you are taking emails with PDFs attached and printing them via your custom script, I'm going to suggest trying another approach. Take the PDF document and convert it to PS with the pdf2ps (ghostscript) utility or 'pdftops' (poppler-tools). Note the latter is not the same executable as the filter you ran previously, although it uses the same supporting libraries.
If you can convert the 'problematic' PDF files to PS files, and then submit the print job, we'll avoid using the CUPS 'pdftops' filter, and maybe print more successfully. The ghostsctipt utility get's executed like this ('man pdf2ps' for more info): pdf2ps [ options ] input.pdf output.ps The pdftops utility ('man pdftops' for more info) like this: pdftops [options] input.pdf [output.ps] The following blog will be of interest to you about using/comparing these two tools... https://www.stefaanlippens.net/pdf2ps_vs_pdftops/ See how that goes. |
Hi again Ferrari,
I have introduced in my script the conversion of all PDF to PS before printing but nothing changed. On the LAN I have also a LINUX x86 PC for the VPN connection. I have installed CUPS on that machine and the HP driver (shared on the network) and I have tried to print from the Raspberry using x86 PC printer driver. I can now print with no problems all the documents (PDF, JPG, TXT, PS, HTML ...) keeping the pdftops converter in my script I can also print "fillable PDF" that I couldn't print before (the fillable fields was printed as empty not only ARM based PC also on x86 PC) For now, because I have to be operational, I keep for the moment the driver on the x86 PC but it would be interesting to try to find the problems on the raspberry. Do you think is a raspberry CUPS compiling problem ? Gian Carlo |
Well done getting this far. I think to progress this any further would take a bug report.
|
Quote:
|
There should be no need to be a member of the 'lp' group for printing. Any user who is logged in should be able to print to an attached printer via CUPS. In addition, when used as a CUPS server, the following cupsd.conf configuration permits access to any host connected to the LAN...
Code:
< Location / > Reference: https://www.cups.org/doc/policies.html In any case, this has nothing to do with the issues faced in this thread. |
Reported.
|
All times are GMT -5. The time now is 05:48 AM. |