Ok, that's confusing. 1) I've seen the method setOutputFile, but that accepts a single file name? I've looked at the code in the PNGRenderer and saw an object having to do with multiple files but didn't understand how that works.
2) If possible I want to create the output as an array of PNG images without physically writing files. I create the PDF output without writing any files, then I can either use that output to generate an object to pass to a printer or I clone the object as bytes from a server to a client to save as a PDF on the client. I want to clone the array of images the same way to display on the client in a custom GUI window. Basically I want to do what the PreviewPanel does but simpler. The PreviewPanel object requires a renderer and transformer and rerenders the document for zooming and all that going on the client takes a ton of processing time. I want to do all rendering on the server to just preview as images. -----Original Message----- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, January 27, 2011 10:27 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP output Sorry, Eric, I assumed you know about how the PNGRenderer works. You can set a java.io.File using FOUserAgent.setOutputFile(File). This way the PNGRenderer has a filename and directory to produce multiple output files. This is documented here: http://xmlgraphics.apache.org/fop/1.0/output.html#bitmap On 27.01.2011 15:24:31 Eric Douglas wrote: > So resolution should be the easy part. The tricky part is the > question you didn't answer. > How do I generate a multipage document as an image with a separate > image for each page? > Here's what I'm getting so far. > I wrote an embedded code program. It can produce a PDF with multiple > pages. It can load the PDF into pdfbox to create a Pageable object > and it can print that. > I tried just changing the PDF generate part to use the PNG mime with > the PNGRenderer. It created one PNG image, which only shows the first page. > > After the transform I tried the Fop.getResults method. It returned an > object of type org.apache.fop.apps.FormattingResults. > I tried executing the getPageSequences method. It returned an object > of type java.util.List, an array with one element. > I can get that one element which is an object of type > org.apache.fop.apps.PageSequenceResults. > That object only has 2 methods, getID and getPageCount. getPageCount > returns 11. How do I get images of the other pages? > > > -----Original Message----- > From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] > Sent: Thursday, January 27, 2011 3:35 AM > To: fop-users@xmlgraphics.apache.org > Subject: Re: FOP output > > On 24.01.2011 17:30:43 Eric Douglas wrote: > > I generated a one page document as a PNG but > > 1) The image looks fine at 100% which is small on my screen. If I > > zoom in it gets blurry. > > Sure, it's a bitmap. Some viewers apply some kind of interpolation > when zooming in which causes the blur. If they don't the image becomes > "blocky". > > > 2) I need to figure out how to generate a multipage document as an > > image with a separate image for each page so I can use them to build > > a > > > print preview screen. Looking at the code for the renderers it > > appears able to do this. I just can't quite figure out how to put > > it > together. > > Just set the resolution high enough so you get a good quality for the > size you need in the preview screen. You may have to re-render the > documents at different resolutions when the user zooms in or out in > order not to have to render at 600dpi every time and thus making the > downloads very large. You can set the (target) resolution using the > config file or the FOUserAgent (i.e. for each document separately). > Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org