bugGNU Octave - Bugs: bug #46445, unable to print directly to...

 
 

bug #46445: unable to print directly to non-postcript printer (HP 8610)

Submitted by:  None
Submitted on:  Sat 14 Nov 2015 04:36:49 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: NoneAssigned to: None
Originator Name: Adrian MarianoOriginator Email: -unavailable-
Open/Closed: OpenRelease: 4.0.0
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 18 Nov 2015 09:41:40 PM UTC, comment #4:

I modified _print_parse_opts_.m to remove the -l option. This work-around is successful: after this change, printing works as desired.

Adrian Mariano <adrianm>
Wed 18 Nov 2015 01:53:15 PM UTC, comment #3:

print.m builds the command from the lpr() function in that file, which is basically the binary plus the -l option it sets in plot/util/private/__print_parse_opts__.m

John Donoghue <lostbard>
Project Member
Tue 17 Nov 2015 09:42:41 PM UTC, comment #2:

I used the -debug option with print and got the information attached below. It looks like the problem is that ghostscript is being invoked to produce a postscript language output and then lpr is invoked with "-l", which forces the printer to print the output directly rather than interpreting it. AT least, this explains the basic behavior I get.

The solution is to remove the "-l" option from the lpr command. But I can't figure out how to do this. Where is this option configured?

--------------------------------------------

;---- begin /tmp/oct-UOpvUX.ps ----
%!PS-Adobe-3.0
<< /Margins [0 0] /.HWMargins [0 0 0 0] /PageOffset [18 180] >> setpagedevice
%%EOF
----- end /tmp/oct-UOpvUX.ps -----
Ghostscript command: '/usr/bin/gs -dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=ps2write -dLanguageLevel=2 -dEmbedAllFonts=true -dEPSCrop -sPAPERSIZE=letter -dFIXEDMEDIA -sOutputFile="-" /tmp/oct-UOpvUX.ps -'
lpr command: '/usr/bin/lpr -l'
opengl-pipeline: '/usr/bin/gs -dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=ps2write -dLanguageLevel=2 -dEmbedAllFonts=true -dEPSCrop -sPAPERSIZE=letter -dFIXEDMEDIA -sOutputFile="-" /tmp/oct-UOpvUX.ps - | /usr/bin/lpr -l ; rm /tmp/oct-UOpvUX.ps

Adrian Mariano <adrianm>
Tue 17 Nov 2015 02:08:05 PM UTC, comment #1:

You could try the '-debug' option when running print - it will print out some additional information on what it is doing.

John Donoghue <lostbard>
Project Member
Sat 14 Nov 2015 04:36:49 PM UTC, original submission:

I have an HP 8610 printer on my local network. On my linux machine I can print from the shell using "lpr foo.ps" or "lpr foo.pdf" with success. The CUPS printer system is handling printing for me.

In Octave if I issue the command "print" then octave sends postscript to the printer and somehow avoids the normal processing that happens with lpr, which results in the postscript source printing as text on the printer (I get a few lines of postscript header and tons of blank pages). I tried "print -dpdf" and the printer makes noises and prints nothing, which I speculate is a result of pdf source being sent to the printer.

If I run from Octave "print('foo.ps')" or "print('foo.pdf')" and then print the resulting file from the shell with lpr then printing succeeds.

The documention for print suggests that I can use "-dghostscript_device" so I tried selecting pcl3, which I believe is correct for my printer:

>> print -dpcl3

error: print: format must be a valid Ghostscript format for spooling to a printer
error: called from
_print_parse_opts_ at line 336 column 7
print at line 291 column 8

Note that using pcl3 from the command line succeeds:

gs -sDEVICE=pcl3 -sOutputFile=foo.pcl foo.ps

The foo.ps file is the one produced by octave above.

I tried looking at print.m, but it appears all the printing is hidden by the function _opengl__print_, so I can't tell what's actually going on. (I'm actually not quite sure because when I modified print.m, but modifications didn't seem to run, which made me uncertain print.m was actually running at all when I typed "print".)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by adrianm (Posted a comment)
  • -unavailable- added by lostbard (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1