[cups] Printing to native XPS printers using CUPS

Gernot Hassenpflug aikishugyo at gmail.com
Sat Oct 10 21:16:01 PDT 2015


On Sun, Oct 11, 2015 at 1:38 AM, Helge Blischke <helgeblischke at web.de> wrote:

Hello Helge,
Thank you for your response.

> Look at
> http://sourceforge.net/projects/cupsaddons/files/xpstopdf_or_ps/ <http://sourceforge.net/projects/cupsaddons/files/xpstopdf_or_ps/>
> for a filter to convert XPS to PDF or PostScript.

I downloaded and looked at the perl code and the README. I am unclear
how one would do this in the opposite direction, given that XPS seems
to need quite a few things embedded into it, including things like
color profiles if I understand correctly. I suppose the first step
would be to create a minimal XPS document that a native XPS printer's
interpreter will accept.

> Note that – on most Linux distros – you need
> not install ghostpdl to compile gxps but simply install the ibgxps2 and libgxps-utils packages.

Interesting. I did in fact download GhostPDL and compile, to see
whether I could do this. For 9.18, the procedure seems to be as
follows, with gxps instead of xps as the target.

1. install development dependencies

sudo apt-get install libxext-dev libxt-dev

2. download GhostPDL 9.18 source

tar zxvf ghostpdl-9.18.tar.gz

3. configure and make
cd ghostpdl-9.18/
./configure
make gxps

configure maybe not needed, I did that since making xps returned
"nothing to be done", before realizing I need to make gxps.

> To support native XPS printers that do not support PostScript or PDF, it would be quite easy
> to derive a pdftoxps  or xpstops filter by cannibalizing an existing filter which uses Ghostscript
> for conversion.

Yes, pdftoxps, pstoxps is what I suspect I need.

> If the latter is needed, let me know.

I tried to use gxps to read a PDF file and output an XPS file, but
without success: it appears that gxps is only an interpreter for XPS,
and cannot read any other formats. Or else my command line is
incorrect. At the moment, I am stuck with out to create an XPS file
from a PDF file, having expected I could use gxps.

Here an example, trying to convert the PDF file includes with xpstopdf to XPS:
./ghostpdl-9.18/bin/gxps -dNOPAUSE -dBATCH -sDEVICE=xpswrite
-sOutputFile=./example.xps ./xpstopdf.pdf
+ ./xps/xpszip.c:288: xps_find_and_read_zip_dir(): cannot find end of
central directory
| ./xps/xpszip.c:569: xps_process_file(): cannot read zip central directory
- ./xps/xpstop.c:307: xps_imp_process_file(): cannot process xps file
'./xpstopdf.pdf'
Warning interpreter exited with error code -1

The output of gxps shows the options available:

