Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #2441 > unrolled thread

converting to pdf messes up portrait to seascape

Started byPeter Billam <peter@www.pjb.com.au>
First post2016-03-05 00:28 +0000
Last post2016-03-05 23:07 -0700
Articles 6 — 3 participants

Back to article view | Back to comp.lang.postscript


Contents

  converting to pdf messes up portrait to seascape Peter Billam <peter@www.pjb.com.au> - 2016-03-05 00:28 +0000
    Re: converting to pdf messes up portrait to seascape Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-03-05 12:02 -0700
      Re: converting to pdf messes up portrait to seascape Peter Billam <peter@www.pjb.com.au> - 2016-03-06 01:56 +0000
        Re: converting to pdf messes up portrait to seascape Peter Billam <peter@www.pjb.com.au> - 2016-03-06 05:02 +0000
          Re: converting to pdf messes up portrait to seascape luser- -droog <mijoryx@yahoo.com> - 2016-03-05 21:34 -0800
      Re: converting to pdf messes up portrait to seascape Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-03-05 23:07 -0700

#2441 — converting to pdf messes up portrait to seascape

FromPeter Billam <peter@www.pjb.com.au>
Date2016-03-05 00:28 +0000
Subjectconverting to pdf messes up portrait to seascape
Message-ID<slrnndka1q.1ml.peter@box8.pjb.com.au>
Greetings :-)  This Postscript file for a greeting card:
  http://www.pjb.com.au/comp/free/ooo_pjb_com_au_card.ps
views just fine on my debian stable gv 3.7.4, ie: it displays in
A4 Portrait, which if I fold in half gives me a greeting card :-)

But converting it to pdf (for the local photocopy shop) with:
  cat ooo_pjb_com_au_card.ps | /usr/bin/gs -q -sDEVICE=pdfwrite \
   -sPAPERSIZE=a4 -sOutputFile=ooo_pjb_com_au_card.pdf -
it gives me a ooo_pjb_com_au_card.pdf which when I view it with
  gv ooo_pjb_com_au_card.pdf
