Re: FOP Postscript layout portrait, should be landscape

2006-01-26 Thread Chris Bowditch

Ian  Chris wrote:


Thanks for the help,

What we have done in this instance is by using some other java code and
another product to read the PDF and make that into a PS stream that is sent
to the printer. The reason for doing this is so we don't have to run the FOP
process twice, i.e. once for the PDF (which the user want to keep) and once
for the PS (that the users want to automatically print), also we need the PS
to be identical to the PDF an I am not sure if in some cases this is so (svg
etc...).


Using the latest FOP from SVN you can make use of the Intermediate 
Format XML to avoid having to render the document twice in order to get 
both PS and PDF copies. Thats waht I'm planning to do. Although you end 
up making 3 calls to FOP code, the second 2 are trivial, its the time 
taken to generate the Intermediate Format that is significant, and you 
will only need to do that once.





The main problem in doing this natively on the AS400 (where I am trying to
do this) is that the OS/400 OS doesn't support AWT natively, another product
called PASE (free on the AS400) needs to be installed to allow the graphics
to work, then another product called PDFbox to render the document as PS.


I can't see any mention of AWT in the thread so far, so I'm not sure 
what you mean. Perhaps your documents have SVG, and thats why you need 
AWT support. Again I can't see it mentioned in the thread. Maybe I 
overlooked something obvious.




I cannot dynamically determine if the document will be portrait or landscape
and set the renderer.setAutoRotateLandscape(true) before the document is
rendered so that option is a bit though, also I don't have much Java
experience (close to none), so I am a bit limited in what I can do with FOP
to change the code.


You don't need to dynamically determine whether the document is 
landscape or portrait, you merely need to set the configuration property 
Jeremias mentioned in his post below, i.e.


 renderer mime=application/postscript
   auto-rotate-landscapetrue/auto-rotate-landscape
   fonts
 font
   /fonts
 /renderer

This property means FOP will dynamically detect whether the document is 
portrait or landscape, so you don't have to!


snip/

Chris



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: FOP Postscript layout portrait, should be landscape

2006-01-25 Thread Ian Chris
Thanks for the help,

What we have done in this instance is by using some other java code and
another product to read the PDF and make that into a PS stream that is sent
to the printer. The reason for doing this is so we don't have to run the FOP
process twice, i.e. once for the PDF (which the user want to keep) and once
for the PS (that the users want to automatically print), also we need the PS
to be identical to the PDF an I am not sure if in some cases this is so (svg
etc...).

The main problem in doing this natively on the AS400 (where I am trying to
do this) is that the OS/400 OS doesn't support AWT natively, another product
called PASE (free on the AS400) needs to be installed to allow the graphics
to work, then another product called PDFbox to render the document as PS.

I cannot dynamically determine if the document will be portrait or landscape
and set the renderer.setAutoRotateLandscape(true) before the document is
rendered so that option is a bit though, also I don't have much Java
experience (close to none), so I am a bit limited in what I can do with FOP
to change the code.

Thanks for you help on this and the A4 A3 explanation, it is much
appreciated.


-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 24 January 2006 6:51 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: FOP Postscript layout portrait, should be landscape

XSL-FO does not provide a means to specify that a page is landscape. It
only allows you to specify the paper size. Please note that there are
two ways to print a landscape A4 page on a printer:
- Print the page in normal orientation on a A3 printer with A4 paper
added in landscape orientation.
- Print the page rotated on a A4 printer.

It appears you want to do the latter. This is possible with both FOP
0.20.5 and 0.91beta. The PostScript renderer can produce code that (like
the PCL Renderer) rotates the page like you want it.

0.20.5: Instantiate the PSRenderer instance yourself and set
PSRenderer.setAutoRotateLandscape(true). Example:

Driver driver = new Driver();
PSRenderer renderer = new PSRenderer();
renderer.setLogger(console);
renderer.setAutoRotateLandscape(true);
driver.setRenderer(renderer);

0.91beta: I see that the setAutoRotateLandscape(boolean) method is
missing there. I'll add it back in. However, you can set the same value
through configuration. You can simply set
auto-rotate-landscapetrue/auto-rotate-landscape
in the renderer configuration for the PostScript renderer. Example:

[..]
renderer mime=application/postscript
  auto-rotate-landscapetrue/auto-rotate-landscape
  fonts
font
  /fonts
/renderer
[..]

I realize this is all poorly documented. I'll see to it that this is
fixed. Help and documentation patches would, of course, also be welcome.

On 24.01.2006 07:52:07 Ian  Chris wrote:
 Hello,
  
 I am currently using FOP on the AS400. It is working very will, and
creates
 PDF documents. 
  
 The problem I am having is that I cannot print PDF documents natively on
the
 AS/400, but I can print PostScript (PS), I have proven this can work, and
it
 works OK, until he document needs to be printed in landscape mode. The PS
 will always print in portrait mode, I have tried many things, in PCL it
 works in landscape, but the PCL margin formatting is not as good as the PS
 and not really functional, so I was hoping to use the PS.
  
 I have tried the same process on windows, and the PDF document prints
 landscape, but the PS document prints as portrait. This proves that the
 problem isn't platform specific.
  
 I also tried to use 0.91beta, and the problem is still there in both
 platforms.
  
 Is this an existing bug?
  
 Is there something in the XSL that I can change to direct it to print
either
 landscape or portrait (besides the height  width settings)?
  
 Is there some other method of allowing the PS to come out in portrait?
  
 The only other method I can in visage is to get the PDF document and
change
 that to PS via some tool that will run on the as400, not really the way I
 was hoping to move forward.
  
 Any suggestions or assistance will be of immense help,
  
 Thank you.



Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FOP Postscript layout portrait, should be landscape

2006-01-23 Thread Ian Chris








Hello,



I am currently using FOP on the AS400. It is working very
will, and creates PDF documents. 



The problem I am having is that I cannot print PDF documents
natively on the AS/400, but I can print PostScript (PS), I have proven this can
work, and it works OK, until he document needs to be printed in landscape mode.
The PS will always print in portrait mode, I have tried many things, in PCL it
works in landscape, but the PCL margin formatting is not as good as the PS and
not really functional, so I was hoping to use the PS.



I have tried the same process on windows, and the PDF
document prints landscape, but the PS document prints as portrait. This proves
that the problem isnt platform specific.



I also tried to use 0.91beta, and the problem is still there
in both platforms.



Is this an existing bug?



Is there something in the XSL that I can change to direct it
to print either landscape or portrait (besides the height  width settings)?



Is there some other method of allowing the PS to come out in
portrait?



The only other method I can in visage is to get the PDF
document and change that to PS via some tool that will run on the as400, not
really the way I was hoping to move forward.



Any suggestions or assistance will be of immense help,



Thank you.