atux_null
Posts: 145
Joined: Thu Jun 21, 2012 1:58 pm

Print server (CUPS) is very slow with pdf files

Thu Jun 10, 2021 8:51 am

i got a usb multifunction machine (fax, printer, copy) HP Deskjet 3830 and it is attached to my Rpi and it is shared in the network. I got it setup by using the guide from https://samhobbs.co.uk/2014/07/raspberr ... ner-server. The problem i have is that when sending pdf files, it takes ages. For example 10 pages pdf takes more than 5 minutes to get them printed. If i attach the printer via usb to the Laptop (Win10) takes around 30 secs to print the same file.
Through the CUPS if i send the same file in .docx format, it gets printed in a lot less time that the >5minutes of the pdf.
is there any way that i could speed up the process of printing the pdf files, please?

drtechno
Posts: 261
Joined: Fri Apr 09, 2021 6:33 pm

Re: Print server (CUPS) is very slow with pdf files

Fri Jun 18, 2021 11:08 pm

Be sure to use the postscript driver that was written for your printer instead of the general graphics one. If that is your issue, If you are using it by wireless, that is your issue because wireless performance on them are terrible.

HP wireless printing isn't the greatest because I find them not stable and slow. I like hp printers as I own several ones, but all the ones that I have that I tried to connect by wireless have unstable and really slow network connections. And only print at a reasonable pace either connected by usb or wired ethernet.

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: Print server (CUPS) is very slow with pdf files

Sat Jun 19, 2021 4:48 am

atux_null wrote:
Thu Jun 10, 2021 8:51 am
i got a usb multifunction machine (fax, printer, copy) HP Deskjet 3830 and it is attached to my Rpi and it is shared in the network. I got it setup by using the guide from https://samhobbs.co.uk/2014/07/raspberr ... ner-server. The problem i have is that when sending pdf files, it takes ages. For example 10 pages pdf takes more than 5 minutes to get them printed. If i attach the printer via usb to the Laptop (Win10) takes around 30 secs to print the same file.
Through the CUPS if i send the same file in .docx format, it gets printed in a lot less time that the >5minutes of the pdf.
is there any way that i could speed up the process of printing the pdf files, please?

The guide you linked to is 7 years old and seriously out of date, actually any guide not 2021 is likely not worth perusing.


Since Dec 2020 Raspberry Pi with Desktop (Raspbian Buster) Operating System release, printing support has been included by default,


Presume you are connecting the printer via USB to the Raspberry Pi ?
Take what I advise as advice not the utopian holy grail, and it is gratis !!

User avatar
scruss
Posts: 4309
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Print server (CUPS) is very slow with pdf files

Sat Jun 19, 2021 8:37 am

atux_null wrote:
Thu Jun 10, 2021 8:51 am
... For example 10 pages pdf takes more than 5 minutes to get them printed. If i attach the printer via usb to the Laptop (Win10) takes around 30 secs to print the same file.
Some PDFs are really slow to process, and this is where the extra processing power and memory of the laptop win out over the Raspberry Pi's rather more modest capabilities. CUPS converts almost everything¹ to PDF for printing anyway, so even if you're printing a Word document from a laptop via your Raspberry Pi, your Raspberry Pi sees it as a PDF coming into CUPS.

---
¹: depends on the printer. Some printers understand image formats like JPEG, and CUPS will pass those through directly if it can
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

drtechno
Posts: 261
Joined: Fri Apr 09, 2021 6:33 pm

Re: Print server (CUPS) is very slow with pdf files

Sun Jun 20, 2021 7:15 am

scruss wrote:
Sat Jun 19, 2021 8:37 am
Some PDFs are really slow to process, and this is where the extra processing power and memory of the laptop win out over the Raspberry Pi's rather more modest capabilities. CUPS converts almost everything¹ to PDF for printing anyway, so even if you're printing a Word document from a laptop via your Raspberry Pi, your Raspberry Pi sees it as a PDF coming into CUPS.

