If I assign the page-height=11" and page-width=8.5" and reference-orientation=90 it works perfectly, except the PDF and print preview appear sideways.
 
If I assign the page-height=8.5" and page-width=11" and reference-orientation=0 it works for PDF and print preview but really confuses the printer.  After prompting for paper in the manual feed tray, the printer prints it landscaped on portrait, so it's running off the right edge and cutting off the bottom.
 
There is a workaround for this, but is there a solution?  The most obvious workaround is to transform it both ways keeping 2 copies in memory, one for preview and PDF and one for sending to the printer.  This is acceptable only if the transform is a fast process and the memory usage is small enough where doubling it is not a concern.  I can't reasonably hold just one or the other in memory if I want to be able to send it to the printer while the preview is active...
 


From: Stuart Scott [mailto:Stuart.Scott@countrywide.co.uk]
Sent: Wednesday, August 25, 2010 7:00 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Orientation

Hi Eric

 

I tried mine with option 2 and the landscape page does indeed print out portrait. 

 

So if you want a landscape page in the middle of portrait pages for viewing only, option 2 is the better option.  If you want the same to print only, option 1 is the best.  If you want both I think you have a problem.

 

I am not sure if this would be considered a bug or something that could be considered for a future FOP release.

 

Are you able to use two separate stylesheets, one using each option?

 

Kind regards

 

Stuart Scott

 


From: Eric Douglas [mailto:edouglas@blockhouse.com]
Sent: 20 August 2010 16:13
To: fop-users@xmlgraphics.apache.org
Subject: RE: Orientation

 

That is the reference-orientation=90 option I tried.  That works well, though I don't think users want to view it sideways.

There are 2 ways to print landscape, I've determined.  See attached.

The first one involves setting page-height=11" and page-width=8.5" and reference-orientation=90.

The second one  involves setting page-height=8.5" and page-width=11" and reference-orientation=0.

The issues with that:

1. The first method prints fine if I create a pageable object from the FOP output (using embedded code with the output stream) and send it straight to the printer using the Java PrintService with default options, only assigning JobName.

The second method sent straight to the printer goes to tray 1 (manual feed) instead of the default tray 3, asking for 8.50" x 11.00" paper, and after putting the paper in it prints portrait.

2. I couldn't figure out how to get the second method working with mixed output, getting one page to print portrait and the next to print landscape.

 

The first method seems unusable if it can't turn sideways by default when the users view the PDF, to read like the second one.

The second method seems unusable if I can't get it to come out on the printer like the first one does.

 

 


From: Stuart Scott [mailto:Stuart.Scott@countrywide.co.uk]
Sent: Friday, August 20, 2010 9:55 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Orientation

Hi Eric

 

I am not sure I fully understand your issue, so can you take a look at page 4 in the attached PDF.  Is that what you are after?

 

Kind regards

 

Stuart Scott

 


From: Eric Douglas [mailto:edouglas@blockhouse.com]
Sent: 20 August 2010 14:00
To: fop-users@xmlgraphics.apache.org
Subject: Orientation

 

Maybe I was just thinking too far out of the box, but I was wondering if it's possible to create output with different pages having different orientation.

I tried just swapping the page-height and page-width attribute values and had a couple of issues with it.  For a PDF, if I set the first page to portrait and the second page to landscape it was making both pages landscape.  On getting the output directly to the printer that was somehow selecting the wrong tray.

I've tried setting the reference-orientation value to 90.  I haven't gotten a test that worked with portrait and landscape in the same output, but this works well for landscape directly to the printer.  The problem with this value is when I create a PDF and try to view it, the pages actually show as sideways.

On sending output directly to the printer I'm actually generating a pageable object from the FOP output and using the javax.print.PrintService class.  I was wondering if just setting the javax.print.attribute.standard.PresentationDirection and/or javax.print.attribute.standard.OrientationRequested value would work best for printing landscape, though of course this would not allow portrait and landscape pages in the same output.

The only other way I can think of to get portrait and landscape orientation in the same output would be to create different xml files for each and process them separately, though of course this would require some method of combining the output to get one PDF, and it would break xsl code like fo:page-number-citation ref-id="last-page".

For email disclaimer details please click or visit - http://www.countrywideplc.co.uk/disclaimer