Landscape printing

Helge Blischke h.blischke at acm.org
Fri Jul 29 10:30:14 PDT 2011


Ray Stacey wrote:

>> Ray Stacey wrote:
>>
>> >> Ray Stacey wrote:
>> >>
>> >> >> Ray Stacey wrote:
>> >> >>
>> >> >> > We are running cups 1.4.7 on Solaris 10. I'm trying to print a
>> >> >> > postscript file from our application using the command lp -o
>> >> >> > landscape -o PageSize=Legal -d treekill2 INV-R200.r01.17206.ps.
>> >> >> >
>> >> >> > The file prints on legal paper, however the first page is
>> >> >> > landscape and each subsequent page is rotated 90 degrees. So the
>> >> >> > first page is fine, the 5th page is fine, the 9th page is fine
>> >> >> > ....
>> >> >> >
>> >> >> > Any ideas??
>> >> >>
>> >> >> What make and model is the printer?
>> >> >> How is it configured?
>> >> >> is there a *cupsFilter line in the printer's PPD?
>> >> >> is there a *LandscapeOrientation: xxxx
>> >> >> where xxxx is either Plus90 or Minus90 in the PPD?
>> >> >>
>> >> >> Helge
>> >> >>
>> >> > It's an HP 8100. It is configured using the ppd file from the cups
>> >> > website. THere is no *cupsFilter and LandscapeOrientation is Plus90.
>> >> >
>> >> > I tried the same command with a generic postscript sample file and
>> >> > I'm not seeing the rotation problem. That means there is something
>> >> > wrong with the postscript output from our application. No idea what
>> >> > it could be, I don't know postscript language at all.
>> >>
>> >> Then post (an URL to) a sample file and do the following:
>> >> cupsctl --debug-logging
>> >> print the sample file
>> >> cupsctl --no-debug-logging
>> >> post the portion of the /var/log/cups/error_log that contains the
>> >> messages related to the test job.
>> >>
>> >> Helge
>> >>
>> > Here you go:
>> >
>> > http://home.sourcecable.net/~raystacey/test.ps
>> >
>>
>> Ray,
>>
>> your PostScript job itself contains the necessary transformation for
>> landscape printing, and the contents of each page - including the
>> showpage execution - is enclosed in a save / restore pair.
>> Thus, the transformation inserted by cups' pstops filter for landscape
>> printing acts outside the page contents bracketed by save and restore
>> what results in every page rotated by 90 degrees with respect to the
>> previous.
>>
>> Please try printing without the "-o landscape" option; I'm pretty sure
>> you'll get the right printout then.
>>
>> Helge
>>
> I see what you mean. However, if I print without "-o landscape" it prints
> in portrait mode. The printout is on legal, but it is not rotated.

Well, can you modify your application to output a PostScript stream as indicated by the following context diff output?

---snip---
*** test.ps	2011-07-28 23:41:40.000000000 +0200
--- test-n.ps	2011-07-29 19:26:18.000000000 +0200
***************
*** 4,9 ****
--- 4,10 ----
  %%CreationDate: Wed Jul 20 08:07:38 2011
  %%Pages: 9
  %%EndComments
+ %%BeginProlog
  /psfdict 250 dict def
  psfdict begin
  /Psf save def
***************
*** 419,425 ****
  stdtemplate
  bHEADER
  } bind def
! [ 582.0 1008.0 108.0 75.0 12.0 12.0 true 30.0 2.0 0.995000 false true false true true true ] init
  /Helvetica findfont
  dup length dict begin
  	{1 index /FID ne {def} {pop pop} ifelse} forall
--- 420,427 ----
  stdtemplate
  bHEADER
  } bind def
! %%EndProlog
! %%BeginSetup
  /Helvetica findfont
  dup length dict begin
  	{1 index /FID ne {def} {pop pop} ifelse} forall
***************
*** 749,755 ****
  399.0 12.0 dYpos l
  0.0 aYpos
  } bind def
! %%EndProlog
  %%Page: 1 1
  %%Key: INVENTORY=000000FA
  %%Key: DEPARTMENT=OPS
--- 751,758 ----
  399.0 12.0 dYpos l
  0.0 aYpos
  } bind def
! [ 582.0 1008.0 108.0 75.0 12.0 12.0 true 30.0 2.0 0.995000 false true false true true true ] init
! %%EndSetup
  %%Page: 1 1
  %%Key: INVENTORY=000000FA
  %%Key: DEPARTMENT=OPS
---snip---

If not, I'd suggest to set up a prefilter or similar that does the modification.

Helge






More information about the cups mailing list