---
¹: depends on the printer. Some printers understand image formats like JPEG, and CUPS will pass those through directly if it can
The reason why I told the OP to look for a postscript driver is that it would read the PDF and print because PDF files are written in postscript format, so there would be no conversion and print fast.

The probable reason why its printing slow is that it is rendering each page as a graphic, then printing it at 360-2400 DPI depending on what DPI setting the graphics printer mode is set.

CUPS can install both types (graphic or postscript). And some of them are on the default list, otherwise you have to install the hp library by their package (HPLIP) either through the software depository via APT or from HP https://developers.hp.com/hp-linux-imag ... g/gethplip

In addition to this, he is using a HP printer and did not tell us if he is trying it wirelessly, or through the USB. They sometimes take forever to print, and sometimes it doesn't work at all regardless of platform/computer by wireless. Their wireless is pretty useless on their printers.

User avatar
rpdom
Posts: 19064
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Print server (CUPS) is very slow with pdf files

Sun Jun 20, 2021 7:56 am

drtechno wrote:
Sun Jun 20, 2021 7:15 am
The reason why I told the OP to look for a postscript driver is that it would read the PDF and print because PDF files are written in postscript format, so there would be no conversion and print fast
PDF files are not PostScript. They are based on PostScript, but have other extensions.

Actually CUPS uses PDF as its internal format, so you get annoying things like PDF converts to postscript converts to bit image graphic converts to PDF converts to whatever the printer supports.

My main printer supports PDF and PostScript by default. I try to use drivers that will just pass though through to the printer to process.
Unreadable squiggle

User avatar
scruss
Posts: 4309
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Print server (CUPS) is very slow with pdf files

Sun Jun 20, 2021 9:04 pm

drtechno wrote:
Sun Jun 20, 2021 3:51 pm
There are two types of drivers: postscript and non-postscript If you use a non-postscript driver, PDF files print slower. End of discussion.
That might have been the case some time ago, but it's not true now. CUPS hasn't used PostScript as its transport format internally since at least late 2011. It's very difficult to make PostScript — a Turing-complete programming language — secure, while PDF doesn't require these language features (aside from it supporting embedded JavaScript) and can be less of a security issue.

CUPS has some useful debugging features (there are some guides to them here: CUPSFilter and here: CUPSDebugging) which shows you the filter path. Here are some examples from systems and printers I have around the house:
  • PDF to a PostScript-capable printerpdftopdf → pdftops: at first glance, this might appear trivial, but the pdftops filter has to go through Ghostscript to re-render each page as PostScript. Depending on the content of the pages, this can take a long time on a Raspberry Pi.
  • PDF to a non-PostScript printerpdftopdf → gstoraster → rastertopwg: this is an IPP printer, so it accepts PWG bitmaps. Each page still has to be rendered through GhostScript, and if you've got a slow network like I do, the large PWG files take a while to send.
If you're lucky the pdftopdf filter stage won't go through the slow page interpretation/rendering phase, but some PDFs may trigger it. This can be glacial if your files contain JPEG2000 images.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

atux_null
Posts: 145
Joined: Thu Jun 21, 2012 1:58 pm

Re: Print server (CUPS) is very slow with pdf files

Mon Jul 26, 2021 11:02 am

i am confused on what to do and resolve the printer's issue

User avatar
scruss
Posts: 4309
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Print server (CUPS) is very slow with pdf files

Mon Jul 26, 2021 5:19 pm

atux_null wrote:
Mon Jul 26, 2021 11:02 am
i am confused on what to do and resolve the printer's issue
Please excuse us bickering old-timers.

You will not get good print performance using a Raspberry Pi as a print server for general-purpose PDFs. It's just the way it is.

Your printer supports Apple AirPrint. Disconnect it from the Raspberry Pi, remove all the CUPS/Samba stuff you did from that ancient tutorial, and let every computer print via wireless. There should already be the right drivers on your Raspberry Pi (IPP) for it to find the printer. AirPrint is sort of its own print server, so you can print jobs from different computers and they won't collide.

