Re: Producing PDF from subset of IF file pages
Just FYI, I created an issue for the NullPointerException: https://issues.apache.org/bugzilla/show_bug.cgi?id=51836 -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32479591.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Producing PDF from subset of IF file pages
Jeremias Maerki-2 wrote: Hmm, a NullPointerException is not a very nice way to handle this. Would you mind creating a Bugzilla issue for this maybe? https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop Sure, I will create a Bugzilla issue. Jeremias Maerki-2 wrote: Anyway, if all you need are hard copies, you can probably just filter all nav:* elements (http://xmlgraphics.apache.org/fop/intermediate/document-navigation) and it should work. Filtering the nav:* elements did the trick. Many thanks!! -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32474441.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Producing PDF from subset of IF file pages
Hi Melanie, IF page and page-segment elements are generally self-contained. I can imagine that there could be problems with document navigation tags, so they might need to be filtered, too. Did you get any specific error message? The X/Y coordinates are indendent between pages. You can filter them using XSLT or by implementing the IFDocumentHandler interface. Take a look at the following classes for inspiration: - org.apache.fop.render.intermediate.util.IFConcatenator - org.apache.fop.render.intermediate.util.IFDocumentHandlerProxy - examples/embedding/java/embedding/intermediate/ExampleConcat.java There is currently no convenience class (like the IFConcatenator) that demonstrates page filtering, but it should really be easy to do. So I'm a little surprised that removing page elements didn't work for you. It might help if you posted a file that demonstrates your problems. On 14.09.2011 16:30:20 jeanyo wrote: Hi, I'm new to FOP. I could not find any discussion related to my question. My goal is to produce a PDF that contains only a subset of pages from a FOP intermediate (IF) file. I thought I could manipulate the IF file, deleting some of the page-sequence and page elements, but this does not work. I suspect that it fails because the IF file contains X-Y coordinates. Is there an obvious way to create a PDF using only a subset of pages from an IF file? Is there a simple option to print only certain pages? My colleague suggested that there is a way to read the IF file into a set of FOP objects. He suggested that I may be able to selectively append these objects to generate the PDF. Does anyone know the mechanism (i.e., classes) to accomplish this? Oh, and in my case, starting off with less content (i.e., in the XSL-FO) is not an option. I have a very specific need to eliminate just certain pages and I have no way of determining which pages to remove/exclude until the IF file is generated. Thanks!! -Melanie Operating System: Windows XP FOP Version: 1.0 JDK: 1.5 -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32463958.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Producing PDF from subset of IF file pages
Thanks for your help! I have attached two files: - premod.if.xml: This is the untouched IF file. - postmod.if.xml: This is premod.if.xml, but with many of the page elements and some page-sequence elements removed. You will notice extra white space where elements were deleted. The specific error I get when trying to generate the PDF is: Caused by: java.lang.NullPointerException at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.updateTargetLocation(PDFDocumentNavigationHandler.java:188) at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.getAction(PDFDocumentNavigationHandler.java:160) at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.renderLink(PDFDocumentNavigationHandler.java:108) at org.apache.fop.render.intermediate.extensions.DocumentNavigationHandler.endElement(DocumentNavigationHandler.java:186) [rest of stack omitted] I believe the NullPointerException occurs on this line in PDFDocumentNavigationHandler.java: action.getTargetLocation().x / 1000.0, Does target location imply a link target location? If so, you were correct in predicting this as an issue. I'm not sure this version of the publication must support linking, but I will verify. The real purpose is to provide a hard copy of the PDF. Thanks again. -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464585.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Producing PDF from subset of IF file pages
Actually, here are the file attachments... jeanyo wrote: I have attached two files: - http://old.nabble.com/file/p32464608/premod.if.xml premod.if.xml : This is the untouched IF file. - http://old.nabble.com/file/p32464608/postmod.if.xml postmod.if.xml : This is premod.if.xml, but with many of the page elements and some page-sequence elements removed. You will notice extra white space where elements were deleted. -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464608.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Producing PDF from subset of IF file pages
Actually, did you upload them somewhere to link? I believe this distribution list does not allow attachments. -Original Message- From: jeanyo [mailto:melanie.dr...@gmail.com] Sent: Wednesday, September 14, 2011 11:43 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Producing PDF from subset of IF file pages Actually, here are the file attachments... jeanyo wrote: I have attached two files: - http://old.nabble.com/file/p32464608/premod.if.xml premod.if.xml : This is the untouched IF file. - http://old.nabble.com/file/p32464608/postmod.if.xml postmod.if.xml : This is premod.if.xml, but with many of the page elements and some page-sequence elements removed. You will notice extra white space where elements were deleted. -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-t p32463958p32464608.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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
RE: Producing PDF from subset of IF file pages
Sorry, I believe these links should work: http://old.nabble.com/file/p32464608/premod.if.xml http://old.nabble.com/file/p32464608/postmod.if.xml Eric Douglas wrote: Actually, did you upload them somewhere to link? I believe this distribution list does not allow attachments. -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464720.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Producing PDF from subset of IF file pages
Hmm, a NullPointerException is not a very nice way to handle this. Would you mind creating a Bugzilla issue for this maybe? https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop Anyway, if all you need are hard copies, you can probably just filter all nav:* elements (http://xmlgraphics.apache.org/fop/intermediate/document-navigation) and it should work. On 14.09.2011 17:39:37 jeanyo wrote: Thanks for your help! I have attached two files: - premod.if.xml: This is the untouched IF file. - postmod.if.xml: This is premod.if.xml, but with many of the page elements and some page-sequence elements removed. You will notice extra white space where elements were deleted. The specific error I get when trying to generate the PDF is: Caused by: java.lang.NullPointerException at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.updateTargetLocation(PDFDocumentNavigationHandler.java:188) at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.getAction(PDFDocumentNavigationHandler.java:160) at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.renderLink(PDFDocumentNavigationHandler.java:108) at org.apache.fop.render.intermediate.extensions.DocumentNavigationHandler.endElement(DocumentNavigationHandler.java:186) [rest of stack omitted] I believe the NullPointerException occurs on this line in PDFDocumentNavigationHandler.java: action.getTargetLocation().x / 1000.0, Does target location imply a link target location? If so, you were correct in predicting this as an issue. I'm not sure this version of the publication must support linking, but I will verify. The real purpose is to provide a hard copy of the PDF. Thanks again. -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464585.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org