Options: -dNOPAUSE -E[#] -h -L<PCL|PCLXL> -K<maxK> -l<PCL5C|PCL5E|RTL> -Z...
         -sDEVICE=<dev> -g<W>x<H> -r<X>[x<Y>] -d{First|Last}Page=<#>
         -H<l>x<b>x<r>x<t> -dNOCACHE
         -sOutputFile=<file> (-s<option>=<string> | -d<option>[=<value>])*
         -J<PJL commands>
Version: 9.18
Build date: Sun Oct 11 12:51:13 2015
Devices: bbox x11 x11alpha x11cmyk x11cmyk2 x11cmyk4 x11cmyk8 x11gray2
 x11gray4 x11mono x11rg16x x11rg32x bit bitcmyk bitrgb bitrgbtags bmp16
 bmp16m bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 ccr cfax
 cif devicen dfaxhigh dfaxlow eps2write pdfwrite faxg3 faxg32d faxg4
 fpng gprf inferno ink_cov inkcov jpeg jpegcmyk jpeggray mag16
 mag256 mgr4 mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 pam
 pamcmyk32 pamcmyk4 pbm pbmraw pcx16 pcx24b pcx256 pcx2up pcxcmyk
 pcxgray pcxmono pgm pgmraw pgnm pgnmraw pkm pkmraw pksm
 pksmraw plan plan9bm planc plang plank planm plib plibc
 plibg plibk plibm pnm pnmraw ppm ppmraw ps2write psdcmyk
 psdcmykog psdrgb sgirgb spotcmyk sunhmono tiff12nc tiff24nc tiff32nc tiff48nc
 tiff64nc tiffcrle tiffg3 tiffg32d tiffg4 tiffgray tifflzw tiffpack tiffscaled
 tiffscaled24 tiffscaled32 tiffscaled4 tiffscaled8 tiffsep tiffsep1
txtwrite xcf xpswrite
 alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 ap3250 appledmp
 atx23 atx24 atx38 bj10e bj10v bj10vh bj200 bjc600 bjc800
 bjc880j bjccmyk bjccolor bjcgray bjcmono cdeskjet cdj1600 cdj500 cdj550
 cdj670 cdj850 cdj880 cdj890 cdj970 cdjcolor cdjmono cdnj500 chp2200
 cljet5 cljet5c cljet5pr coslw2p coslwxl cp50 declj250 deskjet dj505j
 djet500 djet500c dl2100 dnj650c epl2050 epl2050p epl2120 epl2500 epl2750
 epl5800 epl5900 epl6100 epl6200 eplcolor eplmono eps9high eps9mid epson
 epsonc escp escpage fmlbp fmpr fs600 gdi hl1240 hl1250
 hl7x0 hpdj1120c hpdj310 hpdj320 hpdj340 hpdj400 hpdj500 hpdj500c hpdj510
 hpdj520 hpdj540 hpdj550c hpdj560c hpdj600 hpdj660c hpdj670c hpdj680c hpdj690c
 hpdj850c hpdj855c hpdj870c hpdj890c hpdjplus hpdjportable ibmpro imagen itk24i
 itk38 iwhi iwlo iwlq jetp3852 jj100 la50 la70 la75
 la75plus laserjet lbp310 lbp320 lbp8 lex2050 lex3200 lex5700 lex7000
 lips2p lips3 lips4 lips4v lj250 lj3100sw lj4dith lj4dithp lj5gray
 lj5mono ljet2p ljet3 ljet3d ljet4 ljet4d ljet4pjl ljetplus ln03
 lp1800 lp1900 lp2000 lp2200 lp2400 lp2500 lp2563 lp3000c lp7500
 lp7700 lp7900 lp8000 lp8000c lp8100 lp8200c lp8300c lp8300f lp8400f
 lp8500c lp8600 lp8600f lp8700 lp8800c lp8900 lp9000b lp9000c lp9100
 lp9200b lp9200c lp9300 lp9400 lp9500c lp9600 lp9600s lp9800c lps4500
 lps6500 lq850 lxm3200 lxm5700m m8510 md1xMono md2k md50Eco md50Mono
 md5k mj500c mj6000c mj700v2c mj8000c ml600 necp6 npdl oce9050
 oki182 oki4w okiibm oprp opvp paintjet pcl3 photoex picty180
 pj pjetxl pjxl pjxl300 pr1000 pr1000_4 pr150 pr201 pxlcolor
 pxlmono r4081 rinkj rpdl samsunggdi sj48 st800 stcolor t4693d2
 t4693d4 t4693d8 tek4696 uniprint xes cups pwgraster ijs png16
 png16m png256 png48 pngalpha pnggray pngmono nullpage

Any advice very much appreciated.

While I do not have a native XPS printer available, I hope to be able
to print XPS to a fileprinter under CUPS to validate the working of
the filterchain (even though the suitability of the content of the XPS
will remain untested).

Best regards,
Gernot Hassenpflug

> Am 10.10.2015 um 17:42 schrieb Gernot Hassenpflug <aikishugyo at gmail.com>:
>>
>> Hello,
>>
>> Issue:
>> ---------
>> Is there a way to print XPS documents via CUPS?
>> Extension(s)  :    .oxps, .xps
>> MIME Type(s):    application/oxps, application/vnd.ms-xpsdocument
>>
>> Background:
>> -------------------
>> On the Ubuntu User forums a user asks for help with a printer that
>> turns out to be a re-branded Konica Minolta Bizhub 165 or 185:
>> http://ubuntuforums.org/showthread.php?t=2297639
>> The specifications for these devices note that they are "GDI, XPS" capable.
>> Normally, GDI would make these paperweights for linux users (and
>> MacOSX if no native driver is provided by the manufacturer).
>> However, if the printer is natively capable of XPS interpretation,
>> like PDF/PS/PCL, this I understand makes it at least possible in
>> theory to print from linux/MacOSX.
>>
>> Researching the XPS specification entry on Wikipedia,
>> https://en.wikipedia.org/wiki/Open_XML_Paper_Specification
>> it seem Konica Minolta, Canon, Minolta, Toshiba and Xerox produced
>> native XPS printers.
>>
>> I searched over several days and it seems that:
>>
>> 1. Since the C550 and C451 in mid-2007, (almost?) all Konica Minolta
>> Bizhub and Magicolor have native XPS capability.
>> http://www.i-grafix.com/australia/konica-minolta-to-support-vista-xps-wsd-protocols/
>>
>> 2. Canon does not, as far as I can tell, not sure if they have some
>> printers with such support (XPS drivers under Windows require the
>> normal driver installed as well, so presumably the XPS driver is only
>> accepting the output of the Windows XPS printing path and then passing
>> its output along to the normal driver).
>>
>> 3. Several of the Xerox phasers have XPS emulation (not sure of
>> beginning of support and its coverage).
>>
>> 4. I did not check for Toshiba products, or Minolta (separate from
>> Konica Minolta) products.
>>
>> Review:
>> ------------
>> In August 2012 there was discussion on the CUPS User ML regarding
>> printing to native XPS printers (ghostscript's PDL/XPS engine), or
>> converting XPS documents to PS or PDF (xps2ps filter) for printers
>> supporting those formats natively.
>>
>> I could not find any other information regarding printing XPS
>> documents directly from linux systems despite searching for quite a
>> few days.
>>
>> Idea:
>> --------
>> Possibly one could use GhostXPS (gxps), the Ghostscript software for
>> XPS interpretation/rendering (maybe part of GhostPDL?) at the end of a
>> filter chain where a PDF (or PS) document is produced. Something like
>> (I see that Ghostscript 9.18 seems to have integrated the PCL and XPS
>> interpreters, I cannot find the separate GhostPDL for my Debian
>> package so I haven't tried this myself):
>> gxps -sDEVICE=xpswrite -sOutputFile=printfile.xps (or "-o
>> filename.xps"?) -dNOPAUSE inputfile.pdf
>>
>> The XPS file could then be sent directly to the printer.
>>
>> Conceptually are there several complications that need to be taken
>> into account that make this infeasible in practice?
>>
>> Regards,
>> Gernot Hassenpflug
>> _______________________________________________
>> cups mailing list
>> cups at cups.org
>> https://www.cups.org/mailman/listinfo/cups
>
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://www.cups.org/mailman/listinfo/cups



More information about the cups mailing list