[reportlab-users] Bug in SimpleDocTemplate?

Tim Roberts timr at probo.com
Thu Feb 1 18:21:22 EST 2007


Michael Hipp wrote:

> Tim Roberts wrote:

>

>> Michael Hipp wrote:

>>

>>> Here's a fragment of what I'm doing in trying to create a landscape document...

>>>

>>> from reportlab.lib.pagesizes import letter, landscape

>>> pageSize = landscape(letter)

>>> doc = SimpleDocTemplate(fnam, pagesize=pageSize, showBoundary=0)

>>>

>>> When I pull up the resulting pdf in Adobe Reader, it looks perfect, but it

>>> prints portrait. In the print dialog for Adobe Reader it tells me

>>>

>>> Document: 11.0 x 8.5 in.

>>> Paper: 8.5 x 11.0 in.

>>>

>>> Is this a bug or am I doing something wrong?

>>>

>> This is normal. When you have a landscape document, you have to change

>> the printer to print in landscape. Alternatively, the Acrobat dialog

>> has an "Auto-rotate and center" option that will do this for you

>> automatically.

>>

>

> Um, I pray you're mistaken.

>

> So what would someone do if they (like me) are using GhostScript for printing

> rather than Adobe. Does it have such an option? (I don't see one.)

>


With GhostScript, I guess you would use the printer's own dialog to
change the printer to landscape mode.


> Surely Reportlab should be able to produce output where the document and paper

> match.

>


It's not up to ReportLab. ReportLab doesn't have a CLUE about the
printer that will eventually be used, nor what kind of paper is in it,
nor what orientation it might be expecting. Acrobat knows some of that,
but the rest is embedded in the printer driver. ReportLab produces PDF
output in a particular orientation. That's all it can do. Acrobat is
responsible to send that output to a printer. The printer is configured
by the driver to print in either portrait or landscape. That setting is
part of the printer's property pages.

You get the same problem with applications like Visio. Just because you
rotate your canvas to draw in landscape doesn't mean it will print in
landscape. To get that, you have to adjust the printer properties using
the print dialog.

If your printer is normally set up for portrait, then Andy's suggestion
is the right one: leave your orientation as portrait and rotate your
drawing by 90 degrees.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list