printing a raw file formated with ghostscript don't work

Asked by Ray

Iḿ trying to print a postcript file generated by CorelDraw. It contains an image (a small rectangle filled with a 20% gray). Postcript file is generated to print at 30 dpi.

When I print that file in Windows (using ghostscript/gsview) every thing is fine (I'm using the host default printer).

In linux (host computer) the printed page (using lpr -o raw) the small rectangle is filled using the default fill pattern (about 110 dpi)

Using ghostscript / lpr combination like this:

gs -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD -sDeviceManufacturer="HP" -sDeviceModel="HP LaserJet P2015" -sOutputFile=cosa ../Cuadro_30_20.ps
lpr -o raw -PHP-LaserJet-P2015-Series cosa

the results are the same.

Am I doing something wrong? or is it a problem with lpr/gs?

Host operating system: Ubuntu 12.04
Default printer: HP LaserJet p2015 Series hpijs pcl3, 3.12.2
Virtualbox 4.2.12
Guest operating system: Windows XP
Printer on guest : http://192.168.1.99:631/printers/HP-LaserJet-P2015 (host default printer)

Thanks in advance

Ray

Question information

Language:
English Edit question
Status:
Solved
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Solved by:
Ray
Solved:
Last query:
Last reply:
Revision history for this message
goutam kodu (goutam-hplip) said :
#1

Hi Ray,

I am not sure if it the issue with hpijs driver or the gs. As hpijs drivers are deprecated and no further development happening on it, i suggest to go for hpcups.
Please upgrade the HPLIP version to latest 3.13.4 and reconfigure your device by running command "hp-setup" in the terminal.

You can find the latest HPLIP download in this location : http://hplipopensource.com/hplip-web/gethplip.html.

Please let me know if you need any further assistance on this.

Thanks,
Goutam

Revision history for this message
Johannes Meixner (jsmeix) said :
#2

According to
http://hplipopensource.com/hplip-web/models/laserjet/hp_laserjet_p2015_series.html
"APDK device class(es): LJMono,Postscript"
the HP LaserJet p2015 Printer is a PostScript printer.

When you print your PostScript file "Cuadro_30_20.ps" using "-o raw",
no filter or driver software is run and your PostScript file is sent
unchanged to your PostScript printer, see "raw" at
http://en.opensuse.org/SDB:CUPS_in_a_Nutshell

This way only the PostScript interpreter in your PostScript printer
makes the printout (in particular it makes the filling).

You wrote: "Postcript file is generated to print at 30 dpi."

I am not really a PostScript expert but at least at first glance for me
this does not make sense because generic PostScript describes
the content independent of the printing resolution (in short:
there is no such thing as "dpi" in generic PostScript).

If your particular PostScript is somehow device specific (e.g. via
something like "<</HWResolution[30 30]>>setpagedevice")
printing it via "-o raw" would send your device specific PostScript
unchanged to your particular PostScript printer device.

When your particular printer device doesn't do the device specific
stuff as specified in your particular PostScript, it means that your
particular device specific PostScript is somehow inappropriate
for your particular PostScript printer device.

Revision history for this message
Ray (tresparza) said :
#3

Goutam:
In fact, I switched to hpijs because with cups I have the same problem.

Johannes:
Yes, HP P2015 is suposed to be a PostScript printer but I am in a print shop bussines and I need to print halftones and images at specific resolution in order to use an offset printer but such things is not supported by default PostScript driver on HP P2015, I need to use GhostScript in Windows to do that work.

Files are generated by CorelDraw using a pseudo-printer named "device independent PostScript" provied by Corel. Then the file is printed with ghostscript/gsview.

The same file printed in the same printer (and the same computer) via Linux gs command doesn't show the same results.

Maybe I am not explaining it by the correct way (I'm not fluent with english)

I am using a virtual machine via VirtualBox and the XP guest is using remote printer but in the same computer. Maybe I need to know how to access the printer in the same way remote computer does in order to get the same result.

Thanks for your attention.

Revision history for this message
Ray (tresparza) said :
#4

This is what I need and I can do with Windows/gs <a href="www.impresosprecisa.com/debe.jpg">good</a>
An this is what I get with Linux/gs <a href="www.impresosprecisa.com/es.jpg">bad</a>

Revision history for this message
Ray (tresparza) said :
#5

Sorry (again)

About

"You wrote: "Postcript file is generated to print at 30 dpi."

I am not really a PostScript expert but at least at first glance for me
this does not make sense because generic PostScript describes
the content independent of the printing resolution (in short:
there is no such thing as "dpi" in generic PostScript)."

it's not 30 dpi, is 30 lpi (lines per inch)

Thanks to both of you.

Revision history for this message
Johannes Meixner (jsmeix) said :
#6

I neither know about CorelDraw internals nor about Windows XP internals
so that I can probably not really help here.

Nevertheless please provide a file that is generated by CorelDraw
using its pseudo-printer named "device independent PostScript".
I need an original unchanged file as generated by CorelDraw.

I will have a look but I cannot promise anything.

Revision history for this message
Ray (tresparza) said :
#7

Here (http://www.impresosprecisa.com/cuadro_30_40_50.rar) is a CorelDraw generated ps file.

This is another but simpler example that I downloaded from internet. It is suposed to be printed at 20% gray with a 20 lpi pattern at an angle of 15º. I printed it using windows and gswin32 and you can view the result here (http://www.impresosprecisa.com/klm.jpg).
---------------------------------------------------------------
/font {0 0 moveto /Helvetica findfont 200 scalefont setfont (klm) } def
/sivo 0.8 def % white percent
/l 20 def % lpi
/k 15 def % Angle
/softrhomb { exch 2 mul sin exch dup 3 1 roll add abs sqrt exch abs sqrt exch sub abs } bind def
50 600 translate
gsave
sivo setgray
font l k {softrhomb} bind setscreen show
grestore
font false charpath stroke
showpage
------------------------------------------------------------
I hope you can help me.
Thanks

Revision history for this message
Ray (tresparza) said :
#8

The small rectangle at the top of the "m" letter is not part of the postscript file, it is due I used recycled paper :-)

Revision history for this message
Johannes Meixner (jsmeix) said :
#9

I downloaded
http://www.impresosprecisa.com/cuadro_30_40_50.rar
and did "unrar e cuadro_30_40_50.rar"
and got a cuadro_30_40_50.ps file.

I have a HP LaserJet 1220 PostScript+PCL5e printer.

I have several print queues for it:

hplaserjet1220ps
using the HPLIP 3.13.4 PPD file with NickName
"HP LaserJet 1220 Postscript"

hplaserjet1220hpcups
using the HPLIP 3.13.4 PPD file with NickName
"HP LaserJet 1220 pcl3, hpcups 3.13.4"

hplaserjet1220hpijs
using the HPLIP 3.13.4 PPD file with NickName
"HP LaserJet 1220 hpijs pcl3, 3.13.4"

I printed the cuadro_30_40_50.ps file as follows:

# lp -d hplaserjet1220ps -o raw cuadro_30_40_50.ps

# lp -d hplaserjet1220ps cuadro_30_40_50.ps

# lp -d hplaserjet1220hpcups cuadro_30_40_50.ps

# lp -d hplaserjet1220hpijs cuadro_30_40_50.ps

The first three printouts result the same filling pattern
of the rectangle which looks like your
http://www.impresosprecisa.com/debe.jpg
with discrete points but with much more and much finer points.

The last printout (via hplaserjet1220hpijs) results a filling as in your
http://www.impresosprecisa.com/es.jpg
i.e. no longer any visible discrete points.

This shows that hpijs is really different compared to all others
which proves what Goutam wrote in his above comment#1.

But I do not get a filling that looks exactly as your
http://www.impresosprecisa.com/debe.jpg

Again: I am not really an expert here but from my point of view
it proves to some extent what I wrote in my above comment#2.

Your cuadro_30_40_50.ps is not generic PostScript but somehow
it depends on the PostScript interpreter what filling one actually gets.

In other words:
From my current point of view it seems what is generated by CorelDraw
using its pseudo-printer named "device independent PostScript"
is not really device independent PostScript.

If it was real device independent PostScript,
I should have got exactly your
http://www.impresosprecisa.com/debe.jpg
in particular when I send it with "-o raw"
to my PostScript printer.

Revision history for this message
Ray (tresparza) said :
#10

Thanks Johannes, I realy appreciate your time and effort but I am not realy sure that it's a Corel problem.

Maybe corel ps file is too large to analyze, but this one is simpler and I think all of the commands here are standard postscript.

Postscript driver must print this example at 20% gray with a 20 lpi pattern at an angle of 15º. I printed it using windows and gswin32 and you can view the result here (http://www.impresosprecisa.com/klm.jpg).

You may count the number of lines printed per inch and there are 20 (that is how it should be).

---------------------------------------------------------------
/font {0 0 moveto /Helvetica findfont 200 scalefont setfont (klm) } def
/sivo 0.8 def % white percent
/l 20 def % lpi
/k 15 def % Angle
/softrhomb { exch 2 mul sin exch dup 3 1 roll add abs sqrt exch abs sqrt exch sub abs } bind def
50 600 translate
gsave
sivo setgray
font l k {softrhomb} bind setscreen show
grestore
font false charpath stroke
showpage
------------------------------------------------------------

I think that the problem is with "setscreen" command implementation.

Thanks again

Revision history for this message
Johannes Meixner (jsmeix) said :
#11

I have your above PostScript now as cuadro_simple.ps file
on my workstation where I run Ghosscript version 9.07.

I let Ghostscript display it using the command
# gs -r100 cuadro_simple.ps

I do not get your result as in
http://www.impresosprecisa.com/klm.jpg

I get "klm" shown filled with 20% gray
but filled without any visible discrete points
i.e. it is filled as in your
http://www.impresosprecisa.com/es.jpg

Then I sent the cuadro_simple.ps file
in "raw" mode to my HP LaserJet 1220 PostScript printer.

I set up a "raw" print queue for my HP LaserJet 1220
to be 100% sure that not any kind of PostScript processing
can happen on my Linux workstation (i.e. the printer gets
exactly the bytes in the cuadro_simple.ps file).

On the HP LaserJet 1220 PostScript printer
I get a filling result with visible discrete points
printed in 20 lines per inch but without an angle of 15º
(the angle is 0 degree on my printer).

I am afraid, I am not at all a sufficient PostScript expert
to debug it and/or decide if it is an issue in your PostScript code
or issues in the PostScript interpreters (Ghostscript versus the
PostScript interpreter in my HP LaserJet 1220 PostScript printer).

I suggest that you ask a question in a forum
where real PostScript experts listen.

For example the Ghostscript developers are PostScript experts.
You may have a look at
http://www.ghostscript.com/
in particular the "ghostscript.com Mailing Lists" at
http://ghostscript.com/mailman/listinfo/
but I don't see a mailing list there which is
explicitly for end-user questions.

Off the top of my head I don't know a forum that is
explicitly for PostScript end-user questions.

Nevertheless I would be interested if you find and contact
such a forum, if you post here an URL to your question
so that I could watch what further goes on.

Revision history for this message
Ray (tresparza) said :
#12

Thank you again for your attention, I will try to get an answer in the mailing list at ghostscript.com

Revision history for this message
Ray (tresparza) said :
#13

I've been reading another forums trying to find an answer and it appears like it is a problem with HP printers and HP particular postscript interpretation.

In Windows XP:
If I use HP postscript driver the setscreen command is ignored and the output seem like http://www.impresosprecisa.com/es.jpg

To work around this problem, I use PCL driver and ghostscript/gsview to print files like these.

Now I wonder how to avoid HPLIP "interprets" postscript commands in Linux and lets ghostscript do the work.

Revision history for this message
Ray (tresparza) said :
#14

It's working!!!!

gs -sDEVICE=ljet4 -sOutputFile=%pipe%lpr cuadro_30_40_50.ps <<EOF
quit
EOF

Thanks for your help.