Page margins lost during ps2pdf conversion of landscape mode 

Hi,

I need to create this two-column landscape file, which showed up well as .ps file. The problem is that I also need to share it with those Windoze user, some who might not even know of the .ps format. Pdf file seems to be the only file that can still hold the two-column landscape format after the conversion (out of .html and .rtf files).

But the problem is that the page margins are lost after the conversion. The content shift from the center of the page to the lower left corner.

I've been trying my best to solve the problem myself, googling the posting archives, trying dvipdf or pdfelatex… now I'm at the end of my imagination.

Does any know a solution to this two-column landscape file sharing problem?

Thanks a lot

PS. Test file included

\documentclass[twocolumn,landscape]{article}

%% Preamble
\title{The Title}
\author{The Author}
\date{}

\setlength{\parindent}{0pt}

%% Body
\begin{document}
\maketitle

blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah

...

\end{document}

Page margins lost during ps2pdf conversion of landscape mode 

> But the problem is that the page margins are lost after the
> conversion. The content shift from the center of the page to the
> lower left corner.

You did not say what paper size you wanted. I am assuming it is US letter which is what article.cls defaults to. You also did not say what application you are using to make the PDF file.

Use testflow to check out your settings:

http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/testflow/

My best guess is that your Ghostscript based ps2pdf is using A4 papersize.

What does the BoundingBox line say in your .ps file?

Using dvips -T 11in,8.5in file, I obtain a BoundingBox of:

%%Orientation: Landscape
%%BoundingBox: 0 0 612 792

which is correct.

Using the ps2pdf script mentioned in testflow, I then get what appears to be a proper PDF file. Ghostscript can make mistakes when guessing the orientation if the page contains rotated text. See:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=NBIHa.42%24op3.2%40nwrddc04.gnilink.net

for details.

You can also pass paper size commands to dvips and pdftex via these commands in your preamble:

\makeatletter
\@ifundefined{pdfpageheight}{% not using pdflatex, setup paper size for dvips
% Warning: this sets dvips to US letter landscape irrespective of the
% real document settings
\special{papersize=11in,8.5in}}%
{% using pdftex, set paper size for pdftex
\global\pdfpageheight\paperheight\global\pdfpagewidth\paperwidth}
\makeatother

The pdflatex, but not dvips part, will auto-adjust as the document paper size changes. With the above, pdflatex should work just great with whatever paper size you throw at it.

A set of commands like the above, except a more complex one that adjusts the dvips special settings with changes to the document paper size options, should be part of all future versions of the base classes, IMHO.

Mike Shell

Printer paper sizes 

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=papersize

Paper sizes can be a pain: they're a forgotten backwater, because there's no DVI command to specify the paper size of the document. One usually finds American "letter" paper size being used, by default, in macro packages (such as plain and LaTeX); but distributions provide configuration files for DVI drivers (and since most distributions originate in Europe, the drivers usually default to ISO "A4" paper size).

An interestingly different issue arises for users of PDFTeX - the PDF format does have the means of expressing paper size, but much of the core software predates PDFTeX, so not even PDFLaTeX sets the correct values into \pdfpagewidth and \pdfpageheight.

The geometry package (whose main business is defining typeset page areas), also takes notice of the paper size the document is going to print to, and can issue the commands necessary to ensure the correct size is used. If geometry is used when a document is being processed by either PDFLaTeX or VTeX, it will set the neccesary dimensions as a matter of course. If the document is being processed by LaTeX on a TeX or e-TeX engine, there are two package options (dvipdfm and dvips) which instruct geometry which \special commands to use. (Note that the options are ignored if you are using either PDFLaTeX or VTeX.)

So, the resolution of the problem is to add

\usepackage[dvixxx,...]{geometry}

(where dvixxx is your current favourite DVI driver), and the document will run correctly with any of LaTeX (whether or not run on VTeX) or PDFLaTeX.