Technical article 125326

How to print, view or create PDF files from the command line in OpenServer and UnixWare?

OpenServer 6.0.0OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7UnixWare 7.1.1UnixWare 7.1.3UnixWare 7.1.4Open UNIX 8

Written · Last revised

Problem

I have received a PDF file and I want to print it out using command-line utilities on SCO OpenServer or UnixWare 7.

Solution

The unsupported OpenSource package Xpdf, which allows viewing and printing of PDF files in a graphical environment, also furnishes the following command-line utilities:

pdftops -- converts PDF files to PostScript pdftotext -- converts PDF files to plain text

These utilities can be used to print a PDF file called "foo.pdf" using the Unix lp print spooler as follows:

pdftops foo.pdf - | lp -o post    (for PostScript output)
pdftotext foo.pdf - | lp          (for plain text)

Note: the above assumes that your printer is configured with an interface that recognizes the "-o post" option to process PostScript output, and that you wish to print to the default lp destination.

NOTES:    The latest version of Xpdf, as of this writing, for both
          OpenServer and UnixWare 7 is 0.92.  You can get Xpdf
          from the following ftp locations:
For OpenServer5:
ftp://ftp2.sco.com/pub/skunkware/osr5/x11/viewers/xpdf
For UnixWare7/OpenServer6:
ftp://ftp2.sco.com/pub/skunkware/uw7/x11/viewers/xpdf

The Xpdf package also furnishes man pages for the above utilities, where further useful options to these commands can be explored.

You should also download install the freetype-1.3.1.pkg as this will contain the required graphical libraries that xpdf needs to run.

Also, starting with OpenUNIX 8.0.0 (UnixWare 7.1.2) and 7.1.3, if you are running LKP (Linux Kernel Personality), a Linux-based PDF viewer is available for use in Linux mode:

See: http://www.foolabs.com/xpdf/download.html
NOTE:     You should be able to view your XPDF documents in Mozilla as long as
          the "mozplugger" plug-in is installed with the version of Mozilla you
          are using.  This is the case from Mozilla v1.7.12 onwards.

To change the behaviour of "mozplugger" and get it to open a xpdf document within an active browser window rather that a separate xpdf instance:

Edit the the file mozpluggerrc in /opt/mozilla and changed line 228:

from: repeat noisy swallow(Xpdf) fill: xpdf -g +9000+9000 "$file"

to:   repeat noisy swallow(xpdf) fill: xpdf "$file"
NOTE:     If your PDF file won't display then a later XPDF may be needed.

OpenSource software is not supported by SCO, however, if you are using LKP then it would be possible to download a later Linux version as the xpdf binary contains statically linked libraries so that it can be run in the UnixWare7 namespace.

Download from:  ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02-linux.tar.gz
into the Linux namespace, ie.
# linux

and follow the installation instructions in the README and INSTALL files.

Once installed you can run the binary from an X Terminal Windows with:

# xhost +
# /linux/usr/local/bin/xpdf <file>.pdf
This can be "plugged" into Mozilla.  However, ensure that the PDF
files are read from a "lxuwfs" filesystem otherwise Mozilla will not
be able to display the file, as it needs to "chroot" into the linux
namespace to do this.

Also, to run without needing to use "xhost +" then:

Add the line "/usr/bin/X11/xhost + " to the top of the file:

/usr/dt/bin/Xsession

See also

The 'ghostscript' package is a stock package provided by SCO which
has pdf utilities.  It does not require the use of postscript, that
is simply one of the more common pdf conversion utilities contained
in this package.  It also contains utilities to convert text and
other image formats to pdf.

Alternatively, to generate your PDF files then this is possible, however, the following tools are not provided by or supported by SCO:

Visit:
http://www.sanface.com/txt2pdf.html
http://www.sanface.com/txt2pdf.html#download

Download the product, unzip or gunzip it, assuming you have obtained these packages for free from

http://www.sco.com/skunkware
and run:
# unzip txt2pdf.zip
# cd txt2pdf-9.1
# ./txt2pdf.pl /etc/hosts

Will generate /etc/hosts.pdf which can be read either by the SCO OpenSource XPDF or by Adobe Acrobat.

From the Xinuos technical article database, record 125326. Reproduced with permission. The original is at www.sco.com/ta/125326, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.