The whole "use your Raspberry Pi as a print server thing" was great when there was more chance that you'd have an old, non-networked USB printer at home. Most new printers (except really cheap ones) support wifi and AirPrint.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: Print server (CUPS) is very slow with pdf files

Mon Jul 26, 2021 5:38 pm

scruss wrote:
Mon Jul 26, 2021 5:19 pm
atux_null wrote:
Mon Jul 26, 2021 11:02 am
i am confused on what to do and resolve the printer's issue
Please excuse us bickering old-timers.

You will not get good print performance using a Raspberry Pi as a print server for general-purpose PDFs. It's just the way it is.

Your printer supports Apple AirPrint. Disconnect it from the Raspberry Pi, remove all the CUPS/Samba stuff you did from that ancient tutorial, and let every computer print via wireless. There should already be the right drivers on your Raspberry Pi (IPP) for it to find the printer. AirPrint is sort of its own print server, so you can print jobs from different computers and they won't collide.

The whole "use your Raspberry Pi as a print server thing" was great when there was more chance that you'd have an old, non-networked USB printer at home. Most new printers (except really cheap ones) support wifi and AirPrint.

+100%

I have a HP Envy 4500 and just link it to my Android Phone WiFi Hotspot, as my PC, ChromeBox & RPi are connected to my WiF Hotspot, it just works on any device / operating system......
Take what I advise as advice not the utopian holy grail, and it is gratis !!

User avatar
DougieLawson
Posts: 41687
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Print server (CUPS) is very slow with pdf files

Mon Jul 26, 2021 5:48 pm

scruss wrote:
Mon Jul 26, 2021 5:19 pm
AirPrint is sort of its own print server, so you can print jobs from different computers and they won't collide.
https://cups.org wrote:CUPS is the standards-based, open source printing system developed by Apple Inc. for macOS® and other UNIX®-like operating systems.
Since it was Apple that invented CUPS, there's a very high likelihood that AirPrint is simply a modified version of CUPS.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
scruss
Posts: 4309
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Print server (CUPS) is very slow with pdf files

Mon Jul 26, 2021 8:59 pm

DougieLawson wrote:
Mon Jul 26, 2021 5:48 pm
Since it was Apple that invented CUPS, there's a very high likelihood that AirPrint is simply a modified version of CUPS.
EasySw wrote CUPS, then Apple bought them.

CUPS is a standard, and works rather well, but the EasySw guy left the project a couple of years ago and there hasn't been a central maintainer beyond Apple occasionally adding stuff.

AirPrint/IPP isn't CUPS,although it did come out of work related to CUPS. It uses standard protocols to allow printers to advertise what they can do and where they live on a network. There are some very low-level "must support" bitmap protocols, but file formats I've seen advertised supported by AirPrint/IPP printers include JPEG, PDF and PCL. Not all CUPS printers have to support those ones, though.

There's also AirScan, a wireless scan capability that works with SANE, so many wifi AIO devices work without specific drivers now too. AirScan probably won't be the best driver for your scanner, but will do for most users. I was amazed to find that my older-than-any-Raspberry Pi Epson AIO supports AirScan (and AirPrint) so both functions work without additional drivers on most Linux machines.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

atux_null
Posts: 145
Joined: Thu Jun 21, 2012 1:58 pm

Re: Print server (CUPS) is very slow with pdf files

Fri Jul 30, 2021 6:55 am

So, by using a newer RPI with 2GB ram will i get better performance in this or not?
...
You will not get good print performance using a Raspberry Pi as a print server for general-purpose PDFs. It's just the way it is.
.../quote]

User avatar
scruss
Posts: 4309
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Print server (CUPS) is very slow with pdf files

Fri Jul 30, 2021 5:57 pm

Using a Raspberry Pi 4B is going to be quite a bit faster, but it's still going to be slower overall than using wifi and IPP, if that's an option for you.Print servers are great in huge corporate installations or where there's special printing hardware involved, but IPP has made them mostly obsolete for other users.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Other projects”