displays in Seascape, all shifted around and with most of
the image chopped off :-(
Do I need to specify something I haven't specified ?

Peter

-- 

Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

[toc] | [next] | [standalone]


#2442

FromMartin Leese <please@see.Web.for.e-mail.INVALID>
Date2016-03-05 12:02 -0700
Message-ID<nbfaa8$d1e$1@dont-email.me>
In reply to#2441
Peter Billam wrote:
> Greetings :-)  This Postscript file for a greeting card:
>   http://www.pjb.com.au/comp/free/ooo_pjb_com_au_card.ps
> views just fine on my debian stable gv 3.7.4, ie: it displays in
> A4 Portrait, which if I fold in half gives me a greeting card :-)
> 
> But converting it to pdf (for the local photocopy shop) with:
>   cat ooo_pjb_com_au_card.ps | /usr/bin/gs -q -sDEVICE=pdfwrite \
>    -sPAPERSIZE=a4 -sOutputFile=ooo_pjb_com_au_card.pdf -
> it gives me a ooo_pjb_com_au_card.pdf which when I view it with
>   gv ooo_pjb_com_au_card.pdf
> displays in Seascape, all shifted around and with most of
> the image chopped off :-(

The resulting PDF works fine for me when
viewed using Abode Reader.  Perhaps the
problem is with gv.

You could also improve the command line a
little to something like:
/usr/bin/gs -sDEVICE=pdfwrite -sPAPERSIZE=a4 
-sOutputFile=ooo_pjb_com_au_card.pdf -dNOPAUSE -dBATCH -dSAFER -f 
ooo_pjb_com_au_card.ps

> Do I need to specify something I haven't specified ?

To force portrait mode from the command line,
the gs manual suggests inserting:
-dAutoRotatePages=/None  -c "<</Orientation 0>> setpagedevice"

However, adding this before -f changes
nothing on my system.
-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

[toc] | [prev] | [next] | [standalone]


#2443

FromPeter Billam <peter@www.pjb.com.au>
Date2016-03-06 01:56 +0000
Message-ID<slrnndn3hf.2h3.peter@box8.pjb.com.au>
In reply to#2442
On 2016-03-05, Martin Leese <please@see.Web.for.e-mail.INVALID> wrote:
> Peter Billam wrote:
>> Greetings :-)  This Postscript file for a greeting card:
>>   http://www.pjb.com.au/comp/free/ooo_pjb_com_au_card.ps
>> views just fine on my debian stable gv 3.7.4, ie: it displays in
>> A4 Portrait, which if I fold in half gives me a greeting card :-)
>> But converting it to pdf (for the local photocopy shop) with:
>>   cat ooo_pjb_com_au_card.ps | /usr/bin/gs -q -sDEVICE=pdfwrite \
>>    -sPAPERSIZE=a4 -sOutputFile=ooo_pjb_com_au_card.pdf -
>> it gives me a ooo_pjb_com_au_card.pdf which when I view it with
>>   gv ooo_pjb_com_au_card.pdf
>> displays in Seascape, all shifted around and with most of
>> the image chopped off :-(
>
> The resulting PDF works fine for me when viewed using Abode Reader.
> Perhaps the problem is with gv.

I get a third possible outcome by:
  gs ooo_pjb_com_au_card.pdf
which displays rotated into Seascape format :-( but without being
translated and cropped through the middle of the picture like gv
does.  It all seems very unpredictable.

  gs ooo_pjb_com_au_card.ps
display correctly.

I woke with the theory that in -sDEVICE=pdfwrite the showpage 
was being interpreted within the context of the
  0 ymax 0.5 mul translate 0.707 0.707 scale -90 rotate
line, so I enclosed that line and everything up to the showpage
in a gsave ... grestore but alas, no change.  I'll embark on a
line-by-line pruning-campaign to try to localise the problem...

Regards,  Peter

-- 

Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

[toc] | [prev] | [next] | [standalone]


#2444

FromPeter Billam <peter@www.pjb.com.au>
Date2016-03-06 05:02 +0000
Message-ID<slrnndnefr.3gc.peter@box8.pjb.com.au>
In reply to#2443
On 2016-03-06, Peter Billam <peter@www.pjb.com.au> wrote:
> I'll embark on a line-by-line pruning-campaign
> to try to localise the problem...

Well, I can harldy believe it, but this fails
(ie: gs -sDEVICE=pdfwrite -sPAPERSIZE=a4 rotates it into Seascape
 and viewing the pdf with gv translates it, cropping the text in half)

%!PS-Adobe-2.0
%%EndComments
%%BeginProlog
%%EndProlog
%%Page: 1 1
%%BeginPageSetup
%%EndPageSetup
/xmax 595.2 def  /ymax 841.8 def  /horizon ymax 0.28 mul def
gsave  % an attempt to protect the showpage in -sDEVICE=pdfwrite
0 ymax 0.5 mul  xmax ymax  rectfill
0 ymax 0.5 mul translate 0.707 0.707 scale -90 rotate
/ZapfChancery-MediumItalic findfont horizon 0.4 mul scalefont setfont
xmax 0.22 mul horizon 0.38 mul moveto (pjb.com.au) show
grestore showpage
%%EOF

whereas the same thing succeeds when I comment out the
  xmax 0.22 mul horizon 0.38 mul moveto (pjb.com.au) show
line thus:
  % xmax 0.22 mul horizon 0.38 mul moveto (pjb.com.au) show
!

It's amazing...  I have used this
  | gs -q -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=x.pdf -
dozens of times per day for decades now (I runs it as a pipe because
I have other processes that put the PS together) and I've never had
this PDF-in-Seascape problem before; indeed those Makefiles still work.
It must be related to the translate and rotate in conjunction with
the string...

It's not just about the show, because it also fails if I use
  charpath clip  and  rectfill   ...

I'm using debian stable:
  box8 (debian) ~> gs --version
  9.06
  box8 (debian) ~> gv --version
  gv 3.7.4

Peter

-- 

Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

[toc] | [prev] | [next] | [standalone]


#2445

Fromluser- -droog <mijoryx@yahoo.com>
Date2016-03-05 21:34 -0800
Message-ID<1946d6c6-bd60-4a80-95f5-5c800c26524a@googlegroups.com>
In reply to#2444
On Saturday, March 5, 2016 at 11:02:53 PM UTC-6, Peter Billam wrote:
> On 2016-03-06, Peter Billam <peter@www.pjb.com.au> wrote:
> > I'll embark on a line-by-line pruning-campaign
> > to try to localise the problem...
> 
> Well, I can harldy believe it, but this fails
> (ie: gs -sDEVICE=pdfwrite -sPAPERSIZE=a4 rotates it into Seascape
>  and viewing the pdf with gv translates it, cropping the text in half)
> 

This line of code has helped me to override erroneous rescaling by
the pdf viewer. Perhaps some similar pdfmark majick will configure
the orientation as well.

% persuade acrobat reader to obey the numbers 
[ {Catalog} << /ViewerPreferences << /PrintScaling /None >> >> /PUT 
pdfmark 

[toc] | [prev] | [next] | [standalone]


#2446

FromMartin Leese <please@see.Web.for.e-mail.INVALID>
Date2016-03-05 23:07 -0700
Message-ID<nbhvpr$nn8$1@dont-email.me>
In reply to#2442
Martin Leese wrote:
> Peter Billam wrote:
>> Greetings :-)  This Postscript file for a greeting card:
>>   http://www.pjb.com.au/comp/free/ooo_pjb_com_au_card.ps
>> views just fine on my debian stable gv 3.7.4, ie: it displays in
>> A4 Portrait, which if I fold in half gives me a greeting card :-)
>>
>> But converting it to pdf (for the local photocopy shop) with:
...
> 
> The resulting PDF works fine for me when
> viewed using Abode Reader.  Perhaps the
> problem is with gv.

That is to say, the problem appears to be
with the viewer and not with the PDF.  Your
original goal was to produce a PDF for the
local photocopy shop.  The shop will not be
using gv (or gs).

I suspect your problem is solved (never was),
and all you need to do is to troll down to
your local photocopy shop and ask them to
view the PDF.

-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web