problems with Landscape printing

By: Pascal Richer - pascalxricher
problems with Landscape printing
2003-11-13 13:35

I'm experimenting some problems with the printing of a landscape report.

I created a report with the landscape orientation and with the appropriate height and width. If I produce the report in the PDF format, there is not problem but when I try to send the report to the printer, the landscape orientation is used but the left margin have 2.25 inches when I specified a left margin of 0 in the XML declaration.

If I tried to print the report with the printer dialog and I manually set the left margin attribute to 0.25 inch, the result is ok.

Here is the code I did :

PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();


PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();

JRPrintServiceExporter exporter = new JRPrintServiceExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet);

exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet);

exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);

exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE);


By: Prem - premb007
RE: problems with Landscape printing
2003-11-20 03:43
We faced the same problem. Please check if you have put the pageWidth & pageheight correctly. Normally for A4 it is pageWidth="595" pageHeight="842" but for Landscape we need to interchange the two value.

It seems odd, but this is how it worked for us
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 7 months ago

0 Answers:

No answers yet