Yes, we convert pdf to ps from the command line using Acrobat. I don't know about the printer because I'm not the one who wrote the code (that I want to get rid of) and I'm not the one who is concerned. I only know they accept PS. Anyways, it seems from your answer that if I render fo to PS directly, the code will be more dependant not only on the application (and its parameters, which I wanted to remove), but also on the printer. That's something I really don't want to do.
Right now everything is fine. I only posted the questions because I wanted the code to look better (and because I wanted to understand why things must be done this way). From an OO point of view, I thought it could be better to pass to the printer (the printing object, that is) only one thing that has is all ( the document, pdf or ps) and not like what is happening now; passing also the paper size and the orientation, to be used by Acorbat. Thank you very much Jeremais -----Original Message----- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 7:33 PM To: [EMAIL PROTECTED] Subject: Re: Configuring Portrait/landscape from PSRenderer > We use Acrobat on Unix to print PDF's. Currently we have to call Acrobat > with the correct parameters of paper size and orientation from Java code. I > was wondering maybe I could get rid of this step by including such > parameters into the pdf itself. It seems I can't. No. Do I get you correctly, that you convert the PDF to PS on the command line and print the resulting PS file? What printer are you printing on? We're printing on big Xerox DocuPrint printers that have no trouble with the PostScript generated by Acrobat Reader on Unix. If you're printing on a HP LaserJet or similar there might be some special PS commands available that you could patch the PS with to get what you want. > I understood from Amine's question that it is not the same case with PS (of > course, it is a printer language). I think his question meant that in PS it > is possible to set the orientation (and the paper size??) in PS. If so, I > might consider changing my output format to PS, and hence get rid of the > ugly Acrobat call, with parameters, from code. Currently I don't know if > switching to PS is that easy, or if it would work as I expect. Switching to PS may not be so easy, switching to PSRenderer that is. The PS renderer still lacks considerable features when compared to the PDF renderer. I'm still using the PDF renderer for our stuff and convert the PDFs to PostScript using Acrobat Reader on Unix. But it may be worthwhile to try it out if you only need Times, Helvetica or Courier. > It all depends on whether the paper size can be set inside the fo (probably > not?) and rendered correctly to PS using FOP. Or, possibly by using another > workaround in PSRenderer e.g. by measuring the page width/height combination > against standard paper sizes and setting the closest one into the PS. You set the paper size in the page master. And FOP does everything right what paper size is concerned. The only problem is mastering the different target printers. PDF is meant to be portable so it doesn't contain printer specific stuff. Printing a PDF means you have to do some stuff before everything prints out as expected. In PS this is currently the same, because the PS renderer doesn't support PPD's that describes the PS printer's capabilities. When you install a PostScript printer on Windows you often get the standard Adobe PS driver plus a PPD. I think the solution to your problem really depends on the printer you're using. If you can tell me which one you're using, then I can probably propose a solution. > But thanks for implementing the orientation for PS orientation anyway :) You're welcome. Cheers, Jeremias Märki