Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Ghostscript question

 
SOLVED
Go to solution
Piet Timmers_1
Frequent Advisor

Ghostscript question

Hi everybody,

I have a ghostscript question.

I use ghostscript on OpenVMS, see:

$ gs -version
Aladdin Ghostscript 6.01 (2000-03-17)
Copyright (C) 2000 Aladdin Enterprises, Menlo Park, CA. All rights reserved.

We use it to convert postscript files to PDF.
This works, with one question left.

Some off the postscript files are in landscape mode, but ghostscript produces a portrait PDF.

I have searched on the Internet, but no solution until now.

Any idea.

Greetings,

Piet
9 REPLIES 9
Keith Cayemberg
Trusted Contributor

Re: Ghostscript question

Hi Piet,

this may be due to GS selecting the page orientation based on text direction, or getting confused when multiple text directions are in the document.

To my knowledge there is a separation of roles in postscript between the ps file code and the ps interpreter. At least the final determination of page size and orientation is set by the interpreter, with the text description in ps file being mostly agnostic about the limiting dimensions of the page being rendered.

Please see the description of "Setting page orientation" in the PS2pdf documentation...

http://pages.cs.wisc.edu/~ghost/doc/cvs/Ps2pdf.htm#Orientation

Try experimenting with the AutoRotatePages qualifier (/None or /All or /PageByPage) in combination with the setpagedevice function within the ps file or at the gs command line when printing/viewing the file.

Cheers!

Keith
Keith Cayemberg
Consultant
Wipro Technologies
Piet Timmers_1
Frequent Advisor

Re: Ghostscript question

Hi Keith,

I have tried all the options I can find in this help information, but still nothing works. When opening the file using Adobe PDF reader I need to rotate it afterwards.

I have attached the file I want to convert to PDF.

Greetings,

Piet

Hoff
Honored Contributor

Re: Ghostscript question

Attached is a PDF conversion using the Postscript and PDF tools that are integrated into Mac OS X.

If there's no Mac OS X box available, here is some reading that might help with your Ghostscript-based approach:

http://www.troubleshooters.com/linux/gs.htm
http://pages.cs.wisc.edu/~ghost/doc/cvs/Ps2pdf.htm
Keith Cayemberg
Trusted Contributor
Solution

Re: Ghostscript question



Hi Piet,

I have looked at your ps file, and it has a rotate function on each page which is turning all the text on the page by 90°.

With a little experimentation, and the troubleshooting doc provided by Hoff, I have a solution which may or may not be workable for your situation.

First using a text editor, I deleted the two lines (one for each page) with the rotate function call. See the differences output below...

$ diff 356316.PS
************
File SYS$SYSDEVICE:[CAYEMBERG.DOWNLOADS.piets_gs]356316.PS;2
13 118 118 translate
******
File SYS$SYSDEVICE:[CAYEMBERG.DOWNLOADS.piets_gs]356316.PS;1
13 -90 rotate -3508 0 translate
14 118 118 translate
************
************
File SYS$SYSDEVICE:[CAYEMBERG.DOWNLOADS.piets_gs]356316.PS;2
974 118 118 translate
******
File SYS$SYSDEVICE:[CAYEMBERG.DOWNLOADS.piets_gs]356316.PS;1
975 -90 rotate -3508 0 translate
976 118 118 translate
************

Number of difference sections found: 2
Number of difference records found: 2

DIFFERENCES /IGNORE=()/MERGED=1-
SYS$SYSDEVICE:[CAYEMBERG.DOWNLOADS.piets_gs]356316.PS;2-
SYS$SYSDEVICE:[CAYEMBERG.DOWNLOADS.piets_gs]356316.PS;1

Then I forced a landscape format using the following gs batch mode command...

$ gs "-dBATCH" "-dNOPAUSE" "-sOutputFile=NEW.PS" "-sDEVICE=pdfwrite" -
"-c" "<> setpagedevice" "-f" 356316.PS

The resulting NEW.PS then has the desired text orientation on a landscape formatted page.

Cheers!

Keith
Keith Cayemberg
Consultant
Wipro Technologies
Piet Timmers_1
Frequent Advisor

Re: Ghostscript question

Keith,

I almost dare not ask but I have another question.

The resulting PDF is in landscape, but the fist page is in BOLD and the second not.

Do you know why.

Greetings,

Piet
Keith Cayemberg
Trusted Contributor

Re: Ghostscript question


Hi Piet,

I don't see any reason for the font to be different between the two pages. The font appears to be bold on both pages with me. This didn't change whether I viewed the NEW.PS using GS on OpenVMS or under Windows XP. The findfont/setfont configuration in the ps file also appears to be identical for both pages.

My gs version on OpenVMS is AFPL Ghostscript 8.54 (2006-05-17)

Cheers!

Keith
Keith Cayemberg
Consultant
Wipro Technologies
Piet Timmers_1
Frequent Advisor

Re: Ghostscript question

Keith,

When viewing the postscript file I see on both pages a bold font.

When I use postscript to create a PDF I see bold on page one and another font on page two using the PDF viewer. The PDF viewer will show an error message when scrolling to page two.

Greetings,

Piet
Keith Cayemberg
Trusted Contributor

Re: Ghostscript question


Sorry Piet,

I didn't read your explanation carefully enough, and I confused myself about which type of file was being created by gs in the solution I provided.

The command I provided should have read...

$ gs "-dBATCH" "-dNOPAUSE" "-sOutputFile=NEW.PDF" "-sDEVICE=pdfwrite" -
"-c" "<> setpagedevice" "-f" 356316.PS

The file produced by gs using the pdfwrite device is (of course) a pdf file. The NEW.PDF doesn't need any more conversion to become a pdf.

I also looked at the NEW.PDF using XPDF on OpenVMS and Acrobat Reader on Windows XP. I encountered no error on the 2nd page, and the typeface is the same bold font from the first page.

Cheers!

Keith
Keith Cayemberg
Consultant
Wipro Technologies
Piet Timmers_1
Frequent Advisor

Re: Ghostscript question

Keith,

Your answer gave me enough informaton to solve the problem.

I was using ghostscript 6.01
After installing 8.11 everything works fine.

Thank you very much for all the help you gave to me.

Greetings,

Piet