0

One source of PDFs that we need to print periodically, are specifications. The PDFs have very intricate backgrounds, and the rendering is slow. But the problem is that the document ends up being 80 to 100 MB and sometimes larger.

I have found thus far that the printer can manage to always print one page, if it is rasterized and dumped to the printer that way. So in okular, I would print just one page, and select the option for rasterizing output. This approach has worked flawlessly, but it is a manual intervention beyond patience for large PDFs.

So my questions are:

  1. Has anyone solved this problem and created a script or plug-in which prints one page at a time, in rasterized form.

  2. What approaches and tools might help me create a script to do this, assuming that there is not one I can use.

The environment we are using is Slackware 14.2. Also, since the printer is networked, we did try printing from a Windows 10 machine, and have the same problem from there. That printing was routed direct to the printer. The solution should really be in Linux space, as we don't use Windows much at all.

mongo
  • 103
  • 2

1 Answers1

0

You could print from command line with something like this:

#!/bin/bash

FLAGS="" # whatever you need to make the output suitable for the printer

PAGES=$(pdfinfo file.pdf | grep Pages: | awk '{print $2}')


for i in $(seq 1 $PAGES)
do
  lp $FLAGS -P $i file.pdf
done

Instead of using lp directly, you could also pipe file.pdf through pdftopdf, pdf2ps or one of those transformations (also create images, with pdftoppm | ... ). Those filters might simplify file.pdf before it reaches the cupfs filter and the printer.

Eduardo Trápani
  • 1,210
  • 8
  • 12
  • Good ideas. I will try some of those filters, and see if they will still render the document page at a time. – mongo Oct 21 '19 at 16:29