Re: Fail hard on missing images
Yes, at the moment, this only works when interfacing through Java. The ability to configure which events cause what for the command-line interface has simply not been implemented, yet. I very rarely run FOP from the shell. For me personally, FOP is primarily a software library to integrate in other Java applications. But it happens to have a command-line interface and a rather neglected Ant task plug-in. I guess being able to fine-tune event behaviour through the user configuration could be useful. But again, it's just not implemented, yet. Given that you had to wait two weeks for an answer to your question indicates that the event feature is known to and used by few. It doesn't seem to be a popular requirement. In that way, it wasn't a design choice but a missing demand. But the current design in no way stays in the way of implementing what you expected. Jeremias Maerki On 29.05.2016 19:16:12 Oskar Berggren wrote: > Are you saying I need to create my own fop runner to do such a thing? It > can't be done using the regular fop script? > > > Seems like an unfortunate design choice. Or maybe I'm missing something... I > always thought the fop script was the primary method of using fop, but > perhaps I'm wrong. > > > /Oskar > > > > 2016-05-26 14:10 GMT+01:00 Jeremias Maerki <d...@jeremias-maerki.ch>: > See http://xmlgraphics.apache.org/fop/2.1/events.html for an example of > > exactly that. > > > > HTH > > Jeremias Maerki > > > > > > On 12.05.2016 23:12:22 Oskar Berggren wrote: > > > Hi, > > > > > > > > > Sometimes a document will reference an image that FOP is unable to find. > > With FOP 2.0, it will print a SEVERE log and then continue processing the > > file, eventually exiting with a regular zero exit code. > > > > > > > > > Because there may be a significant amount of other logs, and because > > this FOP was invoked from a makefile that renders a bunch of documents, > > it's easy to miss the log about the missing image. And because FOP appears > > to not use a non-zero exit code, the make command will also not complain. > > > > > > > > > How can I make FOP scream louder on missing images (and perhaps also > > other errors)? It could complete processing the file, but crucially I would > > like it to exit with a non-zero exit code so that make will stop with an > > error message. > > > > > > > > > > > > /Oskar > > > > > > > > > > > > > > > > - > > 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: Is there a way to remove "INFO org.apache.fop.apps.FOUserAgent - Rendered page XXX" logs ?
Dean, FOP uses Apache Commons Logging as the logging API. And Commons Logging can forward log events to different logging backends such as Log4J, java.util.logging or the console. How this is configured depends on you and possibly your environment. More info: * http://xmlgraphics.apache.org/fop/2.1/embedding.html#basic-logging * http://commons.apache.org/proper/commons-logging/guide.html#Quick_Start Regards, Jeremias Maerki On 26.05.2016 17:27:32 Dean Nelson wrote: > Jeremias, > Why then does this message show up on Linux but does not show up on Windows? > Is there some other logging that is used on Windows? > > Just curious since we use both platforms for Docbook and I only see that > message on Linux. > > Regards, > > Dean Nelson > Engineering Manager > Metriguard, Inc > (509) 332-7526 > > > > -Original Message- > From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] > Sent: Thursday, May 26, 2016 6:20 AM > To: fop-users@xmlgraphics.apache.org > Subject: Re: Is there a way to remove "INFO org.apache.fop.apps.FOUserAgent - > Rendered page XXX" logs ? > > If you run FOP from a Java application you can use > http://xmlgraphics.apache.org/fop/2.1/events.html to register an > EventListener which allows you to suppress this event. > > The event ID for the "Rendered page #*" event is: > org.apache.fop.render.RendererEventProducer.endPage > > HTH > Jeremias Maerki > > > On 29.04.2016 13:18:50 Julien Lancelot wrote: > > Thanks guys, I was hoping that their was another way, but it's ok, I'll > > update the configuration of the logger. > > > > Regards, > > Julien Lancelot > > > > On Fri, 29 Apr 2016 at 12:21 Chris Bowditch <bowditch_ch...@hotmail.com> > > wrote: > > > > You should be able to configure Commons logger to only output Warnings > > > and higher and ignore INFO messages > > > > > > Chris > > > > > > On 28/04/2016 15:02, Julien Lancelot wrote: > > > > Hi, > > > > > > > > I'm using FOP 2.1, and when I generate a PDF, I can see the > > > following > logs in my console : > > > > > > > > 15:52:59.057 INFO org.apache.fop.apps.FOUserAgent - Rendered page #1. > > > > 15:52:59.140 INFO org.apache.fop.apps.FOUserAgent - Rendered page #2. > > > > 15:52:59.155 INFO org.apache.fop.apps.FOUserAgent - Rendered page #3. > > > > 15:52:59.159 INFO org.apache.fop.apps.FOUserAgent - Rendered page #4. > > > > 15:52:59.853 INFO org.apache.fop.apps.FOUserAgent - Rendered page #1. > > > > 15:52:59.890 INFO org.apache.fop.apps.FOUserAgent - Rendered page #2. > > > > 15:52:59.900 INFO org.apache.fop.apps.FOUserAgent - Rendered page #3. > > > > > > > > Is there a way to not generate this logs ? > > > > > > > > Thanks ! > > > > -- > > > > Julien LANCELOT |SonarSource > > > > http://sonarsource.com <http://sonarsource.com/> > > > > > > > > > > > > > > > > > > - To unsubscribe, e-mail: > > > fop-users-unsubscr...@xmlgraphics.apache.org > > > For additional commands, e-mail: > > > fop-users-h...@xmlgraphics.apache.org > > > > > > > -- > > > > Julien LANCELOT | SonarSource > > <http://sonarsource.com/>http://sonarsource.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 > - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Is there a way to remove "INFO org.apache.fop.apps.FOUserAgent - Rendered page XXX" logs ?
If you run FOP from a Java application you can use http://xmlgraphics.apache.org/fop/2.1/events.html to register an EventListener which allows you to suppress this event. The event ID for the "Rendered page #*" event is: org.apache.fop.render.RendererEventProducer.endPage HTH Jeremias Maerki On 29.04.2016 13:18:50 Julien Lancelot wrote: > Thanks guys, I was hoping that their was another way, but it's ok, I'll > update the configuration of the logger. > > Regards, > Julien Lancelot > > On Fri, 29 Apr 2016 at 12:21 Chris Bowditch <bowditch_ch...@hotmail.com> > wrote: > > You should be able to configure Commons logger to only output Warnings > > and higher and ignore INFO messages > > > > Chris > > > > On 28/04/2016 15:02, Julien Lancelot wrote: > > > Hi, > > > > > > I'm using FOP 2.1, and when I generate a PDF, I can see the following > > > logs in my console : > > > > > > 15:52:59.057 INFO org.apache.fop.apps.FOUserAgent - Rendered page #1. > > > 15:52:59.140 INFO org.apache.fop.apps.FOUserAgent - Rendered page #2. > > > 15:52:59.155 INFO org.apache.fop.apps.FOUserAgent - Rendered page #3. > > > 15:52:59.159 INFO org.apache.fop.apps.FOUserAgent - Rendered page #4. > > > 15:52:59.853 INFO org.apache.fop.apps.FOUserAgent - Rendered page #1. > > > 15:52:59.890 INFO org.apache.fop.apps.FOUserAgent - Rendered page #2. > > > 15:52:59.900 INFO org.apache.fop.apps.FOUserAgent - Rendered page #3. > > > > > > Is there a way to not generate this logs ? > > > > > > Thanks ! > > > -- > > > Julien LANCELOT |SonarSource > > > http://sonarsource.com <http://sonarsource.com/> > > > > > > > > - > > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > > > -- > > Julien LANCELOT | SonarSource > <http://sonarsource.com/>http://sonarsource.com > > > - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Fail hard on missing images
See http://xmlgraphics.apache.org/fop/2.1/events.html for an example of exactly that. HTH Jeremias Maerki On 12.05.2016 23:12:22 Oskar Berggren wrote: > Hi, > > > Sometimes a document will reference an image that FOP is unable to find. With > FOP 2.0, it will print a SEVERE log and then continue processing the file, > eventually exiting with a regular zero exit code. > > > Because there may be a significant amount of other logs, and because this FOP > was invoked from a makefile that renders a bunch of documents, it's easy to > miss the log about the missing image. And because FOP appears to not use a > non-zero exit code, the make command will also not complain. > > > How can I make FOP scream louder on missing images (and perhaps also other > errors)? It could complete processing the file, but crucially I would like it > to exit with a non-zero exit code so that make will stop with an error > message. > > > > /Oskar > > - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Fw: Re: Quality of included image degrades when png rendering is used
Dropped from the moderation queue: --- Original Message --- From:rushabh rushabh.ajm...@igate.com Date:Mon, 4 Aug 2014 02:52:00 -0700 (PDT) Subject: Re: Quality of included image degrades when png rendering is used Hey it works now .. I have changed FOP.xml file . below lines are added image-loading penalty value=-1 class=org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawPNG/ penalty value=INFINITE class=org.apache.xmlgraphics.image.loader.impl.ImageLoaderPNG/ penalty value=INFINITE class=org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO/ /image-loading -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Quality-of-included-image-degrades-when-png-rendering-is-used-tp5702p41008.html Sent from the FOP - Users mailing list archive at Nabble.com. - Original Message Ends ---BeginMessage--- Hey it works now .. I have changed FOP.xml file . below lines are added image-loading penalty value=-1 class=org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawPNG/ penalty value=INFINITE class=org.apache.xmlgraphics.image.loader.impl.ImageLoaderPNG/ penalty value=INFINITE class=org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO/ /image-loading -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Quality-of-included-image-degrades-when-png-rendering-is-used-tp5702p41008.html Sent from the FOP - Users mailing list archive at Nabble.com. ---End Message--- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop-pdf-images
To be precise: this is the location for development snapshots, and not official releases. Jeremias Maerki On 14.11.2012 00:51:12 Luis Bernardo wrote: The new location for the fop-pdf-images plugin is https://dist.apache.org/repos/dist/dev/xmlgraphics/. Since the new website is in the process of going live this information will be added to it after that happens. On 10/31/12 12:05 AM, Luis Bernardo wrote: The new fop-pdf-images plugin is available here: https://www.apache.org/dist/xmlgraphics/fop-pdf-images/. I expect to add this information to the website soon. On 10/30/12 6:31 AM, Martin Edge wrote: Cool thanks I have a work around for now *From:*Glenn Adams [mailto:gl...@skynav.com] *Sent:* Tuesday, 30 October 2012 5:09 PM *To:* fop-users@xmlgraphics.apache.org; martin.e...@intellimail.com.au *Subject:* Re: fop-pdf-images Luis Bernardo is in the process of creating a new PDF images plugin that will interoperate with FOP 1.1, so please be patient (of course you are free to build yourself, if you can't wait). On Tue, Oct 30, 2012 at 2:29 AM, Martin Edge martin.e...@intellimail.com.au mailto:martin.e...@intellimail.com.au wrote: Hi, I downloaded FOP 1.1 and also downloaded the latest PDF-images plugin (2.0.0 and 2.0.1), here is the error I get ; Could not convert FO to PDF: Exception in thread main java.lang.VerifyError: (class: org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter, method: cloneForNewDocument signature: (Ljava/lang/Object;Ljava/lang/Object;Ljava/util/Collection;)Ljava/lang/Object;) Incompatible argument to function at org.apache.fop.render.pdf.pdfbox.AbstractPDFBoxHandler.createFormForPDF(AbstractPDFBoxHandler.java:90) at org.apache.fop.render.pdf.pdfbox.PDFBoxImageHandler.handleImage(PDFBoxImageHandler.java:57) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:228) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:184) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:149) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingURI(AbstractIFPainter.java:271) at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:150) at org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1272) at org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1259) at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:816) at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:785) at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:866) at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:678) at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:913) at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:643) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:561) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:598) at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:980) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:546) at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:710) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:585) at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:980) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:546) at org.apache.fop.render.intermediate.IFRenderer.renderBlockViewport(IFRenderer.java:816) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:578) at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:980) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:546) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:598) at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:980) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:546) at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:451) at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:738) at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:428) at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:352) at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:299
Re: Cell border rendering error (thicker) with number-column-spanned
Hi Reeve, the reason for the change was to support line styles other than solid, dashed and dotted and the collapsing border model on tables. 0.20.5 painted simple lines, resulting in rectangles that effectively overlapped (potentially producing ugly side-effects themselves). During the redesign this was changed to using clip paths to cut the lines to the exact shape that we need. Notes at [1] show why the current model was chosen. Over time, it has come up a number of times (this isn't the first time) that anti-aliassing features in various PDF viewers cause suboptimal results (on screen only, NEVER in print because there is no anti-aliassing there) with FOP's current approach. To fix the problem and still preserve the current feature-richness, there will need to be improvements on the way borders are painted, but they will not be easy to implement: The painting of the border grid of a table has to be changed to group the painting of border segments together. The IFRenderer would have to be extended with an optimizer of some sorts that can try (!) to combine the various grid segments to larger combined structures, ex. longer lines of the same color. That may even have an influence on the structure of the area tree. There's also a relationship to the z-index feature (grouping, buffering and ordering of painting operations). Different line thicknesses may effectively get in the way of that optimization. Ideally, a table with a simple black grid would be painted with just the minimal set of lines (without clip paths). That would basically guarantee no side-effects. But that is only possible for the simple cases. More complex cases require the tricks we use here to paint the border segments and that may easily lead to the unwanted visual artifacts we're seeing today. So, I don't think there is a silver bullet. There's room for optimization but not without an influence on the code complexity. And all that just because some PDF viewers produce different results for two lines with the same thickness. OTOH, it has the potential to produce slightly smaller output files. Anti-aliassing's a bitch that's great for text but only produces issues with vector graphics. I do remember extensive discussions on border painting during 2003/2004 that effectively showed the complexity of getting border painting right. [1] http://wiki.apache.org/xmlgraphics-fop/CollapsingBorderModel Jeremias Maerki On 04.11.2012 05:16:10 reevev wrote: Hi, Thanks for providing the sample. I agree that this illustrates that the various PDF viewers are not doing the right thing with the line thickness and I'm not disagreeing with this point. However the fact remains that fop 0.20.5 output the borders in a method that the PDF viewers displayed correctly and newer versions of fop don't produce the desired output. By changing to fop 1.0 (or 1.1) we now are seeing output that isn't rendered correctly in the industry standard PDF viewer, as well as other common PDF viewers, and this is why I say the bug is with FOP. It may be technically correct output, but if it isn't displayed correctly anywhere it is besides the point. Is there somewhere I can find out more on why the border rendering was changed? I'm guessing there was a reason it was changed. If I wanted to change the source so it rendered the old way it would probably create different issues that I'm not aware of. Thanks, Reeve. -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37244.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: fop, camel-fop and Apache Karaf
Hi Maruan, yes, that's about it. You could combine XGC, Batik and FOP to one OSGi bundle (if you're careful about merging all META-INF/services files) and just add OSGi metadata. That could avoid the plug-in detection problems. But it's not a real solution. I simply have to finish my work and publish it. You can only do some nagging about 3 weeks or so if you haven't heard anything from me. By then I really need the new approach to be working. Please note that I do the changes on a fork of FOP (post 1.0, pre 1.1). I'm not currently following Trunk due to the backwards-incompatible changes in the public API of FOP. Jeremias Maerki On 22.09.2012 14:29:40 Maruan Sahyoun wrote: Hi Jeremias, thank you for outlining the current situation. If I understood you correctly a) fop won't work without modifications in an OSGI environment and b) there is no quick fix to resolve that. Is that correct? Can we help you in your efforts? With kind regards Maruan Am 22.09.2012 um 13:35 schrieb Jeremias Maerki: Hi, I've been running FOP in Felix for about 3 years now, although I haven't had time to polish and publish the necessary adjustments. The problem is that the META-INF/services-based plug-in lookup approach doesn't work well with OSGi. I've recently migrated my first (flawed) approach [1] to a new one which is using Apache Aries SPIFly for plug-in detection and publication and I've rewritten my service discovery abstraction to leverage that. I've been in contact [2] with the Aries team to donate that last part but so far it's still waiting for a review. If it takes much longer I'll publish it myself. Publishing the necessary adjustments for XGC, Batik and FOP are a different story. I hope I'll find time at some point. The refactoring is still work in progress. [1] http://www.jeremias-maerki.ch/development/osgi/jar-services.html [2] http://aries.markmail.org/thread/qsfxgj2mkw5zybiu Jeremias Maerki On 20.09.2012 09:40:02 Maruan Sahyoun wrote: Hi there, we are trying to use fop, as part of camel-fop, inside an OSGI container Apache Karaf. Using fop (1.1) and camel-fop (2.10) works just fine. But as soon as we are trying to use that from within Apache Karaf (we are using the fop ServiceMix bundles) there seems to be an issue with fop finding it's renderers as we got the following error message java.lang.UnsupportedOperationException: Don't know how to handle application/pdf as an output format. Neither an FOEventHandler, nor a Renderer could be found for this output format. at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:361)[72:org.apache.servicemix.bundles.fop:1.0.0.2] I looked through a number of posts related to OSGI and fop but at that point in time I'm not sure about the current state if it should be possible to run fop inside an OSGI container or not. Has someone managed to get a similar configuration to work? Has someone got fop working inside on OSGI container (ideally Apapche Felix, Apache Karaf or Apache ServiceMix)? Thank's in advance for any hints. Maruan Sahyoun - 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: fop, camel-fop and Apache Karaf
Hi, I've been running FOP in Felix for about 3 years now, although I haven't had time to polish and publish the necessary adjustments. The problem is that the META-INF/services-based plug-in lookup approach doesn't work well with OSGi. I've recently migrated my first (flawed) approach [1] to a new one which is using Apache Aries SPIFly for plug-in detection and publication and I've rewritten my service discovery abstraction to leverage that. I've been in contact [2] with the Aries team to donate that last part but so far it's still waiting for a review. If it takes much longer I'll publish it myself. Publishing the necessary adjustments for XGC, Batik and FOP are a different story. I hope I'll find time at some point. The refactoring is still work in progress. [1] http://www.jeremias-maerki.ch/development/osgi/jar-services.html [2] http://aries.markmail.org/thread/qsfxgj2mkw5zybiu Jeremias Maerki On 20.09.2012 09:40:02 Maruan Sahyoun wrote: Hi there, we are trying to use fop, as part of camel-fop, inside an OSGI container Apache Karaf. Using fop (1.1) and camel-fop (2.10) works just fine. But as soon as we are trying to use that from within Apache Karaf (we are using the fop ServiceMix bundles) there seems to be an issue with fop finding it's renderers as we got the following error message java.lang.UnsupportedOperationException: Don't know how to handle application/pdf as an output format. Neither an FOEventHandler, nor a Renderer could be found for this output format. at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:361)[72:org.apache.servicemix.bundles.fop:1.0.0.2] I looked through a number of posts related to OSGI and fop but at that point in time I'm not sure about the current state if it should be possible to run fop inside an OSGI container or not. Has someone managed to get a similar configuration to work? Has someone got fop working inside on OSGI container (ideally Apapche Felix, Apache Karaf or Apache ServiceMix)? Thank's in advance for any hints. Maruan Sahyoun - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Upgrade to fop trunk and URI resolving
Hi Mehdi, that adapter is the beginning of that convenience adapter I was talking about. But there are a few issues with it (without having tried to run the code): - a StreamSource does not always have an InputStream. Apache XML Commons Resolver usually returns a StreamSource with just the resolved URL set as the system ID if I remember correctly. The URL has to be opened via java.net.URL. - SAXSource will also need to be handled aside from DOMSource. - a Source cannot be a StreamResult, so you can't use URIResolver for URLs that will be written to. URIResolver is strictly on the reading side. - TransformerExceptions should probably be re-thrown as IOException(WithCause) rather than RuntimeException. At any rate, I'd like to point you to http://wiki.apache.org/xmlgraphics-fop/HowTo/XmlCommonsResolver which contains a working example for using XML catalogs with FOP. I believe that this is something that more than a handful of people are using in production so it would be great if this functionality remains available, even if it's just through that URIResolverAdapter. The performance loss with DOMSource/SAXSource, I can probably stomach, but I'm only speaking for myself. But I beg you not to replace URIResolver by ResourceResolver in the XGC Image Loading Framework. If your goal is to better control where files are written by FOP, that's one thing, or not wanting to deal with StreamSource's many accessors when just loading a font which always requires an InputStream, that's another. But URIResolver is just more powerful when it comes to provide read-access to resources that may be a byte stream, character stream, XML DOM, SAX event source like is the case with images. Thanks, Jeremias Maerki On 30.07.2012 13:02:41 mehdi houshmand wrote: Jeremias, I was looking into this, and it became abundantly clear that I don't really know what you're trying to do with the java.xml.transform.URIResolver... Would something like this be appropriate as an adapter between the two interfaces? (The exception handling is pretty slap-dash). I don't have a great deal of experience with these XML libraries other than the fairly basic use-cases. I appreciate that the DOMSource serialization would be performance costly, but we already knew that... Mehdi On 30 July 2012 08:52, mehdi houshmand med1...@gmail.com wrote: Hi Jeremias, I'm sorry for the slow response, I will look at this when I get the chance to do so and get back to you. I would like to come to some sort of compromise on this, one where we're both happy with the acquisition of resources. Failing that, at least come to an agreement where neither of us are particularly happy but begrudgingly accept with a healthy amount of resentment ;) Mehdi On 26 July 2012 22:31, Jeremias Maerki d...@jeremias-maerki.ch wrote: (responded on fop-dev) Jeremias Maerki On 26.07.2012 20:17:17 mehdi houshmand wrote: I appreciate that there are inconveniences, but if you're just looking for backwards compatibility, the changes should be, for the most part, fairly minor. I'm sorry we haven't been able to convince you of the benefits of the changes, that's on me as the lead on this. I'm not sure really what else I can do to convince you, if you have specific concerns that we could address then I'd be happy to see if we can come to some sort of compromise. You talk about a java.xml.transform.URIResolver interface, are there any other things you'd like to see? On 26 July 2012 17:15, Jeremias Maerki d...@jeremias-maerki.ch wrote: That's not quite true. That worked perfectly before by setting your own JAXP URIResolver. You could even resolve a URI to a DOMSource (or SAXSource) containing an SVG image that you've dynamically built based on some data (think charts). With the new approach, you have to serialize that XML to a stream (buffered in memory or on disk) which costs performance. Not a very common use case, I know, but we're talking possibilities that are going away with the API changes. Previously, you could use Apache XML Commons Resolver for XML catalog functionality. Now you probably have to write an adapter from URIResolver to ResourceResolver (haven't had time to try that, yet). A convenience adapter is missing. Jeremias Maerki On 25.07.2012 22:25:52 Matthias Reischenbacher wrote: snip/ Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! snip/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h
Re: Upgrade to fop trunk and URI resolving
That's not quite true. That worked perfectly before by setting your own JAXP URIResolver. You could even resolve a URI to a DOMSource (or SAXSource) containing an SVG image that you've dynamically built based on some data (think charts). With the new approach, you have to serialize that XML to a stream (buffered in memory or on disk) which costs performance. Not a very common use case, I know, but we're talking possibilities that are going away with the API changes. Previously, you could use Apache XML Commons Resolver for XML catalog functionality. Now you probably have to write an adapter from URIResolver to ResourceResolver (haven't had time to try that, yet). A convenience adapter is missing. Jeremias Maerki On 25.07.2012 22:25:52 Matthias Reischenbacher wrote: snip/ Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! snip/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Upgrade to fop trunk and URI resolving
(responded on fop-dev) Jeremias Maerki On 26.07.2012 20:17:17 mehdi houshmand wrote: I appreciate that there are inconveniences, but if you're just looking for backwards compatibility, the changes should be, for the most part, fairly minor. I'm sorry we haven't been able to convince you of the benefits of the changes, that's on me as the lead on this. I'm not sure really what else I can do to convince you, if you have specific concerns that we could address then I'd be happy to see if we can come to some sort of compromise. You talk about a java.xml.transform.URIResolver interface, are there any other things you'd like to see? On 26 July 2012 17:15, Jeremias Maerki d...@jeremias-maerki.ch wrote: That's not quite true. That worked perfectly before by setting your own JAXP URIResolver. You could even resolve a URI to a DOMSource (or SAXSource) containing an SVG image that you've dynamically built based on some data (think charts). With the new approach, you have to serialize that XML to a stream (buffered in memory or on disk) which costs performance. Not a very common use case, I know, but we're talking possibilities that are going away with the API changes. Previously, you could use Apache XML Commons Resolver for XML catalog functionality. Now you probably have to write an adapter from URIResolver to ResourceResolver (haven't had time to try that, yet). A convenience adapter is missing. Jeremias Maerki On 25.07.2012 22:25:52 Matthias Reischenbacher wrote: snip/ Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! snip/ - 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: SubstituteFonts true/false propertie in fop config ?
Actually, there is but it's not obvious: http://xmlgraphics.apache.org/fop/latest/events.html lets you propagate these replacement events to aborting exceptions. One point of the events framework is to give more fine-grained control over certain conditions inside FOP. Jeremias Maerki On 22.06.2012 15:58:45 Robert Meyer wrote: Hi, After reading the documentation and looking in the code, it would appear as you say that there is currently no facility to provide the option to fail if a font is not present. I would therefore recommend you log a new Fop issue on bugzilla [1] so that should someone have time in the future, they can implement it. [1] https://issues.apache.org/bugzilla/ Best Regards, Robert Meyer From: christian.pes...@orange.fr To: fop-users@xmlgraphics.apache.org Subject: SubstituteFonts true/false propertie in fop config ? Date: Fri, 22 Jun 2012 14:58:43 +0200 Hi, We use Fop on a workstation to design and view pdf document (after Fop transform) After that, documents are rendered on a production server. Sometimes, the production server dont contain fonts necessary for theses documents and Fop subtitute missing fonts. Maybe SubstituteFonts true/false propertie in fop config would be useful to failed the fo2pdf transformation instead subtitute font ? Christian Pestel christian.pes...@orange.fr - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: JFreeChart does not display the data
Hi Jing, PDFGraphics2D is not a complete implementation of the Graphics2D interface. There are a few gaps. Maybe JFreeChart uses one of these missing features. There could also be a bug. I suggest you set a few break points in PDFGraphics2D (you'll see which methods are empty). Another thing you can do is generate a TIFF instead of a PDF with FOP. If the full chart is rendered to TIFF, you'll know that your own glue code really works and there is probably an incompatibility with PDFGraphics2D. If it doesn't work, it's not PDFGraphics2D. HTH On 21.09.2011 16:05:27 Li, Jing wrote: Jeremias, I cc you, hope I can get some advice from you, since you have a lot of experience about the custom image loaders. My project needs create a lot of images and charts on the fly and put them in a pdf report in the end. I took your advice last time (See image loading callback back in July), wrote the preloader, loader and loader factory for both BufferedImage and JFreeChart using fop 1.0. The BufferedImage one works out nicely, the images display fine, the same as what is in Swing Panel. But when I took the same approach for the charts, JFreeChart does not show the content curves, while the same code put in a Swing panel display fine. I suspect there are bugs in fop that prevent it displaying, but could not figure how to fix it. Your insight will be highly appreciated. The line in xsl-fo related to it is: fo:block fo:external-graphic src=url('chart/cwf/') content-width=300pt / /fo:block Environment: Window 7, fop 1.0, Java 6. There is no any error message in the trace, the customer preloader and loader all gets called, everything runs fine, except when you open the generated pdf, it show the error message, and the content curve is missing. I tried to preflight the pdf, there is no error observed either. Thanks Jing -Original Message- From: Pascal Sancho [mailto:pascal.san...@takoma.fr] Sent: Wednesday, September 21, 2011 2:50 AM To: fop-users@xmlgraphics.apache.org Subject: Re: JFreeChart does not display the data Reading back the properties of your attached PDF, I realize that it is made with FOP 1.0 and it is buggy when reading it. So, I apologize for my too quick preceding answer. Anyway, you should give further information: - short XSL-FO that demonstrates the issue - trace or log, if any - environment, process, etc. Le 21/09/2011 08:43, Pascal Sancho a écrit : Hi Jing, I suspect you ask on wrong list, no? IIUC, I see nothing to do with FOP in your question. Le 20/09/2011 18:06, Li, Jing a écrit : Dear All, I am working on a project that generates a lot of JFreecharts on fly and put them in a PDF report. I wrote a preloader, loader and source, and for unknown reason, the chart only shows the coordinates, legends, etc, but NO DATA curves. See the attachment. I feel confused, any help or suggestions will be highly appreciated. Thanks Jing -- Pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: font substitution
Looks fine to me. See also: http://xmlgraphics.apache.org/fop/1.0/fonts.html#substitution Instead of the two substitutions, I think you should be able to say it in one: substitution from font-family=Helvetica/ to font-family=FreeSans/ /substitution But if I guess correctly, you ran into some kind of problem. Note that the default FOP font-family is sans-serif,Symbol,ZapfDingbats, so if your idea is to map from the default font to FreeSans, you'll have to use sans-serif, not Helvetica. On 20.09.2011 20:20:59 Rob Sargent wrote: Is this not the correct approach for font substitution? fop version=1.0 !-- Base URL for resolving relative URLs -- base./base font-base./font-base fonts substitutions substitution from font-family=Helvetica font-weight=normal font-style=normal/ to font-family=FreeSans font-weight=normal font-style=normal/ /substitution substitution from font-family=Helvetica font-weight=bold font-style=normal/ to font-family=FreeSans font-weight=bold font-style=normal/ /substitution /substitutions /fonts 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
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
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
Re: Outputting intrinsic dimension info of images
Erik, you can preload the image using the XML Graphics Commons image loading framework (which FOP uses, too): http://xmlgraphics.apache.org/commons/image-loader.html#preloading The ImageInfo object will then contain the intrinsic size. You can use the ImageManager from the FopFactory and probably re-use the ImageSessionContext from the FOUserAgent: ImageManager imageManager = fopFactory.getImageManager(); ImageSessionContext imageSessionContext = foUserAgent.getImageSessionContext(); This allows you to profit from the image cache. What you do with the values and where exactly you want to write it in the PDF is a different question. I don't know what you have in mind here. Do you want to print the values on the page along with the image? Sounds like an XSLT extension then. On 26.07.2011 18:42:15 Erik Wiklander wrote: Hi, I'm using fo:external-graphic to include images in the pdf. Is there any way that I can find out the intrinsic width and height of an image? So that I can include that information in the resulting pdf. Thanks //Erik Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Outputting intrinsic dimension info of images
(resolved.toASCIIString()); } return src; } } catch (TransformerException te) { try { context.getErrorListener().warning(te); } catch (TransformerException e) { //ignore } return null; //Fail } } }; ImageInfo info = imageManager.getImageInfo(uri, sessionContext); return toNode(info); } private static Node toNode(ImageInfo info) throws ParserConfigurationException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(false); dbf.setValidating(false); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.newDocument(); Element imageInfo = doc.createElement(image-info); doc.appendChild(imageInfo); imageInfo.setAttribute(uri, info.getOriginalURI()); imageInfo.setAttribute(format, info.getMimeType()); Element imageSize = doc.createElement(size); imageInfo.appendChild(imageSize); ImageSize size = info.getSize(); imageSize.setAttribute(width-mpt, Integer.toString(size.getWidthMpt())); imageSize.setAttribute(height-mpt, Integer.toString(size.getHeightMpt())); imageSize.setAttribute(width-px, Integer.toString(size.getWidthPx())); imageSize.setAttribute(height-px, Integer.toString(size.getHeightPx())); imageSize.setAttribute(resolution-horz, Double.toString(size.getDpiHorizontal())); imageSize.setAttribute(resolution-vert, Double.toString(size.getDpiVertical())); return imageInfo; } private static ImageManager getImageManager() { ImageManager imageManager = null; if (imageManagerRef != null) { imageManager = imageManagerRef.get(); } if (imageManager == null) { imageManager = new ImageManager(new DefaultImageContext()); imageManagerRef = new SoftReferenceImageManager(imageManager); } return imageManager; } } Integration in the stylesheet: xmlns:img=packagename for extension.ImageExtension exclude-result-prefixes=img t:variable name=image-info select=img:image-info({@href})/ XPath to access the width: $image-info/size/@width-mpt More info: http://xml.apache.org/xalan-j/extensions.html On 26.07.2011 20:50:09 Erik Wiklander wrote: Ok, thanks for the reply! This is the background to my question: I'm working on an application where we have an image markup tool that lets the user put a message somewhere on the image. The message is stored together with the coordinates of where on the image it is placed. Now, when we run the report, I want the message to be displayed on top of the image in the correct place. I want this to work even if the picture has been scaled down to fit the paper. To place the text on the correct place, I have to compare the intrinsic dimensions of the image with the fixed dimensions of the image in the report, to correctly place the message on top. I currently have a working solution for this, but it is not very good from a performance perspective: Before running the report I download the image and get the dimensions using Sanselan and I send these dimensions to the report. If I could profit from the image cache, that would of course be great. But I'm not really sure how I could write my own extension to do this. Another solution to my problem would be if I somehow could find out by how much the image was scaled. Is that possible to find out? (In a simple way :) -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Tuesday, July 26, 2011 1:09 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Outputting intrinsic dimension info of images Erik, you can preload the image using the XML Graphics Commons image loading framework (which FOP uses, too): http://xmlgraphics.apache.org/commons/image-loader.html#preloading The ImageInfo object will then contain the intrinsic size. You can use the ImageManager from the FopFactory and probably re-use the ImageSessionContext from the FOUserAgent: ImageManager imageManager = fopFactory.getImageManager(); ImageSessionContext imageSessionContext = foUserAgent.getImageSessionContext(); This allows you to profit from the image cache. What you do with the values and where exactly you want to write it in the PDF is a different question. I don't know what you have in mind here. Do you want to print the values on the page along with the image? Sounds like an XSLT extension then. On 26.07.2011 18:42:15 Erik Wiklander wrote: Hi, I'm using fo:external-graphic to include images in the pdf. Is there any way that I can find out the intrinsic width and height of an image? So that I can include
Re: image loading callback
Hi Jing How you approach that depends a bit on what information you need to pass from FO to your image generator. If you can fit everything in an URI (fo:external-graphic), then you could do this: - Subclass javax.xml.transform.Source and provide a BufferedImage through it. - Write a URI resolver that turns the URI into such an BufferedImageSource. - Then you'll need an ImagePreloader that works on that BufferedImageSource. - Finally, an ImageLoader will wrap the BufferedImage in an ImageBuffered instance which FOP then can consume. Details for the image loading framework are found here: http://xmlgraphics.apache.org/commons/image-loader.html I know that sounds quite complicated but at least this would be something that could even be placed in XML Graphics Commons in case someone wants to do something similar. The easier approach is to just encode the BufferedImage into a PNG in the URIResolver and return a StreamSource. That doesn't require messing with the image loader framework but you also lose performance because the PNG has to be encoded and re-parsed immediately after that. If, OTOH, you have some XML content that you turn into a BufferedImage (fo:instream-foreign-object), an ImageConverter (also from the image loading frameworker) and again an ImagePreloader should do the trick to convert your XML-Format to an ImageGraphics2D or ImageBuffered. The ImagePreloader is mostly needed to establish the natural size of the image. A note on ImageGraphics2D: if you actually paint the image using Java2D/Graphics2D, you might want to consider not directly creating a BufferedImage but an ImageGraphics2D because that would allow you to retain a vector graphic image which can look much nicer in a PDF than a bitmap image. The image loader framework automatically converts a Java2D image to a bitmap if the consumer doesn't support vector graphics. Examples for plug-ins for the image loading framework can be found in the following places: Barcode4J, JEuclid and my PDF plug-in for FOP. HTH On 12.07.2011 20:03:06 Li, Jing wrote: Dear All, Recently I am searching an answer about the callback mechanism when loading images. I am working on a project that creates a report as PDF format, using xml + xml-fo. I am thinking Apache FOP might be a way to go. But I have hard time to find the callback mechanism. In my report, I have a lot of charts and images that created as BufferedImage on the fly that need to put in the pdf file. They are not static image files, read via io. Ideally I can wrote customize image reader that I can plug-in to FOP, and use customize URIResovler to invoke it? Anyone can help me point to the right direction? Thank you in advance. Jing Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: pdftops eps font issue
- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: pdftops eps font issue
- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/pdftops-eps-font-issue-tp32014501p32021588.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: pdftops eps font issue
On 08.07.2011 13:20:55 Alberto Priore wrote: I've already tried to create from FOP the .pd file, but FOP has limitations http://xmlgraphics.apache.org/fop/1.0/output.html#ps-limitations - Only Type 1 fonts are supported. I was not able to include .pmf fonts I'm not aware of any font format called pmf. Do you mean .pfm? .pfm is on part of a Type 1 font. - Multibyte characters are not supported. If I write a à è ì ò it will not showed on .ps file, I need to show that charachter. If you properly configure a Type 1 font that has those characters they will be supported in PS output. TrueType support is in the making and available for review in a branch. Do you know an alternative of FOP to create an eps from xsl-fo? Michael Rubin-3 wrote: Looking at the other posts on this thread too, the suggestion of other formats from FOP was raised. I found this page: http://www.inkguides.com/ps-to-eps.asp So can you not use FOP to generate a Postscript file instead of a PDF which sounds easier to convert to EPS? Also I googled 'ps to eps' and it threw up a few potential converters including a GNU perl based tool and others. Thanks. -Mike On 08/07/11 10:55, Alberto Priore wrote: Hi Mike, I need to convert it to EPS, this is a necessary point. I've tried all the way to translate a pdf to eps passing through an image and so on... But all lose quality, they all rasterize the pdf. Now I'm using Apache FOP that could create other output formats http://xmlgraphics.apache.org/fop/0.95/output.html but I don't know if the other format could be convert to eps. With this other information can you suggest me something? Alberto Michael Rubin-3 wrote: ?A quick look online (I googled 'pdf to eps') reveals a number of potential solutions. But forum link http://www.oooforum.org/forum/viewtopic.phtml?t=59787 was interesting in that is sounds as if there is no absolutely perfect solution. Some convert to bitmap so lose quality, while others have various other problems. One suggestion even suggested rebuilding the pdf in eps format from scratch (I suspect that is unacceptable!). I do quote from that forum link though: EPS is another Adobe-proprietary file format, specifically belonging to Illustrator but Photoshop can create and work with some form of it. Here's my question: what are you trying to accomplish in this conversion? Is it necessary to convert the file to EPS, or is that mainly a file format you're most familiar with? Thanks. -Mike On 07/07/11 17:05, Alberto Priore wrote: I'm creating a pdf with Apache FOP in Linux then I need to convert the pdf it into an eps. I'm trying lot of ways, the only one that seems works is the pdftops. But, when I convert it into Linux in command line pdftops file.pdf -eps file.eps This command creates me the eps but when I try to open it in Adobe Illustrator in Windows XP It returns me the error EAAFD+HelveticaNeueLTStd-MdCnO_99-Identify-H; Font not found on the system; missing font has been substituted. But 1: the fonts han not been substituted 2: the eps do not show words inside it is all blank instead of the images I'm sure that in Windows XP I have all the fonts becouse if I convert the pdf to an eps inside the Adobe Illustrator all works fine and Adobe Illustrator do not show me the fonts issue. Can you help me? What I'm doing wrong? Michael Rubin Developer T: +44 20 8238 7400 F: +44 20 8238 7401 mru...@thunderhead.com The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. - 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 -- View this message in context: http://old.nabble.com/pdftops-eps-font-issue-tp32014501p32020686.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h
Re: Manually Configuring a PDFRenderer
On 06.07.2011 05:17:54 Brandon Youkstetter wrote: I put together a service that uses FOP to render PDF using FOP 1.0 on java 6. All worked perfectly when running in eclipse on my development environment. However, my requirements are for this service to run in a webMethods (8.2) IDE workflow (also runs on Java 6). I setup the java service in webMethods placing the required libraries into directory that is loaded by the webMethods classloaders, but immediately ran into the following exception: java.lang.UnsupportedOperationException: Don't know how to handle application/pdf as an output format. Neither an FOEventHandler, nor a Renderer could be found for this output format. My guess is this problem stems from a failure to read the /META-INF/services/ properties files due to the way the webMethods classloaders are loading things up (please let me know if this assumption seems faulty). No, that is the most likely explanation. After searching through the mailing lists, I found a thread that seemed to discuss a similar issue. The submitter was having difficulty in lotus notes. This thread described a solution for manually configuring the PDFRenderer which I followed. Specifically, I configured my fop factory with all the element mappings found in /META-INF/services/org.apache.fop.fo.ElementMapping like so: fopFactory = FopFactory.newInstance(); fopFactory.addElementMapping(new FOElementMapping()); fopFactory.addElementMapping(new SVGElementMapping()); fopFactory.addElementMapping(new BatikExtensionElementMapping()); fopFactory.addElementMapping(new ExtensionElementMapping()); fopFactory.addElementMapping(new InternalElementMapping()); fopFactory.addElementMapping(new OldExtensionElementMapping()); fopFactory.addElementMapping(new XMPElementMapping()); fopFactory.addElementMapping(new RDFElementMapping()); fopFactory.addElementMapping(new PSExtensionElementMapping()); fopFactory.addElementMapping(new AFPElementMapping()); fopFactory.addElementMapping(new PCLElementMapping()); Well, that's just one of the extension points. With that alone, you don't have: the Renderers, the IFDocumentHandlers, the FOEventHandlers, the ImageHandlers, the ContentHandlerFactories, etc. etc. And these are only the extension points in FOP, not the ones in XML Graphics Commons. This work-around may work if you somehow need to integrate a single plug-in in some specific way, but that is just an awkward process. I recommend to try and find a way to make the normal mechanism work. After all, it's a standard mechanism of Java which should work in a traditional hierarchical class loader setup. It quickly fails in an OSGi environment where you have more of a network-oriented setup. Maybe webMethods does something similar. I have no idea. Then I created a user agent to overwrite the Renderer like this: FOUserAgent ua = factory.newFOUserAgent(); PDFRenderer pdfRenderer = new PDFRenderer(); pdfRenderer.setUserAgent(ua); ua.setRendererOverride(pdfRenderer); fop = factory.newFop(MimeConstants.MIME_PDF, ua, output); This setup got me past the UnsupportedOperationException in the RendererFactory and produced a result. However, the output is a 15 byte, seemingly invalid result which Ive attached. It would help if you gave a little more information (stack trace) on the UnsupportedOperationException. From the attached PDF, I can tell that the PDFRenderer started working but then probably got interrupted by an exception, probably that UnsupportedOperationException. What am I missing? Why am I getting this strange result? Any help would be greatly appreciated. A quick search reveals a document on webMethods class loaders: http://communities.softwareag.com/ecosystem/communities/public/Developer/webmethods/downloads/ESBandIntegration/ISClassLoading Maybe that helps you set up everything correctly. The FOP, Batik and XML Graphics Commons JAR should all be setup so they are loaded by the same class loader. The Services class in XML Graphics Commons can only to see the JARs in the same class loader or in any of the parent/ancestor class loaders. In the worst case, you have to think about setting up your own class loader. You could get some inspiration for that from here: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/Main.java?view=markup HTH Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Central European characters in PDF with Base14 fonts
/WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.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 -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31911981.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 -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31915041.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP Transform log?
Hi Eric On 21.06.2011 22:58:02 Eric Douglas wrote: Where does FOP log? To Apache Commons Logging and to FOP's own event framework. You can find all about it here: http://xmlgraphics.apache.org/fop/1.0/embedding.html#basic-logging I ran a transform to create a PDF using FOP and it didn't come out right. It appears the output didn't recognize the font properly, it's missing a glyph, but I didn't see any errors/warnings. I'm running within Eclipse. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Performance Analysis
Well, I did write FIOY in the README, so just a few tips so you can FIOY: - Set debug=true on the javac tasks. That gives you line numbers in the stacktrace and will point you right to the line where the NPE happens. - Or set up the project in your favourite IDE and set an exception breakpoint for NullPointerException. Since I don't see any line numbers in the stack trace right now, I can only guess. FopReadme.java is not that big and the only place where an NPE can happen is at line 34 with the Class.getResource() call. That would indicate that ../userconfig-default.xml can't be found in the classpath.. So maybe you forgot to copy a few non-Java files to ${build.dest} On 21.06.2011 10:03:21 polymorphisme wrote: Hello, thank you, Jeremias. For running the test, I have do a file build.xml : ... path id=project-classpath pathelement location=. / pathelement location=${build.dest} / fileset dir=${lib} include name=*.jar/ /fileset /path target name=build copy todir=${build.src} fileset dir=${src}/ /copy javac srcdir=${build.src} destdir=${build.dest} optimize=on deprecation=on classpath refid=project-classpath / /javac /target target name=run depends=build java classname=org.maerki.benchmark.Main fork=yes classpath refid=project-classpath / /java /target ... But the target run return the erreur bellow : [run] [java] BenchmarkRunner starting... [java] java.specification.version: 1.6 [java] java.vm.name: Java HotSpot(TM) Client VM [java] java.vm.vendor: Sun Microsystems Inc. [java] java.vm.version: 14.2-b01 [java] java.lang.NullPointerException [java] at org.maerki.benchmark.examples.fop.readme.FopReadme.init(Unknown Source) [java] at org.maerki.benchmark.BenchmarkRunner.addExampleScenarios(Unknown Source) [java] at org.maerki.benchmark.Main.main(Unknown Source) [java] Java Result: -1 BUILD SUCCESSFUL Total time: 2 seconds I don't know why ! Have you an idee ? Thank at all. polymorphisme wrote: Hello, do you know where I can find the program used for the http://people.apache.org/~jeremias/fop/benchmark-2009-02-13/ Performance Analysis for Apache FOP's new Intermediate Format of Jeremias Märki. Thank. -- View this message in context: http://old.nabble.com/Performance-Analysis-tp31874238p31892115.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Performance Analysis
You can download the sources here: http://www.jeremias-maerki.ch/download/fop/FOP%20Benchmarks.zip Licensed under the ALv2. Please read the README.txt. On 18.06.2011 10:55:15 polymorphisme wrote: Hello, do you know where I can find the program used for the http://people.apache.org/~jeremias/fop/benchmark-2009-02-13/ Performance Analysis for Apache FOP's new Intermediate Format of Jeremias Märki. Thank. -- View this message in context: http://old.nabble.com/Performance-Analysis-tp31874238p31874238.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: problem resolve external image resource with fop
Roby, then don't use the ServletContextURIResolver and instead write your own URIResolver which then can work exactly how you want it. You could define your own classpath: URI scheme. You could copy FOP's ServletContextURIResolver and adjust it to your liking. Then just set your new URIResolver instead of the ServletContextURIResolver using FopFactory.setURIResolver(URIResolver). That allows FOP to find your images the way you want FOP to. HTH On 17.05.2011 09:57:29 Robyp1 wrote: hi, i have a problem using a fop in a web application. First of all, this is not only only a kind a web application but a maven web application with others dependencies like libs or maven module (not web) linked. One kind of this lib/maven module keep the source with embed a fop code for translate xml into pdf using an xsl stylesheet. My problem is that the user request is processed by a servlet. I try to use URIResolver with ServletContext and servlet-context: for accessing external resource in xsl with fo:external-graphic src=servlet-context:path webapp/images/nameGifImage.gif. This is work fine but i prefere that fop access resource without serveletContext but with the ClassLoader without placing images in a context web root. I try to place my images in a application class-path where fop is embed but this not work. Anybody now how can i solve my problem? How can find where fop external resource would be place? Thank you very much Roby -- View this message in context: http://old.nabble.com/problem-resolve-external-image-resource-with-fop-tp31635640p31635640.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: breakpoint suggestions please
Rob, I guess it's easiest if you produce the area tree XML (-at, application/X-fop-areatree) and then retrieve the span elements' bpda values (block-progression-dimension allocated). XPath: /areaTree/pageSequence/pageViewport/page/regionViewport/regionBody/mainReference/span/flow The values returned are in millipoints (1000ths of a point), FOP's internal measurement unit. See also: http://xmlgraphics.apache.org/fop/1.0/intermediate.html#usage On 14.05.2011 00:26:29 Rob Sargent wrote: I'm in fop-1.0 source (thank you all very much) trying to find the last element written to the pdf. Situation: I need to dynamically size static regions such that I can accurately apportion the page. We generate a separate pdf for table(s) then calculate depth of that and use that value to size a region-before. (The two pdfs are then overlayed to generate a single pdf.) History: We have code which works in for fop-0.94 and works to a certain extent in fop-0.95 but I would rather converge our shop on fop-1.0. The 095 implementation does not find stuff below about half the page. Confession: Both implementations are, by the admission of the author, wild-ass guesses of what the content of the pdf-as-byte-array means. Aspirations: Find a definitive answer to the age-old question Where is the text in a pdf? Hoping against hope that I can detect something useful during the fo-pdf transformation that I can look for later in our application. Any suggestions welcome. Thanks. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: problems with generating pdf-file from raster pdf source
Hi Alexey I have no problems with your attached PDF (capusto.pdf). You didn't say what versions of FOP and the plug-in you're using. I've used Apache FOP 1.0 for the test as well as version 2.0 and 2.0.1.SNAPSHOT of the PDF plug-in. On 13.05.2011 21:32:32 Alexey Bobyrev wrote: Hello! I have a problem with generating pdf-file from pdf-source which consists of raster image(s). It generates just blank pdf (example attached) without any error message during generation. If there is just vector image then all goes all right. Here is my fo-structure: *?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:fox= http://xmlgraphics.apache.org/fop/extensions; fo:layout-master-setfo:simple-page-master master-name=Photo page-height=877.5pt page-width=1237.5pt fo:region-body//fo:simple-page-master /fo:layout-master-setfo:page-sequence master-reference=Photo fo:flow flow-name=xsl-region-body fo:block-container absolute-position=absolute left=309pt fox:transform=rotate(0) top=43pt fo:block fo:external-graphic src= /home/sfate/prj/last_odt/public/files/converted_pdf/source.pdf#page=1 content-height=792pt content-width=612pt scaling=non-uniform/ /fo:block /fo:block-container /fo:flow /fo:page-sequence /fo:root* Could you try to generate some pdf from raster pdf? You can try with attached pdf. Or maybe someone have some ideas about it. -- Alexey Bobyrev Software developer, company Sloboda studio, Ukraine Application development for social networks *Site:*http://sloboda-studio.com *Personal Twitter:* http://twitter.com/_sfate *Skype:* sfate_ *ICQ:*366499690 Cell phone +38 093 384 66 81 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Barcode4j / QR
For reference, the feature request @Barcode4J: http://sourceforge.net/tracker/?func=detailaid=2294265group_id=96670atid=615507 On 15.04.2011 14:09:25 Philippe Pithon wrote: Hi, Is QR code supported by Barcode4j for FOP ? http://en.wikipedia.org/wiki/QR_code Regards, Philippe Pithon Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: PDF File content ist not visible
If you're working with JAX-RS, I think you actually left out the critical parts, namely the full request method including the annotations. That makes it difficult to help. I'm pretty sure that the PDF is produced properly, but something goes wrong in the communication between the browser and the server. If you stream the PDF over HTTPS, you might want to take a look at this: http://xmlgraphics.apache.org/fop/trunk/servlets.html#ie What applies to servlet may easily apply to JAX-RS, too. On 14.04.2011 20:33:42 Ralph Soika wrote: Hi, I have a strange problem with FOP PDF creation. In general everything looks fine. But I try to provide REST Service to create pdf files. The result seems to work but the File which is provided by my ResponseBuild consits only of blank pages? Also when I try to write the result into a file the file seems to have the right size and is regogniced as a pdf file but the pages are blank. Has anybody a idea what I did wrong? My JAX-RS Code looks like this.. ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { ReportService.fopTranformation(sXML, sXSL, outputStream.flush(); Response.ResponseBuilder builder = Response.ok(outputStream.toString(encoding), sContentType); } finally { outputStream.close(); return builder.build(); .. .. public static void fopTranformation(String xmlSource, String xslSource, String aEncoding, ByteArrayOutputStream output) throws Exception { // configure fopFactory as desired FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); // configure foUserAgent as desired try { // Construct fop with desired output format Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, output); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); ByteArrayInputStream baisXSL = new ByteArrayInputStream( xslSource.getBytes()); InputStreamReader isreaderXSL = new InputStreamReader(baisXSL, aEncoding); Source xslSrc = new StreamSource(isreaderXSL); Transformer transformer = factory.newTransformer(xslSrc); // Setup input for XSLT transformation ByteArrayInputStream baisXML = new ByteArrayInputStream( xmlSource.getBytes()); InputStreamReader isreaderXML; isreaderXML = new InputStreamReader(baisXML, aEncoding); Source xmlSrc = new StreamSource(isreaderXML); // Resulting SAX events (the generated FO) must be piped through to // FOP Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(xmlSrc, res); } finally { output.flush(); output.close(); } } -- Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: NullPointerException at org.apache.fop.render.pdf.AbstractImageAdapter.setupColorProfile
Work-around added to FOP Trunk: http://svn.apache.org/viewvc?rev=1095895view=rev What you describe sounds like a Java class library bug, i.e. that the cached, default sRGB profile suddenly loses some profile data somehow. On 30.03.2011 10:56:57 pjack wrote: Hi, I'm using fop 0.95 and we are having users who report after a period of time (usually up to a month) they are unable to convert our documents to pdf from xml. In the log file I see an exception Wrapped Exception : java.lang.NullPointerException at org.apache.fop.render.pdf.AbstractImageAdapter.setupColorProfile(AbstractImageAdapter.java:121) at org.apache.fop.render.pdf.AbstractImageAdapter.setup(AbstractImageAdapter.java:87) at org.apache.fop.render.pdf.ImageRenderedAdapter.setup(ImageRenderedAdapter.java:92) at org.apache.fop.pdf.PDFDocument.addImage(PDFDocument.java:823) at org.apache.fop.render.pdf.PDFImageHandlerRenderedImage.generateImage(PDFImageHandlerRenderedImage.java:58) at org.apache.fop.render.pdf.PDFRenderer.putImage(PDFRenderer.java:1745) at org.apache.fop.render.pdf.PDFRenderer.renderImage(PDFRenderer.java:1679) After a restart of the server, the documents they were trying to convert are fine again. Has anyone seen something similar or have any ideas? Regards Phil -- View this message in context: http://old.nabble.com/NullPointerException-at-org.apache.fop.render.pdf.AbstractImageAdapter.setupColorProfile-tp31275195p31275195.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: right-aligned box insertion in text flow
The attachment should give you an idea. The principle: fo:block-container fo:block-container right=-1.2cm inline-progression-dimension=1cm absolute-position=absolute fo:block123/fo:block /fo:block-container /fo:block-container The first block-container is a normal one. It has zero effective height and is used to create a new reference area to which the child block-container can be relatively positioned (although you actually have to use absolute positioning in FO terminology). absolute-position=absolute positions relative to the ancestor reference area. HTH On 03.03.2011 09:30:19 Trevor Nicholls wrote: Thank you Jeremias The marginalia examples I have found typically use a block-container within an fo:float. I haven't found an example which avoids the float :-( Are you aware of any? Cheers Trevor -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, 3 March 2011 8:36 p.m. To: fop-users@xmlgraphics.apache.org Subject: Re: right-aligned box insertion in text flow Trevor, what you're looking for is fo:float, but as you can see here: http://xmlgraphics.apache.org/fop/compliance.html#fo-object-float this object is not implemented, yet. As an alternative, you can investigate using fo:block-containers if you are happy enough to have the version numbers placed on the right side of the normal text flow. On 01.03.2011 14:36:27 Trevor Nicholls wrote: I wonder if the following is do-able; perhaps somebody has been there before me? I have a document schema which includes paragraphs, tables, code fragments, notes, various levels of nested sections, etc. Every block element carries an optional version attribute, and this version needs to be presented in the right margin of the main document flow. When my XML is converted to HTML this is achieved with a CSS float, like so: (XML) para version=123Para text.../para (XSL) xsl:template match=para xsl:call-template name=testversion / pxsl:apply-templates //p /xsl:template xsl:template name=testversion xsl:if test=@version != '' div class=version-float xsl:value-of select=@version / /div /xsl:if /xsl:template (CSS) .version-float { float: right; font-size: 10pt; font-weight: normal; color: #666; background-color: #ffd; margin: 0; padding: 0 0.2em; border-top: 1px solid #ccc; border-left: 1px solid #ccc; border-right: 1px solid #888; border-bottom: 1px solid #888; } This appears in the browser like so: Para text para text para text para | 123 | text para text para text para text --- para text para text para text para text para text para text para text para text para text. I would like to achieve a similar effect in the PDF output which is generated by FOP but I am not sure how to achieve it. Can anyone assist please? We are using FOP 0.95. Cheers Trevor 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 Jeremias Maerki ride-out.fo Description: Binary data - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Best way to handle EPS files
Hi Graeme AFAIK, GhostScript does support processing pdfmark extensions. So converting the EPS directly to PDF using GhostScript/4J seems to be the way to go. But even then, bookmarks and the links will get lost when the PDF is embedded using the PDF plug-in. You can only produce bookmarks using the fo:bookmarks element. And links can only be produced with fo:basic-link and svg:a. So you might want to look into converting EPS to SVG (using Inkscape). Probably as good as it gets. On 18.02.2011 14:42:30 Graeme Kidd wrote: Hi, I was just wondering what the best way to support EPS graphics was. At the moment I simply output to PostScript and then use Ghost4J to convert it to PDF. However I then loose internal links and PDF bookmarks. I was going to look into ImageMagic to convert the EPS files into a more supported vector format but after reading some documentation it appears that it just rasterises the EPS and doesnt do a proper conversion. I am tempted to try and convert the EPS graphics into PDF using Ghost4J and then using PDF Image Support Plug-In for Apache FOP (http://www.jeremias-maerki.ch/development/fop/index.html) to read the converted PDF files. Is this my best option or does anyone else have any better ideas? Thanks Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fo:basic-link show-destination=new status
Hi, basic-link with external-destination and show-destination=new should work as expected. However, it doesn't work with internal-destination. You'll have to work with external-destination and define named destinations to jump to: http://xmlgraphics.apache.org/fop/1.0/extensions.html#named-destinations On 21.02.2011 09:15:52 Subrata Hazra wrote: Dear All, I am using FOP 1.0 version as my reporting solution with J2EE application. I have hyperlink in the output pdf with show-destination=new. When I am opening the generated pdf in browser, the destination link is opening in the same window only. Is this issue is still there or it is fixed in FOP 1.0 version? If so, what I can do at my side? Thanks in advance. -- View this message in context: http://old.nabble.com/fo%3Abasic-link-show-destination%3D%22new%22-status-tp30975133p30975133.html Sent from the FOP - Users mailing list archive at Nabble.com. HTH Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Shading Issue
Hiren sent me an AFP sample off-list. I know now what's causing the effect: A Map Image Object uses scale to fill instead replicate and trim. The 8x8 dither pattern gets streched to the background area and is not replicated. How that got in there, I have no idea. org.apache.fop.afp.AFPDitheredRectanglePainter.paint(PaintingInfo) clearly uses replicate and trim since the beginning. I can only explain it with someone changing the source code. Hiren, did you modify your FOP version? http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java?view=log On 04.02.2011 13:48:32 Jeremias Maerki wrote: Hmm, I can't reproduce your problem. Mine was actually something else and has to do with encoding monochrome images that have been generated by JAI. Have you tried a different viewer or actually printed the file? In my experience, there are huge differences between AFP viewers. I've checked with Compart DocBridgeView, IBM Workbench, BTB Browser and ISIS Papyrus AFP Viewer. Which FOP version are you using? You can send me a sample AFP file off-list and I'll check if I see anything wrong. On 04.02.2011 11:25:21 hirenshah wrote: Thanks! Any help would be greatly appreciated :) Jeremias Maerki-2 wrote: I'll take a look. I've noticed something similar when when I was testing something on Wednesday. On 04.02.2011 09:06:50 hirenshah wrote: We have an issue with table shading with AFP at the moment where the output looks like this when shading is set to dithered: http://old.nabble.com/file/p30842457/Shading.png When we set shading to color it looks like this, but when printed the shading is completely black making the text unreadable: http://old.nabble.com/file/p30842457/Shading%2B2.png Can anyone suggest what we should look at? We know it is not the printer as the AFP files actually look like this (screenshots taken using AFP Viewer). -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30842457.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 -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30843028.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: Problem inserting gif image
My best guess is a class loading problem. Any errors in the logs? I would expect there to be if the image is missing in the output. Make sure fop.jar and xmlgraphics-commons.jar are in the same class loader context. Or the server uses a weird Java Runtime with no GIF ImageIO codec. On 08.02.2011 18:58:59 mathos wrote: I hava a java application wich generates a pdf through FOP 1.0. My source code generates a string which looks like this (just an example): fo:external-graphic content-width=0.5cm content-height=0.5cm src=url('data:image/gif;base64,R0lGODdhMAAwAPAAAP///ywAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yq mCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkV J+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQ ZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0 vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3 uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7') / Wenn I run the application from my developer interface (JDeveloper), everything works fine. To distribute my application I compile an wrap everything into a jar-file. After running it, the pdf is generated correctly but without the image. I can't understand what is missing. -- View this message in context: http://old.nabble.com/Problem-inserting-gif-image-tp30875128p30875128.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: AFP Rendering
only by the recipient. If you are not the intended recipient , you are hereby notified that any dissemination, distribution, copying or use of this e-mail is strictly prohibited and you are requested to delete this e-mail immediately and notify the originator or netad...@patni.com. Patni Computers does not enter into any agreement with any party by e-mail. Any views expressed by an individual do not necessarily reflect the view of Patni Computers. Patni Computers is not responsible for the consequences of any actions taken on the basis of information provided, through this email. The contents of an attachment to this e-mail may contain software viruses, which could damage your own computer system. While Patni Computers has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening an attachment. To know more about Patni Computers please visit www.patni.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Shading Issue
I'll take a look. I've noticed something similar when when I was testing something on Wednesday. On 04.02.2011 09:06:50 hirenshah wrote: We have an issue with table shading with AFP at the moment where the output looks like this when shading is set to dithered: http://old.nabble.com/file/p30842457/Shading.png When we set shading to color it looks like this, but when printed the shading is completely black making the text unreadable: http://old.nabble.com/file/p30842457/Shading%2B2.png Can anyone suggest what we should look at? We know it is not the printer as the AFP files actually look like this (screenshots taken using AFP Viewer). -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30842457.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: AFP Rendering
You can put as many NOPs as you like in any of fo:simple-page-master, fo:page-sequence and fo:declarations. But only with the current FOP Trunk which is available from our Subversion repository. See here for details: http://xmlgraphics.apache.org/fop/download.html#source You can also try a nightly build if you're unfamiliar with building Java applications: http://xmlgraphics.apache.org/fop/download.html#binary On 04.02.2011 10:59:58 Dhulia, Sandeep wrote: It may not solve the issue since nop in fo:declaration will be outputted once for document and nop in page sequence is for each page but within the BPG and EPG. I guess the printer is expecting to see the NOP before page begins to get additional information for the page. Is it possible to add multiple nops within fo:declaration and page-sequence as we do it in simple page master? Can you please guide me from where can I download your fix and a short description on how to use your changes to get the output. Thanks Regards, Sandeep From: Jeremias Maerki [d...@jeremias-maerki.ch] Sent: Friday, February 04, 2011 1:50 PM To: fop-users@xmlgraphics.apache.org Subject: Re: AFP Rendering Just FYI, I've added the possibility to add NOP's in fo:declarations (NOP appearing just after BDT) and fo:page-sequence (NOP appearing just after BPG). Not exactly what you want, I know, but I thought I'd mention it. Adding NOPs outside their respective containers will not be trivial, I think. On 04.02.2011 08:48:19 Dhulia, Sandeep wrote: Hi Peter, Thanks Peter and appreciate your help in this issue. I will raise this as a feature request in bugzilla. Thanks Regards, Sandeep From: Peter Hancock [peter.hanc...@gmail.com] Sent: Friday, January 28, 2011 3:09 PM To: fop-users@xmlgraphics.apache.org Subject: Re: AFP Rendering Hi Sandeep, Sorry for the delayed response. The code that handles the rendering of NOPs is within IFRenderer.renderPage() and I can confirm that FOP will always render a page header before a NOP. I am not sure how popular the use case is for declaring NOPs outside of the page scope. The MO:DCA specification only stipulates that a NOP must be enclosed within begin-end domain, and so your requirement is certainly valid. Perhaps a FOP developer with the available time would be willing to provide a patch that extends the afp:no-operation element with an attribute to specify the placement of the NOP at document or page level. You should raise a feature request in the ASFs bugzilla https://issues.apache.org/bugzilla, stating your requirements. I would also recommend that you advertise your request for this requirement in a new thread on the fop-dev mailing list. I hope I have been of help, Pete On Fri, Jan 28, 2011 at 5:11 AM, Dhulia, Sandeep sandeep.dhu...@patni.com wrote: Not yet!!! BR, Sandeep From: Peter Weber [peter.we...@garaio.com] Sent: Thursday, January 27, 2011 7:33 PM To: fop-users@xmlgraphics.apache.org Cc: Dhulia, Sandeep Subject: RE: AFP Rendering Hello Sandeep Have You got an answer or a solution on that issue? I would really appreciate to place NOPs or other elements as valid NOPs in the document structure. Otherwise, I have to find a way to solve this with TLEs, which needs change in the solution of the customer. Thanks and Regards Peter -Original Message- From: Dhulia, Sandeep [mailto:sandeep.dhu...@patni.com] Sent: Dienstag, 18. Januar 2011 15:14 To: fop-users@xmlgraphics.apache.org Subject: RE: AFP Rendering Hi Peter, Thanks for your prompt response. Please find attached sample.fo which we are generating. I am also attaching an image(snap) of what is getting printed in afp file. As per the document we can use the tag only in simple page master, but is there any configuration related parameters that can give me finer control on output (like not print Named Group (BNG) or position of NOP etc) Thanks Regards, Sandeep From: Peter Hancock [peter.hanc...@gmail.com] Sent: Tuesday, January 18, 2011 6:32 PM To: fop-users@xmlgraphics.apache.org Subject: Re: AFP Rendering Hi Sandeep, Reading http://xmlgraphics.apache.org/fop/trunk/output.html#afp-no-operation, it appears that FOP only allows NOP declarations in the Simple Page Master, and so there may not be a way to control the position relative to where pages begin and end. Can you please attach the fo file or perhaps a suitably cut down version if you require further investigation. Thanks, Peter On Tue, Jan 18, 2011 at 11:45 AM, Dhulia, Sandeep sandeep.dhu...@patni.com wrote: Hi All, I am
Re: Shading Issue
Hmm, I can't reproduce your problem. Mine was actually something else and has to do with encoding monochrome images that have been generated by JAI. Have you tried a different viewer or actually printed the file? In my experience, there are huge differences between AFP viewers. I've checked with Compart DocBridgeView, IBM Workbench, BTB Browser and ISIS Papyrus AFP Viewer. Which FOP version are you using? You can send me a sample AFP file off-list and I'll check if I see anything wrong. On 04.02.2011 11:25:21 hirenshah wrote: Thanks! Any help would be greatly appreciated :) Jeremias Maerki-2 wrote: I'll take a look. I've noticed something similar when when I was testing something on Wednesday. On 04.02.2011 09:06:50 hirenshah wrote: We have an issue with table shading with AFP at the moment where the output looks like this when shading is set to dithered: http://old.nabble.com/file/p30842457/Shading.png When we set shading to color it looks like this, but when printed the shading is completely black making the text unreadable: http://old.nabble.com/file/p30842457/Shading%2B2.png Can anyone suggest what we should look at? We know it is not the printer as the AFP files actually look like this (screenshots taken using AFP Viewer). -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30842457.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 -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30843028.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Shading Issue
The one you see in my From header: d...@jeremias-maerki.ch On 04.02.2011 13:52:12 hirenshah wrote: The print out looks the same as what I see in the AFP file. What is your email address? I will send you the AFP :) Jeremias Maerki-2 wrote: Hmm, I can't reproduce your problem. Mine was actually something else and has to do with encoding monochrome images that have been generated by JAI. Have you tried a different viewer or actually printed the file? In my experience, there are huge differences between AFP viewers. I've checked with Compart DocBridgeView, IBM Workbench, BTB Browser and ISIS Papyrus AFP Viewer. Which FOP version are you using? You can send me a sample AFP file off-list and I'll check if I see anything wrong. -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30844190.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: Problem regarding font substitution
There are two fonts: arial*.ttf and arialuni.ttf. The latter has more glyphs but only comes in one style. Word can display bold and italic for ArialUni because it tells Windows to synthesize the derived styles. We could theoretically do this, too, for PDF output, but that is not currently implemented in Apache FOP. Anyway, I don't think such a derived font can ever look really nice. And AFAIK, PDF is the only output format (of the ones we support) that allows this font derivation. For reference: - PDF 1.4 Spec, chapter 5.5.2 TrueType Fonts Using ArialUni,Bold instead of ArialUni in the /BaseFont entry creates the synthesized font. On 02.02.2011 09:21:41 mehdi houshmand wrote: Hi Peder, What OS are you using? I just checked in Windows 7, and it's not obvious using the file system GUI, but there Arial is split up into arial.ttf, ariblk.ttf, ariali.ttf, arialbd.ttf and arialbi.ttf. However, when going into Windows\Fonts, it does appear to be a single file. In the Ubuntu flavour of linux, it's the same, arial is split up into it's constituent parts. So 2 questions really, firstly, what OS are you using? Secondly what version of FOP are you using? Thanks Mehdi 2011/2/2 Peet Kes peet@gmail.com: Hi Eric, But I only have one truetrype file for the ArialUnicodeMS font I only have ARIALUNI.TTF and when I use this font in Word I can turn on Bold and Italic. What do I have to do to get this working? Best regards, Peder 2011/2/1 Eric Douglas edoug...@blockhouse.com You're referencing normal and bold triplets with one font file name. They're normally separate files. From: Peder [mailto:peet@gmail.com] Sent: Tuesday, February 01, 2011 8:26 AM To: fop-users@xmlgraphics.apache.org Subject: Problem regarding font substitution Hi all, I ran across a problem regarding font substitution. I use font 'x' for my main output. Whenever I come across characters which are not included in my font 'x' I want to use the ArialUnicodeMS as catch-all. So on the fo:root element I specified: font-family=ArialUnicodeMS But now when I come across the following fo:inline fo:inline font-weight=boldKiºar Vari/fo:inline The text does not appear bold in the PDF How come? In my fop configuration I specified the following entry for the ArialUnicodeMS font: font metrics-url=/location to fonts/ARIALUNI.xml kerning=true embed-url=/location to fonts/ARIALUNI.TTF font-triplet name=ArialUnicodeMS style=normal weight=normal/ font-triplet name=ArialUnicodeMS style=normal weight=bold/ font-triplet name=ArialUnicodeMS style=italic weight=normal/ font-triplet name=ArialUnicodeMS style=italic weight=bold/ /font Do I have to change my configuration? When I run the transformation I receive the following message: WARN Event groupId=org.apache.fop.fonts.FontEventProducer,id=org.apache.fop.fonts.FontEventProducer.fontSubstituted,key=fontSubstituted,params={requested=ArialUnicodeMS,normal,700, effective=ArialUnicodeMS,normal,400} How can I prevent this from happening and get the bolded name? Best regards, Peder - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: font missing warning
Normally, FOP puts the fop-fonts.cache file in user.home/.fop. If that directory is not writable the cache file is put into the temp directory. It could indeed help to delete the cache file. If there was a problem loading a particular font, it can get flagged as invalid and won't be loaded again later. On 02.02.2011 16:52:05 Roberto Cahanap wrote: I vaguely remember that we had a similar issue with our Test server (it's working now on this Test server). To get it to work, I remembered deleting the fop cache file, but I can't seem to find the location of this cache file now. Help! snip/ Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: font missing warning
Check the environment (set on Windows). Look for the TEMP entry. It's TEMP=C:\Users\Jeremias\AppData\Local\Temp on my machine for my user. If it's not around, maybe the user under which FOP is running has no write access to the user directory or there is no user directory at all. I have no idea. I love remote debugging. ;-) On 02.02.2011 18:58:53 Roberto Cahanap wrote: Hello Jeremias, Thank you for shaking my memory. Yes on the TEST server, we have a folder named .FOP that is in the USERACCOUNT's directory. Inside this is a file called fop-fonts.cache. There is no such folder on our Production server. Would you know why this is so? If this folder is not there, then where would it be looking for these cached fonts? If like you say in the temp directory, where would that be on a Windows system? Thank you again. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Wednesday, February 02, 2011 12:22 PM To: fop-users@xmlgraphics.apache.org Subject: Re: font missing warning Normally, FOP puts the fop-fonts.cache file in user.home/.fop. If that directory is not writable the cache file is put into the temp directory. It could indeed help to delete the cache file. If there was a problem loading a particular font, it can get flagged as invalid and won't be loaded again later. On 02.02.2011 16:52:05 Roberto Cahanap wrote: I vaguely remember that we had a similar issue with our Test server (it's working now on this Test server). To get it to work, I remembered deleting the fop cache file, but I can't seem to find the location of this cache file now. Help! snip/ Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org The information transmitted in this email and any of its attachments is intended only for the person or entity to which it is addressed and may contain BioReference Laboratories proprietary information, which is privileged, confidential, or subject to copyright belonging to BioReference Laboratories. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this in error, please contact the sender immediately and delete and destroy the communication and all of the attachments you have received and all copies thereof. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Reduce required memory
Hi Fotini, only by the means we've mentioned a number of times on this list: cutting the table manually in XSLT and distributing them to multiple page-sequences. But obviously, finding the right cut-off points can be difficult. See also: http://xmlgraphics.apache.org/fop/1.0/running.html#memory On 25.01.2011 15:30:30 Anagnostou, Fotini wrote: Dear all, I have this xsl:fo (http://support.i-docs.com/sample_1.xml.bz2) that has a table with many rows. The process to transform it to pdf (that has 92pages) requires 386MB (as shown in Task Manager). Is there anything we can do to reduce the required memory so that the result is (almost) the same? Regards, Fotini Anagnostou Using FOP 1.0 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Can''t get rid of line between rows
Good to know that it also happens in other PDF viewers. Thanks for letting us know. On 26.01.2011 01:21:46 Rob Sargent wrote: Actually, the Adobe users were fine. It was just me using Evince (on Suse-11.2) who saw the problem and Evince doesn't have any controls in that regard. On 01/24/2011 09:24 AM, Rob Sargent wrote: Spot on! Thanks. (One wasted weekend...) On 01/24/2011 12:53 AM, Jeremias Maerki wrote: Not sure if I fully understand your problem, but I suspect it's once more Adobe's anti-aliasing to be blamed. And this won't show up in print, BTW. To get rid of this on display, go to Acrobat's Preferences Dialog, select Page Display and enable Enhance Thin Lines (AR X) or disable Smooth line Art. You may have to disable Use 2D graphics acceleration, too. Nothing FOP can do at the moment. I've recently explained on this list what would need to be done to work around Adobe's problem. On 23.01.2011 22:34:43 Rob Sargent wrote: Using fop-1.0. I have a two column table. The first column spans the table. There are five rows in the table. The cells are colored. Between each row there is a thin (1pt at most, perhaps a single pixel) line. I've tried forcing colored borders over the middle ground with border-collapse=collapse (which, if I read the compliance list correctly, is now supported). How many other ways can I a) be generating this line and b) how to get rid of them. Looking like I'll miss sending to the printers Monday :( Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: circle or mask without svg
By default, Batik (which handles SVG) can only process PNG, JPEG and TIFF. So TIFF should work. If it doesn't, please post an example document. EPS won't work at all. For PDF output, we have a special plug-in in place that supports some additional formats but embedding EPS in PDF is deprecated and therefore shouldn't (and often can't) be done. On 26.01.2011 18:58:05 ingo peter wrote: hi, i search for a solution to embed eps/tiff-images in a circle-frame. with svg i can do this only with jpg/png or svg. any suggestions? mfg/regards -ip- Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: example mathml.fo xml and xsl
Are you using an older version of Apache FOP? Apache FOP 1.0 no longer includes support for MathML. This is now handled by an external plug-in: JEuclid http://jeuclid.sourceforge.net/ On 27.01.2011 09:14:00 mike anderl wrote: i rendered inside my java application the mathml.fo to pdf. this works. does someone have the mathml.xml and mathml.xsl for the mathml.fo from the example folder? thx m -- View this message in context: http://old.nabble.com/example-mathml.fo-xml-and-xsl-tp30774968p30774968.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: 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
Re: Can''t get rid of line between rows
Not sure if I fully understand your problem, but I suspect it's once more Adobe's anti-aliasing to be blamed. And this won't show up in print, BTW. To get rid of this on display, go to Acrobat's Preferences Dialog, select Page Display and enable Enhance Thin Lines (AR X) or disable Smooth line Art. You may have to disable Use 2D graphics acceleration, too. Nothing FOP can do at the moment. I've recently explained on this list what would need to be done to work around Adobe's problem. On 23.01.2011 22:34:43 Rob Sargent wrote: Using fop-1.0. I have a two column table. The first column spans the table. There are five rows in the table. The cells are colored. Between each row there is a thin (1pt at most, perhaps a single pixel) line. I've tried forcing colored borders over the middle ground with border-collapse=collapse (which, if I read the compliance list correctly, is now supported). How many other ways can I a) be generating this line and b) how to get rid of them. Looking like I'll miss sending to the printers Monday :( Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
Have you tried display-align=after on region-body? Not sure if that's what you're after. On 18.01.2011 21:33:37 Rob Sargent wrote: Using fop-1.0, is it possible to define the columns such that the last line of text is always at the same position relative to the bottom of the page/the region-body? Or to much with the text to affect the same? rjs Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP output
Eric, that the TIFF is much larger than the PNG can be explained by different compression algorithms. See: http://xmlgraphics.apache.org/fop/1.0/output.html#tiff-configuration If you transport the images to a client through the web, I'd recommend PNG (which uses ZLib + Predictors). That is usually more efficient than anything TIFF offers except if you use JPEG compression but that's lossy. If you only need black white, I'd go for TIFF with CCITT Group 4 compression. On 19.01.2011 22:56:33 Eric Douglas wrote: I just tested output formats using their respective renderers and created a PNG and a TIFF. The TIFF file was about 4 times larger and appeared to have exactly the same quality which looks a bit fuzzy. What's next? I was testing creating documents as pictures though my actual goal is to get the output rendered into individual images for each page so I can render them on a server then transfer them to the client to display in a custom print preview window without having a transformer or renderer created on the client (the default FOP PreviewPanel seems to require both). Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP Memory
If you've installed the JDK (not just the JRE), you have a number of tools in the bin directory of the JDK installation. With jvisualvm or jconsole you can attach to a Java process and inspect the memory consumption. But the values shown there may not be representative since Java uses Garbage Collection. It may destroy objects much later than expected if there's enough memory. So this is all a fuzzy story. If the JVM spends a lot of time with garbage collection it's a clear indication that a little more memory can't hurt. Anyway, this is usually trialerror. Note that by default, the JVM gets very little memory. It's always a good idea to give it at least -Xmx128M which should be enough for many cases. You said that you're rendering to bitmaps. That can increase the memory consumption a bit. On 20.01.2011 16:04:14 Eric Douglas wrote: How do I know how much memory it needs? I wrote a Java program which should generate a PDF of about 10 pages using FOP 1.0 but with many xsl:text tags per page. It runs in my 64 bit Eclipse on a Windows Vista machine with 4GB RAM. It gets out of memory exception on my 32 bit Eclipse on a Windows XP machine with 2GB RAM. Both installs have default settings for jvm memory. If I put in a tag to override allocated memory, how do I know how much I need? Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Antialising issue with borders in PDF with fop-0.95
Hi Jürgen On 14.01.2011 13:03:39 Juergen Birkle wrote: Hallo Pete, The print is nearly perfect, but has the same minimal difference as the screen. Nearly? I haven't heard any indication, yet, that this problem appears in print. The antialiasing at the screens is ALLWAYS 1px, no matter what zoom-factor you use at the reader. With the effect that the difference get less as you increase the zoom-factor. But my main problem is, that the view of the reader looks bad in a zoom-range of 50% to 200%! A line of 2px at 100% is displayed with 3 different kinds: 1. with antialiasing from top and bottom == displays as light grey line 2. with antialiasing from top or bottom == displays as dark grey line 3. with not antialiasing (solid) == displays as black line If you reduce the zoom-factor to 75% or 50%, the line of 1. becomes invisible and 2. becomes a lighter appearance. Print of the page is ok, but only because the printer has a much higher resolution. No, because no anti-aliasing happens on a printer. The anti-aliasing is only done on computer screens to improve the subjective resolution. And Adobe's approach seems to have some drawbacks here. I have generated PDF with Excel and with it the borders are all drawn as solid lines. You can see the difference with Acrobat reader at 6400%. FOP generated files have different types of lines. The shapes are displayed with a thin object-line in the middle of the black border and antialiasing, the solid lines are displayed without this object-line and without antialiasing. The mixing of this two objects in one PDF file results in a bad display in the reader. If there is a possibility to disable the usage of shapes (or rectangle object) in FOP and only use solid lines it would help me and others very much. Because with the mixing of this two objects in one PDF no good looking PDF at the screen is possible! There is currently no switch that makes this go away. The current approach was selected to support all different border styles in XSL-FO and the border collapsing model. That has that precise drawback that you see in Acrobat. Of course, it would theoretically be possible to combine the various border segments where this is possible, for example when two adjacent border segments have the same color. I remember back when Karen and Keiron discussed combining border segments during the FOP redesign (2003/2004). Apparently, this business is quite tricky. A simple approach might be to fall back to FOP 0.20.5's approach that simply painted solid lines (but didn't support all border styles). But even that sometimes looked ugly in Acrobat (or even in print). If you want me to show you the difference let me know, I will post the Screenshots at 6400% of Acrobat reader. We know all about how it looks. This has come up several times. Disable anti-aliasing in Acrobat and the problem goes away. Unsatisfying, I know. Anyway, implementing a better border painting strategy with border segment combination will be a tricky thing. I don't think you can expect a short-term solution from anyone here, except if you give it a shot yourself. But I doubt it is worth the effort just to improve how the borders look in Adobe Acrobat. snip/ Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP Trunk Snapshot (fop-20110110.jar) : barcode4j
Yes, you can probably recompile, but the change violated binary backwards-compatibility. I've put the comment there precisely because of that reason. I've had to revert the same change once before. On 13.01.2011 11:01:15 Simon Pepping wrote: Why does this cause an error? I see no problem in barcode's method BarcodeElementMapping.initialize. In eclipse I can compile barcode without errors with FOP from before your latest fix. Simon On Wed, Jan 12, 2011 at 09:01:45PM +0100, Jeremias Maerki wrote: Thanks for noticing. This was broken by: http://svn.apache.org/viewvc?rev=1055034view=rev ...and is now fixed by: http://svn.apache.org/viewvc?rev=1058295view=rev There was a comment there saying not to change HashMap to Map, but it seems it got overlooked. On 12.01.2011 12:06:03 Philippe Pithon wrote: Hi, I use now FOP Trunk Snapshot (20110110) and barcode4j-fop-ext-complete.jar With FOP 1.0, barcode works fine but in trunk, there is an error Any ideas ? Philippe Pithon Caused by: java.lang.NoSuchFieldError: foObjs at org.krysalis.barcode4j.fop.BarcodeElementMapping.initialize(BarcodeElementMapping.java:49) at org.krysalis.barcode4j.fop.BarcodeElementMapping.init(BarcodeElementMapping.java:39) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.fop.fo.ElementMappingRegistry.addElementMapping(ElementMappingRegistry.java:97) at org.apache.fop.fo.ElementMappingRegistry.setupDefaultMappings(ElementMappingRegistry.java:80) at org.apache.fop.fo.ElementMappingRegistry.init(ElementMappingRegistry.java:67) at org.apache.fop.apps.FopFactory.init(FopFactory.java:162) at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:185) Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP Trunk Snapshot (fop-20110110.jar) : barcode4j
Thanks for noticing. This was broken by: http://svn.apache.org/viewvc?rev=1055034view=rev ...and is now fixed by: http://svn.apache.org/viewvc?rev=1058295view=rev There was a comment there saying not to change HashMap to Map, but it seems it got overlooked. On 12.01.2011 12:06:03 Philippe Pithon wrote: Hi, I use now FOP Trunk Snapshot (20110110) and barcode4j-fop-ext-complete.jar With FOP 1.0, barcode works fine but in trunk, there is an error Any ideas ? Philippe Pithon Caused by: java.lang.NoSuchFieldError: foObjs at org.krysalis.barcode4j.fop.BarcodeElementMapping.initialize(BarcodeElementMapping.java:49) at org.krysalis.barcode4j.fop.BarcodeElementMapping.init(BarcodeElementMapping.java:39) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.fop.fo.ElementMappingRegistry.addElementMapping(ElementMappingRegistry.java:97) at org.apache.fop.fo.ElementMappingRegistry.setupDefaultMappings(ElementMappingRegistry.java:80) at org.apache.fop.fo.ElementMappingRegistry.init(ElementMappingRegistry.java:67) at org.apache.fop.apps.FopFactory.init(FopFactory.java:162) at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:185) XSL usecase: fo:instream-foreign-object barcode:barcode msg={$TOTAL} orientation=-90 barcode:code39 barcode:height32pt/barcode:height /barcode:code39 /barcode:barcode /fo:instream-foreign-object Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP 1.0: Generate PDF with plain text inside
Compression for content streams can be disabled using: filterList type=content valuenull/value /filterList On 07.01.2011 12:52:14 Friedel wrote: Hi Pete thanks, I tried again. But still the same. The obj are readable but the streams are not. If I search words found in the displayable PDF, I won't find the in the editor. There are no other configuration parts for this issue? Regards Friedel Peter Hancock-2 wrote: Hi, I also have the setting filterList type=image valuenull/value /filterList but I do not think that is relevant to your requirement. Pete On Fri, Jan 7, 2011 at 11:08 AM, Peter Hancock peter.hanc...@gmail.com wrote: Hi Friedel, This is my config to supress Flate encoding: filterList valuenull/value /filterList So your config should work. Did you try it? Pete On Fri, Jan 7, 2011 at 10:28 AM, Friedel friede...@gmx.ch wrote: Hi I use FOP 1.0 on Win and UNIX and it works well. I do get PDFs with compression switched on/off and see the size of the PDF changing. But I also like to have a PDF with the text inside readable, not only the objects readable. All I get is most of the content encoded (not readable), except the objects (readable). I'd like to be able to read also the text in the PDF if I open the PDF with an editor. fop.xconf: filterList valuenull/value !-- valueascii-85/value -- !-- valueascii-hex/value -- /filterList Is the a configuration to enable inside plain text PDF generation? Regards, Friedel -- View this message in context: http://old.nabble.com/FOP-1.0%3A-Generate-PDF-with-plain-text-inside-tp30612984p30612984.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 -- View this message in context: http://old.nabble.com/FOP-1.0%3A-Generate-PDF-with-plain-text-inside-tp30612984p30613541.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: barcode4j and 3 of 9 compressed barcode type
Hi Ajay, questions on Barcode4J are best asked over at barcode4j-us...@lists.sourceforge.net. Anyway I'm not aware of any compressed 3 of 9 barcode type. Do you mean Code93/USS-93? That is not implemented in Barcode4J. If it were, it would be listed on the front page of the website. On 07.01.2011 08:41:19 BLAYKM wrote: Hi I am using barcode4j-2.1.0 to develop barcodes using XSL-FO. Actually we are trying to develop XSL-FO templates for Documents that were developed using Jet-Forms. Does Barcode4j support the barcode type 3 of 9 compressed format. If Not what could be closest barcode type to 3 of 9 compressed. If Yes can you provide a code sample. I have been googling for this a lot but could not find the answer. Help needed Regards Ajay -- View this message in context: http://old.nabble.com/barcode4j-and-3-of-9-compressed-barcode-type-tp30612044p30612044.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: how to extend the rendering part of fop
On 05.01.2011 16:25:20 gen1986 wrote: Hi Chris, Did you add the file named org.apache.xmlgraphics.image.loader.spi.ImageConverter to the JAR containing your code in META-INF\services sub directory as suggested by Jeremias? Yep (you can see it in the attachment). the attachment seems to be missing. I have created a ImageChartPreloader to preload the ImageInfo from DOMSource. What I can see is that the originalURI is null. Yeah, looks like I gave bad advice here, that the Preloader isn't necessary. Obviously, it is. 1) Should I do something at some place to specifiy that uri? (where, how...) No, no URI is involved when fo:insteam-foreign-object is used. 2) However even if the originalURI is null as I can get all the infos from the source it's ok. But what MimeType should I give to the created ImageInfo? (I've tried some, but I always get the same error : no suitable loader/converter combination...etc) I've used application/x-barcode4j+xml for Barcode4J. Create another custom one with application/x-[something]+xml. 3) I've tried to solve my problem with the preloader, but if it's not the right way for doing it (ex: maybe setting some attributes to the Document is?) tell me. I think the important thing is to support a DOMSource in the preloader for your case. Again, take Barcode4J as a template. 4) Please take à look at the attachment, so you can tell me what is missing. It didn't make it to the list. Try putting everything in a ZIP. Eugen cbowditch wrote: On 05/01/2011 10:52, gen1986 wrote: Hello, Stepan and Eric thanks for the suggestions but the whole thing must be done in java (the charting is only a part of the app). Jeremias solution is close to what I must do. After following the explanations of Jeremias and reading the sources of Barcode4J, etc. I manage to get something out, but it still doesn't work and I'm not sure about some points. 1) I don't have to call imageManager.convertImage(image, flavors) right ? It's the fop framework who will do that. However if it's true, something is going wrong because my converters are not executed. Right, the Image Loader framework takes care of that. Did you add the file named org.apache.xmlgraphics.image.loader.spi.ImageConverter to the JAR containing your code in META-INF\services sub directory as suggested by Jeremias? This is needed in order for the Image Loader Framework to be made aware of your converter. 2) When I'm running the transformation I've got an error GRAVE: Image not available. URI: (instream-object). Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for null (No context info available). After googling a bit I've found that we have to add the following line to the fop conf :prefer-renderertrue/prefer-renderer That is not the correct solution. The prefer-renderer option forces use of the older renderers. The old Renderers don't benefit from the latest bug fixes and improvements that have been made to the painters. If I'm doing so I've got another error : No handler defined for my namespace... So instead asking a lot of questions I've uploaded a basic test project so you can see what I'm doing wrong. http://old.nabble.com/file/p30594894/Fop-ChartExtension.rar Fop-ChartExtension.rar Thanks for your help! Thanks, Chris Eugen snip/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/how-to-extend-the-rendering-part-of-fop-tp30579066p30597037.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: how to extend the rendering part of fop
- ImageConverterGraphics2D2Bitmap - ImageRenderedImage I hope that clears things up a bit. Thanks again. Eugen Jeremias Maerki-2 wrote: Hi Eugen Assuming you're using Apache FOP 1.0 or later, I would suggest to you to write a set of plug-ins for the Apache XML Graphics Commons image loader framework. The documentation for that is found here: http://xmlgraphics.apache.org/commons/image-loader.html That's our new infrastructure for handling images. And your charting XML is nothing other than an image in XML. A good example of such a set of plug-ins can be found in Barcode4J: http://barcode4j.cvs.sourceforge.net/viewvc/barcode4j/barcode4j/src/xmlgraphics-commons/ You can see multiple ImageConverter implementations there. One converts [1] a generic XML document into an ImageBarcode [2]. And you would create something like an ImageChart. Furthermore, I'd go the Java2D route (Graphics2D), so you'd add an ImageConverter which takes an ImageChart and produces an ImageGraphics2D [3] (The code in there basically paints your chart against a Graphics2D object). The latter can be processed by FOP's PDF support to create high-quality vector graphics without you having to learn about PDF specifics. The nice side-effect is that it won't only work for PDF, but also for all other output formats supported by FOP. [1] http://barcode4j.cvs.sourceforge.net/viewvc/barcode4j/barcode4j/src/xmlgraphics-commons/java/org/krysalis/barcode4j/image/loader/ImageConverterBarcodeXML2Barcode.java?view=markup [2] http://barcode4j.cvs.sourceforge.net/viewvc/barcode4j/barcode4j/src/xmlgraphics-commons/java/org/krysalis/barcode4j/image/loader/ImageBarcode.java?view=markup [3] http://barcode4j.cvs.sourceforge.net/viewvc/barcode4j/barcode4j/src/xmlgraphics-commons/java/org/krysalis/barcode4j/image/loader/ImageConverterBarcode2G2D.java?view=markup If you don't plan to put charts in external files (i.e. you use only fo:instream-foreign-object), you can omit the Preloader, LoaderFactory and Loader, I think. The image converters should be enough. If there's something that our PDFGraphics2D can't handle, we can take a closer look at this again. HTH On 03.01.2011 16:55:32 gen1986 wrote: Hi, I'm working on a project where I have to extend FO to support custom tags for drawing charts. For doing so I've extended ElementMapping and created my custom ContentHandlerFactory, etc. Until here it's ok. I can get all the infos about the chart from the xsl-fo template. My problem is that I want now to write the chart as a stream to the PDF, but I don't know which fop classes to use for doing it the right way. Any help is welcome. If my problem isn't clear enough I can give more explanations, just let me know ;) Thanks, Eugen -- View this message in context: http://old.nabble.com/how-to-extend-the-rendering-part-of-fop-tp30579066p30579066.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 -- View this message in context: http://old.nabble.com/how-to-extend-the-rendering-part-of-fop-tp30579066p30580808.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
[ANN] Barcode4J 2.1 released
About Barcode4J == Barcode4J is a barcode generation package written in Java and available under The Apache License version 2.0. Features == 1D barcode implementations: - Interleaved 2 of 5 - ITF-14 - Code 39 - Codabar - Code 128, EAN-128 - UPC-A and UPC-E (with supplementals) - EAN-13 and EAN-8 (with supplementals) Postal barcode implementations: - POSTNET - Royal Mail Customer Barcode - USPS Intelligent Mail (4-State Customer Barcode) 2D symbologies: - PDF417 - DataMatrix Support for multiple output formats: - SVG - EPS (Encapsulated PostScript) - Bitmap images (such as PNG or JPEG) - Java2D (AWT) - Text (for testing and debugging only) Additional features: - Two APIs (XML-oriented and Bean-style) - Servlet with support for SVG, EPS and bitmap output - Command-line interface - Demonstration applet Plug-ins/extensions for third-party products: - Apache Xalan: SVG-generating XSLT extension - The SAXON XSLT Processor from Michael Kay: SVG-generating XSLT extension - Apache FOP: support as fo:instream-foreign-object - Apache XML Graphics Commons: Image Loader Framework For more information about Barcode4J, please visit: http://barcode4j.sourceforge.net Release Notes == Version 2.1 is a feature and bugfix release. The most important changes are: - ITF-14 support - a plug-in for the image loading framework in Apache XML Graphics Commons (which is used by Apache FOP 0.95 and later). This restores compatibility of Barcode4J with Apache FOP 1.0. - An Apache Ant task - OSGi metadata for the main JARs - a number of fixes for PDF417 The detailed change log can be found here: http://barcode4j.sourceforge.net/changes.html Enjoy! Jeremias Maerki pgpkfPtDqshUi.pgp Description: PGP signature
Re: font embed-url...
Hi Roberto, if you update to FOP 1.0, you can do away with the XML font metrics files (metrics-url attribute) and you can use the instructions found at the following URL to specify which fonts shall not be embedded. http://xmlgraphics.apache.org/fop/1.0/fonts.html#embedding (look for referenced-fonts) On 15.12.2010 16:53:19 Roberto Cahanap wrote: Hello! I am new to this mailing list, so thank you in advanced for helping. We have in the fop.xconf a setting like this: font metrics-url=file:///c:/Program Files/Apache/fop/fonts/luci.xml kerning=yes embed-url=file:///c:/Windows/Fonts/lucon.ttf encoding-mode=single-byte font-triplet name=Lucida Console Print style=normal weight=normal/ /font Which seems to work fine. This font declaration embeds this font into the PDF document. What we would like is the option of NOT embedding this also. So for some docs we would embed, while others we do not. Is this possible? Thank you. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: IllegalArgumentException: Illegal character for utf-8 symbols
Sorry, wrong list. Barcode4J support is available at: barcode4j-us...@lists.sourceforge.net Anyway, Code 128 doesn't support Unicode. Only the US-ASCII character set is supported. See: http://en.wikipedia.org/wiki/Code_128 http://barcode4j.sourceforge.net/2.1/symbol-code128.html On 15.12.2010 12:12:35 boraldo wrote: Here is my code: public class BarcodeService { private static final int DPI = 100; public static void generate(OutputStream outputStream, String message) throws IOException { AbstractBarcodeBean bean = new Code128Bean(); bean.setModuleWidth(UnitConv.in2mm(1.0f / DPI)); bean.doQuietZone(false); BitmapCanvasProvider canvas = new BitmapCanvasProvider(outputStream, image/jpeg, DPI, BufferedImage.TYPE_BYTE_BINARY, false, 0); bean.generateBarcode(canvas, message); canvas.finish(); } public static void main(String[] args) throws IOException { generate(new FileOutputStream(C:/1.png), йцу); } } йцу are russian symbols in utf-8. These leads to java.lang.IllegalArgumentException: Illegal character: й How can I get rid of it ? -- View this message in context: http://old.nabble.com/%22IllegalArgumentException%3A-Illegal-character%22-for-utf-8-symbols-tp30462881p30462881.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: FOP creates corrupt PDF? (was: ValidationException: Document is empty)
I had no problem generating a good PDF from your bill.fo with FOP 1.0. I can see, though, that your bill.pdf is unfinished. It lacks the PDF trailer. Could be that you got some exception or that your code does not properly flush/close the written file. I did it from the command-line. On 08.12.2010 14:41:08 Georg Datterl wrote: You are correct. I inherited the file and thought I might migrate to FOP1.0 without much work. Anyway, now I changed my transformation and I'm back to present a true FOP problem. Bill.pdf is created with fop-1.0 as provided by maven. Output.pdf is created by fop-trunk. Output.pdf looks quite correct (except for minor layout problems), but Acrobat Reader 7.0 can't open Bill.pdf. I can see some differences in the file, but I don't know what they mean. Can somebody tell me what might be the reason for the difference? snip/ Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Extracting text of created pdfs with fonts
You didn't say what FOP version you're using. Have you tried the latest FOP release? On 06.12.2010 11:05:27 alexander.reel...@lusini.com wrote: Hi all, I have a problem extracting the text content of a pdf created with fop using custom fonts. The fonts have been added to the fop.xconf and are rendered correctly. However, when I try to open the file (regardless whether this is done with itext, pdfbox or pdfclown libraries), I cannot extract any text - only binary gibberish is returned. As soon as I disable the custom font rendering, every lib can extract the content. Any pointers on what I am doing wrong? Wrong font configuration? Is it possible at all to extract content when custom fonts are used? Regards, Alexander Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: exact dimensions in apache fop
- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: [Barcode4j-users] barcode4j question
John, I still think this is a class loading problem. You didn't say what kind of server you're using. If, for some reasons, that server unpacks all application JARs into a commons local directory and loads the classes from there, it could possibily be so that Barcode4J's META-INF/services/org.apache.fop.fo.ElementMapping file overwrote the FOP one. That way, FOP doesn't find its own fo:* classes and that UnknownXMLObj might be explained. You could try to temporarily remove the Barcode4J FOP extension from the classpath and check if that changes anything. At any rate, you have to make sure the individual JARs are not merged without special handling for the META-INF/services files and that all of the JARs are associated with the same classloader(-hierarchy). On 06.12.2010 20:26:05 John Brady wrote: Hi, I have taken a clean version of fop.jar (FOP 0.95) from here: http://archive.apache.org/dist/xmlgraphics/fop/binaries/ I am still getting the same issue (error attached). It is throwing the error at the following call (method attached): transformer.transform(src, res); I am able to get it to work in eclipse under test conditions but when I deploy it to my UAT server it fail at the line above. I am thinking that I am missing a jar on UAT that eclipse may have included. Do you know what else could cause this issue? Best Regards, John Brady IT Specialist Aerlingus.com -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: 29 November 2010 21:09 To: John Brady Subject: Re: [Barcode4j-users] barcode4j question Hi John This smells like a class loading problem. I'd say that FOP hasn't found the file META-INF/services/org.apache.fop.fo.ElementMapping in the classpath. That usually doesn't happen. I can only imagine that you've unpacked fop.jar and repacked it in a different way so the plug-ins are not found. After all, the main ElementMapping services file is normally (!) in the same JAR as the ElementMappingRegistry. On 29.11.2010 20:27:23 John Brady wrote: Hi Jeremias, I am at the stage now where I am integrating the code into the booking engine. I am looking to pipe the document through into the HttpServletResponse directly by returning a byte array. My previous tests were successful when writing the contents directly to a pdf file including the barcode. Now when I try to use ByteArrayOutputStream I get the error attached (line 222 = transformer.transform(src, res);). I am using Fop 0.95. The function I am using to create the byte array is also attached in the code.txt document. Is there something obvious I am missing? Kind Regards, John Best regards, Jeremias Märki _ Jeremias Märki, Software-Development and Consulting Contact Information: http://www.jeremias-maerki.ch/contact.html Blog: http://www.jeremias-maerki.ch/blog/ ..For low fares and great deals on hotels, car hire and travel insurance visit http://www.aerlingus.com *** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any review, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.If you have received this email in error please notify the sender immediately and delete the material. *** Aer Lingus Limited Registered in Ireland Company Number 9215 Registered Office at Dublin Airport, Dublin,Ireland. *** Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Add-ons for Apache FOP
If you don't know the sizes of the images at design time, you'd probably have to write an XSLT plug-in that would pre-load the image using the image loading framework from Apache XML Graphics Commons. This should be quite fast at runtime but possibly not so quick to implement. On 03.12.2010 00:21:53 Lucian Opris wrote: Thank you again for the answer. Considering I'll use fo:external-graphic, is there easy way to determine page size in style? For large attachments (100 pages) having many fo:page-sequence will not slow down the rendering process? Thanks, Lucian Opris -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, December 02, 2010 2:07 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Add-ons for Apache FOP fox:external-document doesn't allow any additional content besides the full-page images. You'll have to determine the page sizes yourself and use normal fo:page-sequence elements to set up the image for full-page display. The PDF size increases that much because there is currently no easy way to cache the already transferred PDF objects so they are not transferred again for each page. I've experimented with that some time ago but had to disable that feature because of massive problems. I may revisit this at some point (no current plans). If you have to add larger PDFs to a document I suggest you do that as a post-processing step using Apache PDFBox. On 01.12.2010 21:45:05 Lucian Opris wrote: Also, I've noticed that without using fox:external-document the pdf size is about 17K then using fox:external-document to call a 608K PDF I've got a resulting 2.104K PDF. Do you know what could cause such a dramatic file increase? Lucian Opris -Original Message- From: Lucian Opris [mailto:lucian.op...@bluematrix.com] Sent: Wednesday, December 01, 2010 3:12 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Add-ons for Apache FOP Thank you Jeremias, I've added the fox:external-document src=C:/FOP1/fop-1.0/attachments/my.pdf/ to work in conjunction with new namespace xmlns:fox=http://xmlgraphics.apache.org/fop/extensions; and it worked fine. Now the question is can we stamp header and footers on external pdf called with fox since fox:external-document is peer with fo:page-sequence? Lucian Opris -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Wednesday, December 01, 2010 2:13 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Add-ons for Apache FOP Hi Lucian On 30.11.2010 20:35:48 Lucian Opris wrote: Hi Jeremias, I'm using your FOP add-ons to call PDF attachments as images using fo:external-graphic src=my-doc.pdf#page=1/. Is there a way to preserve pdf page size for landscape pages or should I use fox:external-document src=my-doc.pdf/? Support for landscape pages is available in the latest release (2.0.0) of the plug-in. Are PDFs with mixed pagesizes work with fox:external-document and have the footer stamping start at the same point from left? Not sure what you mean by that. With fox:external-document the target page will have the exact size of the respective input page. This should work for each page independently. 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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Add-ons for Apache FOP
Hi Lucian On 30.11.2010 20:35:48 Lucian Opris wrote: Hi Jeremias, I'm using your FOP add-ons to call PDF attachments as images using fo:external-graphic src=my-doc.pdf#page=1/. Is there a way to preserve pdf page size for landscape pages or should I use fox:external-document src=my-doc.pdf/? Support for landscape pages is available in the latest release (2.0.0) of the plug-in. Are PDFs with mixed pagesizes work with fox:external-document and have the footer stamping start at the same point from left? Not sure what you mean by that. With fox:external-document the target page will have the exact size of the respective input page. This should work for each page independently. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Filesize of Images
FOP does not do any resampling of images for PDF or PostScript output. Images are always embedded as is, i.e. in their original size. You could work around that by embedding the image inside a small SVG wrapper. But you need to apply a dummy filter to force Batik to do the resampling. Something like: svg:filter id=MyFilter filterUnits=objectBoundingBox x=0% y=0% width=100% height=100% svg:feColorMatrix type=hueRotate in=SourceGraphic values=0/ /svg:filter No guarantees on the quality of such an approach. On 25.11.2010 14:36:42 Peter Hancock wrote: On Thu, Nov 25, 2010 at 12:43 PM, JPee per...@softwareforen.de wrote: Hi JPee, Have you tried adjusting the default resoulation settings in your fop.xconf file (assuming you are using one- http://xmlgraphics.apache.org/fop/trunk/configuration.html#general-available)? Have a look at the source-resolution/target-resolution settings defined in http://xmlgraphics.apache.org/fop/trunk/configuration.html#general-elements I am not sure that any resizing can be done based on image resolution but setting the size and target-resolution will alter the file size. Pete Hello community, we are using FOP for rendering some pdf files from data. The pdf includes some images, which can be very big (up to 5mb). So the outcoming pdf with 3 images is about 15+ mb. Inside the pdf the images are shown in a lower solution. Is there a way that the imagesize is also scaled down dependant on imagesolution? To prevent big pdfs our editors must customize the images at the moment. Is this step really necessary? Thanks JPee -- View this message in context: http://old.nabble.com/Filesize-of-Images-tp30304887p30304887.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: Cropping output to content
Theoretically, XSL-FO supports page-height=indefinite on fo:simple-page-master: http://www.w3.org/TR/xsl11/#page-height But FOP doesn't support that, yet. In the meantime, you need to take two steps and inspect the area tree XML in the first step as Peter suggested. Or you post-process the area tree XML by changing the actual page height and run the result through the AreaTreeParser: http://xmlgraphics.apache.org/fop/1.0/intermediate.html#usage On 29.11.2010 09:44:41 Craig Ringer wrote: Hi all For the project I'm working on, I'm finding myself with the need to generate previews of partial (snippet) XSL-FO content for users. As part of that, I'm finding that I want to rubber band or clip the output so that excess white space is omitted. As I don't seem to see any way to make a page template contract to fit the content I suspect I'll be post-processing the area tree or the final output to crop it around the content. I'm just wondering if there's some obvious approach I might be missing. I'm not loving the idea of more area tree processing, though it's worked very well for the vertical space distribution problem I had a while ago. -- System Network Administrator POST Newspapers Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Renderable
I think you have two options: 1. Create a bitmap (with PNGDocumentHandler (image/png)) on the server and send that to the client. But you will likely have to produce your own viewer and cannot reuse FOP's preview dialog. 2. Generate the IF XML format on the server, send that to the client and use the org.apache.fop.cli.IFInputHandler to render the IF XML file in FOP's preview dialog. That at least does the layout part on the server, but if your document contains SVGs or barcodes, that part will still be processed on the client-side FOP. Please note that FOP's Renderable class is not the same as AWT's Renderable. And FOP has multiple implementations of it own Renderable interface in the org.apache.fop.cli package. If you want to off-load as much as possible to the server, you should pursue option 1. On 17.11.2010 17:16:08 Eric Douglas wrote: I'm creating an object of type org.apache.fop.render.awt.viewer.PreviewPanel. The constructor is (FOUserAgent foUserAgent, Renderable renderable, AWTRenderer renderer). I'm running a client-server program in webstart. Of course the PreviewPanel must be created as a client object. This works if I pass a null for Renderable, but also seems to require that I tie my AWTRenderer to a client Fop object to do a client transform. The transform runs a lot faster on the server. I was wondering if I can do the transform on the server and just pass the result into the client. That appears to be the purpose of the Renderable class. I don't see any FOP classes which return or implement a Renderable. How do I generate one? Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How to tell line# in input file that is generating error
Hi Steve Unfortunately, not all of FOP's error messages have the ability to report line numbers. The one you're seeing is a simple log message. So there is currently no way to display a line number even if the XSLT processor were able to supply the correct line number (using SAX's Locator interface). Essentially, you have to scan your FO/XSLT for uses of the .minimum and .optimum subproperties. Apparently, you're setting .optimum to a smaller value than .minimum in some places. On 18.11.2010 17:12:06 Steve Fogel wrote: Hi. Restating the question: Is there an option I can set that will have FOP either print out a line # with this range error message, or print out the FO input file as it processes it along with error messages so I can see where the errors occur? Thx for your reply. I am already doing what you suggest: Getting the intermediate FO-only file and passing it through FOP. These range error messages come out, but no line numbers are associated with them so there's no way to tell which FO's in the file are causing them. There are 100's of occurrences of the following in FOP 0.95 [fop] Nov 17, 2010 3:58:21 PM org.apache.fop.fo.properties.LengthRangeProperty checkConsistency [fop] SEVERE: forcing opt to min in LengthRange Thanks!! Steve snip/ Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Comments in xsl:fo
On 11.11.2010 18:30:40 Tom Browder wrote: I need to pass a comment or pi into my fo output from my docbook source. Is there any way to do that within the languages now? Is there such a thing as an xsl:fo comment? No, XSL-FO has no specific elements for comments. It provides the id property for most FO elements which are used to uniquely identify some element. Also, there is the role property that indicates what element name in the original XML document produced a certain FO element, but that doesn't identify an element uniquely. My motivation is to get docbook tables centered in print. The method shown on the fop site works for a specific table, but only if the actual table width is somehow passed to fo. A customization layer in db xsl works with that dimension hardwired but, until this newb figures out how to get the db xsl code working, I figure it's easier to post process the fo file. The best I can do to pass something that shows up in the fo file is via the xml:id attribute, but I would rather have a more general way to zero in on the specific table element and actual width. I could probably pass something like xml:id='tableX-actual-width-3in' and kludge it from there. In that case it seems to make more sense to investigate if you can produce a role property. Note that I have asked the db experts for xsl customization help. Thanks for any help or suggestions. HTH -Tom Thomas M. Browder, Jr. Niceville, Florida USA Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Embedding vs not embedding Times font
Salut Jean On 11.11.2010 20:46:37 jean duracel wrote: Dear reader, I encounter some problem with using the Times font and fop. I produce documents with special characters. By special characters I mean for example γ, ... greek technical characters. When I embedded this font, specials characters are displayed inside the pdf file but the find/copy doesn't work any more. This seems related to the CID effect associed to ttf font. Which FOP version are you using? Currently FOP versions should do that correctly. As this font should be inside the reader, I thought it was not necessary to embedded it. But if I do that, special characters are not display inside my reader, in fact they are replaced by a # character. Yes, our base14 Times font only supports the WinAnsi 8-bit encoding. It's a good idea to embed the font, except if there are particular reasons not to. I thought it might be related to a reader problem, then I decompress the pdf file and dig inside it and was surprised to found that the character was replaced by a #. That happens by FOP if a particular glyph is not available for a Unicode character. You should also get warnings in the FOP log. Your comments and help will be welcome ! Thanks in advance. Jean HTH Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Font-scaling?
+1 but in reality, they won't listen. But you can always try. ;-) On 12.11.2010 13:58:18 Eric Douglas wrote: Not in this business. Sometimes you have to learn to tell them that's a bad idea. Sometimes they just don't know what they're talking about. Just tell them to do it properly and use a fixed width font. -Original Message- From: Ancient [mailto:hara...@hotmail.com] Sent: Friday, November 12, 2010 7:02 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Font-scaling? Hi! I know that's evil and personally I'd never use that by myself. But if my customers want to use that in their web-projects, well.. The customers are always right, aren't they.. ;) Mika Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: PDF tagging structure
Hi MazZzta, FOP does not add the P by itself. As Vincent said: you have an fo:block right under fo:flow and the other elements inside that. If you want it to go away, you have to change your XSLT so it doesn't produce that fo:block as the parent for all other FO elements. There's no way to tell FOP otherwise not to generate this tag. On 12.11.2010 14:15:52 MazZzta wrote: Hi Vincent, thanks for your quick reply. I am aware that deleting the fo:block element in the FO file may do the job. However I'd prefer not editing the FO file unless it is absolutely necessary, as it is said in the Apache FOP documentation online, which encourages not to produce a FO file during transformation if you can get by without it (and I can get by without it). So my question now is: Is it possible to make fop removing that fo:block at some point before the XSL:FO transformation? Somewhere in the code? or in the mapping? It seems that FOP adds it by default, and that's what I'd like to modify. Thanks! On Thu, Nov 11, 2010 at 4:40 PM, Vincent Hennebert vhenneb...@gmail.comwrote: Hi MazZzta, In the default configuration only fo:block produces a P tag. So in your FO file you must have an fo:block element as the first child of the fo:flow, surrounding the rest of the content. Just remove it and that should do. HTH, Vincent On 10/11/10 16:23, MazZzta wrote: (Using FOP Trunk) Hi all, I'm working with FOP embedded in a Java application to generate PDF files with accessibility features enabled. I've set everything up an it works pretty well. Further, I've customized the mapping so that I can map whatever structure tag I need (H1, H2... etc). However my question is about the tagging generated by FOP after the transformation is complete. I open the PDF file with a viewer (Particularly Adobe Professional 9) and take a look to the tagging tree. I see something like this: Document Part Sect P L H1 ... ... As you can see, the main tagging of the document hangs from a P tag that is generated always from scratch. Even if I transform a blank document it still builds up this tagging structure, hanging the whole tagging from a P tag, which in this last case it's empty. Would it be possible to omit that P tag and make the whole structure to hang from the Sect tag? Like: Document Part Sect L H1 ... ... I've tried different ideas via XSL, yet I can't get rid of this 'annoying' P tag. :D Just wondering if someone else has this problem and could help me out. Thanks a lot, MazZzta Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Font-scaling?
BTW, there is a Bugzilla entry with a patch for font-stretch which hasn't been processed, yet: https://issues.apache.org/bugzilla/show_bug.cgi?id=42577 I haven't had the chance to look at the updated patch, yet (Sorry, Martin). On 10.11.2010 16:02:21 Maxime Bégnis wrote: Hi, There is a FO property font-stretch(http://www.w3.org/TR/xsl/#font-stretch) which is not supported by FOP(http://xmlgraphics.apache.org/fop/compliance.html#fo-property-font-stretch). I would have liked to do the same thing but I didn't find any solution. Maxime Bégnis [NeoDoc] NeoDoc Maxime Bégnis Développeur max...@neodoc.biz Tél: 09.54.96.99.55 - Fax: 09.59.96.99.55 http://www.neodoc.fr/ 5, rue de la Touloubre 13770 Venelles Le 10/11/2010 14:15, Eric Douglas a écrit : To make a fixed width font out of a variable width font? Why not just use a fixed width font? I would think stretching a variable width font to make all the characters the same width and height would be a pain, as I can only guess they'd have to be converted to images and stretched to fit. Maybe there's an easier way. -Original Message- From: Ancient [mailto:hara...@hotmail.com] Sent: Wednesday, November 10, 2010 6:39 AM To: fop-users@xmlgraphics.apache.org Subject: Font-scaling? Hi! Is it possible in fop 1.0 to scale the font's letters horizontally, like in many softwares, for example InDesign's Horizontal Scale -option? Any help appreciated! -- View this message in context: http://old.nabble.com/Font-scaling--tp30179665p30179665.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
[ANN] PDF image plug-in for Apache FOP version 2.0 released
I'd like to announce the availability of the version 2.0 of the PDF image plug-in for Apache FOP. The plug-in enables Apache FOP to include PDF pages as images using the fo:external-graphic and fox:external-document elements. For PDF output, the PDF content is transferred natively to the target PDF file, thus preserving most features of the original PDF file. For other output formats, Apache PDFBox is used to render the pages as Java2D graphics. Download the source and binary distributions here: http://www.jeremias-maerki.ch/development/fop/index.html (available under the Apache License v2.0, just like Apache FOP) A selection of changes in version 2.0: - Moved from PDFBox (org.pdfbox) to Apache PDFBox (org.apache.pdfbox). The plug-in now requires at least J2SE 1.5! - Added an ImageConverter that extends Apache XML Graphics Commons' image loader framework with a converter from PDFBox to Java2D. This enables PDF display for all of FOP's output formats. - Added limited support for AcroForms (PDF forms). - Added an on-load hook to decrypt a PDF. - ...plus many bugfixes. Please consult the README file in the distribution for more details. Best regards, Jeremias Märki _ Jeremias Märki, Software-Development and Consulting Contact Information: http://www.jeremias-maerki.ch/contact.html Blog: http://www.jeremias-maerki.ch/blog/ pgpjOnqokl43t.pgp Description: PGP signature
Re: Can't get RTF page break working
- 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 - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: overflow of fixed block-container
Hi Matthias Difficult to say. It's definitely not easy, especially if you're not yet familiar with the layout engine. Flow Map introduces the ability to have multiple flow which all have their own column and page breaks. I think someone has started flow maps in the past but didn't get far (just some FO classes I think). You might want to check the archives. Flow Maps would definitely be a great feature for many. But you'd be in for a non-trivial project. I wouldn't dare make an effort estimation. But it would be great if you could jump in here. On 21.10.2010 18:35:19 MatthiasR wrote: Hi Jeremias, do you think it would be very complicated to implement flow maps? I might have clients which are interested in this feature. Regards, Matthias Jeremias Maerki-2 wrote: Hi Russel, what you're looking for is essentially the flow-map feature of XSL 1.1, I believe. That allows you to define multiple flow regions where content can flow from one page to the other. Absolutely/fixed positioned block-containers can't overflow to the next page. Only block-containers with absolute-position=auto (the default) can do that. The problem: FOP doesn't implement flow-maps, yet. - Flow Map Examples: http://www.w3.org/TR/xsl11/#d0e7194 - fo:flow-map: http://www.w3.org/TR/xsl11/#fo_flow-map - fo:block-container: http://www.w3.org/TR/xsl11/#fo_block-container - absolute-position property: http://www.w3.org/TR/xsl11/#absolute-position - overflow property: http://www.w3.org/TR/xsl11/#overflow (see description of the repeat value) On 21.10.2010 01:30:08 Russell Levy wrote: Hi, I have a simple document with three block-containers, each with a fixed position on the page, aligned horizontally (page split into three parts). When the top block-container overflows, I want the overflow to go to a new page (with the other two areas of the page blank). Is that possible? I could post code if that's helpful. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/overflow-of-fixed-block-container-tp30014969p30021286.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: overflow of fixed block-container
Hi Russel, what you're looking for is essentially the flow-map feature of XSL 1.1, I believe. That allows you to define multiple flow regions where content can flow from one page to the other. Absolutely/fixed positioned block-containers can't overflow to the next page. Only block-containers with absolute-position=auto (the default) can do that. The problem: FOP doesn't implement flow-maps, yet. - Flow Map Examples: http://www.w3.org/TR/xsl11/#d0e7194 - fo:flow-map: http://www.w3.org/TR/xsl11/#fo_flow-map - fo:block-container: http://www.w3.org/TR/xsl11/#fo_block-container - absolute-position property: http://www.w3.org/TR/xsl11/#absolute-position - overflow property: http://www.w3.org/TR/xsl11/#overflow (see description of the repeat value) On 21.10.2010 01:30:08 Russell Levy wrote: Hi, I have a simple document with three block-containers, each with a fixed position on the page, aligned horizontally (page split into three parts). When the top block-container overflows, I want the overflow to go to a new page (with the other two areas of the page blank). Is that possible? I could post code if that's helpful. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FopFactory#newFop(...) performance with auto-detect enabled for fonts
Hi Tor, that's a known problem. FOP's current font infrastructure does not split font metrics (static) and font subset information (dynamic per document). That's the biggest obstacle to making auto-detection not repeat itself for every new document. On 19.10.2010 23:08:09 Tor-Einar Jarnbjo wrote: Hi, I'm using FOP 1.0 in a situation where it would be most convenient to load font files from the application's classpath. Adding an auto-detect element to the font configuration enables this functionality and FOP is able to find my fonts, after I declared the content type for the font files in the manifest file. After enabling the auto-detect feature, the creation of a new Fop instance with the factory's newFop method turns out to be very slow (appr 400ms with font caching enabled, 2.500ms with the cache disabled). I've debugged the code and it seems as if both the system font diretory, as well as all manifest files in the classpath are scanned for suitable fonts every time I create a Fop instance. On Windows, this even means that Fop starts a new cmd.exe process just to read an environment variable! Enabling font loading from the classpath without searching the system font directory as well is obviously not possible, since both features are enabled with the same configuration option ... Shouldn't the font cache be initialized when creating the FopFactory (here the penalty is acceptable), so that each created Fop instance could use the factory's font cache? Or am I doing something wrong? Regards, Tor Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Output instead instead of amp;lt; in pdf
That's double XML escaping which means somewhere in your process you have a bug concerning the consumption of XML. What may have happened: Someone built a DOM document and then inserted the Twitter XML as Text into the document rather than building another DOM tree from the Twitter XML and importing that into the first DOM. But that's just one example how this could have happened. Without knowing how you wrote your code to make this happen it's difficult to help. On 30.09.2010 21:11:24 theinvader wrote: I'm using xml from twitter which contains amp;lt; for and amp;gt; for . My pdfs come out with lt; instead of . This is because it should be lt; in the xml rather than amp;lt;. Is there an easy way to get fop to write the entity amp;lt; to the pdf as ? -- View this message in context: http://old.nabble.com/Output-%3C-instead-instead-of--amp-lt--in-pdf-tp29851461p29851461.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: FOP 1.0 TIFF Image Black Pages and Poor Image Quality
That sounds like the config file is not loaded at all. Have you tried running the document from the command-line using the -c parameter? If the config file is malformed, something like this can also happen but you've already posted your config and that seems to be fine. Please also check FOP's log output for possible hints. On 10.10.2010 22:17:28 paulnnosh wrote: Hi, I have attached a copy of my generated TIFF. Note, if I remove transparent-page-background from my config it makes no difference. If I set the resolution and compression via the code (via TIFFRenderer), rather than via a config file the image quality is much improved. I can't explain this! Thanks Jeremias Maerki-2 wrote: I've produced the attached TIFF image with FOP Trunk (pretty much equivalent to FOP 1.0) with practically the same configuration as you, except for the transparent-page-backgroundtrue/transparent-page-background which you should remove. If by poor quality you mean the bi-level rendering by using a lightness threshold, that could be improved by rendering the bitmap internally in gray scales and then rasterize it using Bayer or error-diffusion rastering. We have code for that but it's not tied into the bitmap renderers and it would also cost a lot of performance and allow much poorer compression levels. Maybe you should post an image to demonstrate what you consider poor quality. On 05.10.2010 00:25:27 paulnnosh wrote: To add some additional information. I have now downgraded to 0.95 and while the black pages have gone the image quality is still very bad. I noticed that the log output states: 04-Oct-2010 21:30:56 org.apache.fop.render.java2d.Java2DRenderer getPageImage INFO: Rendering Page 1 (pageWidth 595, pageHeight 842) Which if I'm not mistaken is only 72dpi for an A4 page. I have set the target-resolution to 200dpi so I don't understand why the image is so bad. Thanks again... paulnnosh wrote: Hi, I'm using FOP 1.0 with Java 1.4 (I know, I know! I'm stuck with it for now). I'm using FOP to convert XML into a CCITT T.6 compressed TIFF. With the config file below the output TIFF files are just coloured black. I can remove the transparent-page-background tag and that produces an image but the quality is very very poor. I have Imageio version 1.1 on my classpath. My config is as follows: fop version=1.0 source-resolution72/source-resolution target-resolution200/target-resolution renderers renderer mime=image/tiff transparent-page-backgroundtrue/transparent-page-background compressionCCITT T.6/compression /renderer /renderers /fop Can anyone shed any light on what the problem is here please? Any help much appreciated. Many Thanks -- View this message in context: http://old.nabble.com/FOP-1.0-TIFF-Image-Black-Pages-and-Poor-Image-Quality-tp29881437p29882800.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 http://old.nabble.com/file/p29929378/C25C%2B-%2Bpoor%2Bquality.tiff C25C+-+poor+quality.tiff -- View this message in context: http://old.nabble.com/FOP-1.0-TIFF-Image-Black-Pages-and-Poor-Image-Quality-tp29881437p29929378.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: PCL duplex
On 08.10.2010 14:33:52 David Hurcomb wrote: On 08/10/2010 12:55, Jeremias Maerki wrote: FOP uses thelnS command to enable duplex mode. But that may not be the right command for all printers. If you post the exact model name of the two printers, I'll download the tech manuals and take a look. Maybe they need some special command to actually do duplex. I have tried my main printer is a Kyocera (FS-9130DN) they push you towards printing using their own PRESCRIBE language , but it does use PCL emulator (set up by the PRESCRIBE command !R!SIR2;EXIT;) There seems to be some level of auto-sensing, so the exit command should probably not be necessary. Anyway, I didn't find any PCL-specific information in the manuals concerning duplex printing. You could also generate two simple duplex documents with the printers' drivers and send them to me. That might allow me to reverse engineer the required commands. I have created the attached from notepad.exe - is there a better way (on MS)? I had expected to see the PRESCRIBE code DUPX1 or DUPX2 for long edge and short edge respectively. Notepad should be fine as long as you get two pages. But apparently, that printer driver produced PCL-XL/PCL6 rather than PCL 5 which FOP produces. What I did find out is that there is a PJL command that allows to control duplexing. But FOP currently has no facility to add custom PJL commands. You could try to insert them by hand for a test. @PJL SET DUPLEX=ON @PJL SET BINDING=LONGEDGE No guarantees that it'll work. Another possibility you could investigate is to print against the printer's native driver using FOP's print renderer. The Java Printing API offers to control a wide range of parameters. But again, I cannot guarantee a good outcome. There should be numerous tutorials on the Java Printing API on the net. Good luck! Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problem FOP 1.0: “WARNING: Glyph ...(Cyrillic symbol)... not available in font Times-Italic.”
Hi Alex, unfortunately, you left out the interesting parts of the configuration, namely the parent element of the font-triplets. Anyway, you need to configure a font that has the cyrillic characters you require. Try to use a font name other than Times New Roman or serif which are already configured for the base 14 font set (which includes Times). But the base 14 fonts don't have the cyrillic characters. So you need a custom font with cyrillic characters. With a TrueType font you have the best change of success, but I've also created documents with cyrillic characters using Type 1 fonts. Good luck! On 10.10.2010 18:28:13 Alex Smirnov wrote: Hi I call FOP specifying a config file which defines the fonts and where they are: ... baseC:/Pro/xml/fop//base font-baseC:/Pro/xml/fonts//font-base ... ... font-triplet name=Times New Roman style=normal weight=normal/ font-triplet name=serif style=normal weight=normal/ ... ... but FOP used embedded “Times font” with no support Cyrillic symbol Thanks. Regards. P.S. Sorry, but my English not good -- View this message in context: http://old.nabble.com/Problem-FOP-1.0%3A-%E2%80%9CWARNING%3A-Glyph-...%28Cyrillic-symbol%29...-not-available-in-font-%22Times-Italic%22.%E2%80%9D-tp29928240p29928240.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: PCL duplex
FOP uses the lnS command to enable duplex mode. But that may not be the right command for all printers. If you post the exact model name of the two printers, I'll download the tech manuals and take a look. Maybe they need some special command to actually do duplex. You could also generate two simple duplex documents with the printers' drivers and send them to me. That might allow me to reverse engineer the required commands. On 08.10.2010 12:52:17 David Hurcomb wrote: I would appreciate some help please. I would _really_ like to print in duplex mode. It looks possible from the docs (V1.0). After trying and failing in my complicated document I went back to first principles and modified the example simple.fo adding the following to fo:root xmlns:pcl=http://xmlgraphics.apache.org/fop/extensions/pcl; And the following to simple-page-master master-name=duplex pcl:duplex-mode=2 Then I altered the master-reference fo:page-sequence master-reference=duplex and copied the fo:block enough times to roll over to 2 pages. I generated the pcl from the command line. fop -fo duplex.fo -pcl output.pcl Then I sent the PCL output to a Kyocera duplex printer and a Xerox duplex printer but both printers gave me 2 sheets. (Although the Kyocera seemed to run the first sheet through the duplexer but leave the back blank). Am I missing something. Thanks sincerely David Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP - AFP Rendering in OCR-B
: Resource not found: T1000893 at org.apache.fop.render.afp.AFPRendererConfigurator.toConfigurationException(AFPRendererConfigurator.java:284) at org.apache.fop.render.afp.AFPRendererConfigurator.fontFromType(AFPRendererConfigurator.java:209) at org.apache.fop.render.afp.AFPRendererConfigurator.buildFont(AFPRendererConfigurator.java:138) at org.apache.fop.render.afp.AFPRendererConfigurator.buildFontListFromConfiguration(AFPRendererConfigurator.java :316) at org.apache.fop.render.afp.AFPRendererConfigurator.setupFontInfo(AFPRendererConfigurator.java:489) ... 13 more Caused by: java.io.FileNotFoundException: Resource not found: T1000893 at org.apache.fop.afp.util.DefaultFOPResourceAccessor.createInputStream(DefaultFOPResourceAccessor.java:72) at org.apache.fop.afp.fonts.CharacterSetBuilder.openInputStream(CharacterSetBuilder.java:162) at org.apache.fop.afp.fonts.CharacterSetBuilder.loadCodePage(CharacterSetBuilder.java:309) at org.apache.fop.afp.fonts.CharacterSetBuilder.build(CharacterSetBuilder.java:222) at org.apache.fop.render.afp.AFPRendererConfigurator.fontFromType(AFPRendererConfigurator.java:206) ... 16 more - org.apache.avalon.framework.configuration.ConfigurationException: Failed to load the character set metrics C0A08090 with code page T1000893. I/O error: Resource not found: T1000893 at org.apache.fop.render.afp.AFPRendererConfigurator.toConfigurationException(AFPRendererConfigurator.java:284) at org.apache.fop.render.afp.AFPRendererConfigurator.fontFromType(AFPRendererConfigurator.java:209) at org.apache.fop.render.afp.AFPRendererConfigurator.buildFont(AFPRendererConfigurator.java:138) at org.apache.fop.render.afp.AFPRendererConfigurator.buildFontListFromConfiguration(AFPRendererConfigurator.java :316) at org.apache.fop.render.afp.AFPRendererConfigurator.setupFontInfo(AFPRendererConfigurator.java:489) at org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:165) at org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:181) at org.apache.fop.area.RenderPagesModel.init(RenderPagesModel.java:73) at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:130) at org.apache.fop.area.AreaTreeHandler.init(AreaTreeHandler.java:102) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:359) at org.apache.fop.fo.FOTreeBuilder.init(FOTreeBuilder.java:105) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:101) at org.apache.fop.apps.Fop.init(Fop.java:79) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:109) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: java.io.FileNotFoundException: Resource not found: T1000893 at org.apache.fop.afp.util.DefaultFOPResourceAccessor.createInputStream(DefaultFOPResourceAccessor.java:72) at org.apache.fop.afp.fonts.CharacterSetBuilder.openInputStream(CharacterSetBuilder.java:162) at org.apache.fop.afp.fonts.CharacterSetBuilder.loadCodePage(CharacterSetBuilder.java:309) at org.apache.fop.afp.fonts.CharacterSetBuilder.build(CharacterSetBuilder.java:222) at org.apache.fop.render.afp.AFPRendererConfigurator.fontFromType(AFPRendererConfigurator.java:206) ... 16 more -Original Message- From: Peter Weber [mailto:peter.we...@garaio.com] Sent: Montag, 4. Oktober 2010 14:48 To: fop-users@xmlgraphics.apache.org Subject: FOP - AFP Rendering in OCR-B Hi FOP users One Question as simple as possible. How do I configure OCR-B font in FOP for the AFP Renderer? It would be very great if You can tell me which CodePage, Caractersets, Encoding etc., I need to submit in the fop.xconf. I need to use OCR-B font in an AFP Document. Last week I have posted a similar Problem but I think I've lost myself in the problem, there: http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/201010.mbox/browser Thank You very much for Your help Peter Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: AW: AW: AW: Identifying absolute position of a FO:Block
bpd=11100 ipda=594720 bpda=14400 bap=0 0 0 0 space-before=1650 space-after=1650 inlineparent ipd=38688 bpd=11100 ipda=38688 bpda=11100 bap=0 0 0 0 offset=0 text offset=0 baseline=8616 ipd=38688 bpd=11100 ipda=38688 bpda=11100 bap=0 0 0 0 font-name=sans-serif font-style=normal font-weight=400 font-size=12000 color=#00 word offset=0testtext/word /text /inlineparent /lineArea /block /block /flow /mainReference footnote top-offset=0/ /regionBody /regionViewport /page /pageViewport /pageSequence /areaTree Now look for the block element with attribute prod-id=block-to-find. That's your target block. As Craig said, if the block spans more pages, there may be more than one block with this attribute. Now you can get the width of the block (attribute ipd) and the height (attribute bpd). Use ipda and bpda if you need the padding, too. Also see http://wiki.apache.org/xmlgraphics-fop/AreaTreeXMLDocumentation or search this mailing list for area tree. For the block's position in the page, add the height of all previous blocks in the page. Regards, Georg Datterl -- Kontakt -- Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH:www.irs-nbg.de Willmy PrintMedia GmbH:www.willmy.de Willmy Consult Content GmbH: www.willmycc.de -Ursprüngliche Nachricht- Von: Craig Ringer [mailto:cr...@postnewspapers.com.au] Gesendet: Dienstag, 5. Oktober 2010 02:35 An: fop-users@xmlgraphics.apache.org Cc: mithunk Betreff: Re: AW: Identifying absolute position of a FO:Block On 4/10/2010 11:28 PM, mithunk wrote: Thanks Georg, I am new to FOP. Can you please help me with how to calculate the position by giving a block id. I modified my XSL with a block id (for a field), now dont know how to calculate the position. METHOD 1: Use fop to produce the intermediate area tree output from your XSL-FO. See the documentation for details on that. Once you have the area tree, use xpath to find the block. IIRC the id will be in the 'prod-id' attribute of the block(s) generated. If it's broken across a page, column, etc there may be more than one element generated. Once you've found the element(s) you should be able to work out the position from the positioning attributes them and their parent elements. It's possible that the new intermediate format (IF) is better than the area tree for this, but I haven't worked with it much so all I can suggest is generating it, looking at it, and seeing if it's useful. I have the feeling the new IF doesn't include element IDs, but I may be misremembering. -- Craig Ringer Tech-related writing at http://soapyfrogs.blogspot.com/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/Identifying-absolute-position-of-a-FO%3ABlock-tp29858679p29890837.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 -- View this message in context: http://old.nabble.com/Identifying-absolute-position-of-a-FO%3ABlock-tp29858679p29900934.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 Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP 1.0 TIFF Image Black Pages and Poor Image Quality
I've produced the attached TIFF image with FOP Trunk (pretty much equivalent to FOP 1.0) with practically the same configuration as you, except for the transparent-page-backgroundtrue/transparent-page-background which you should remove. If by poor quality you mean the bi-level rendering by using a lightness threshold, that could be improved by rendering the bitmap internally in gray scales and then rasterize it using Bayer or error-diffusion rastering. We have code for that but it's not tied into the bitmap renderers and it would also cost a lot of performance and allow much poorer compression levels. Maybe you should post an image to demonstrate what you consider poor quality. On 05.10.2010 00:25:27 paulnnosh wrote: To add some additional information. I have now downgraded to 0.95 and while the black pages have gone the image quality is still very bad. I noticed that the log output states: 04-Oct-2010 21:30:56 org.apache.fop.render.java2d.Java2DRenderer getPageImage INFO: Rendering Page 1 (pageWidth 595, pageHeight 842) Which if I'm not mistaken is only 72dpi for an A4 page. I have set the target-resolution to 200dpi so I don't understand why the image is so bad. Thanks again... paulnnosh wrote: Hi, I'm using FOP 1.0 with Java 1.4 (I know, I know! I'm stuck with it for now). I'm using FOP to convert XML into a CCITT T.6 compressed TIFF. With the config file below the output TIFF files are just coloured black. I can remove the transparent-page-background tag and that produces an image but the quality is very very poor. I have Imageio version 1.1 on my classpath. My config is as follows: fop version=1.0 source-resolution72/source-resolution target-resolution200/target-resolution renderers renderer mime=image/tiff transparent-page-backgroundtrue/transparent-page-background compressionCCITT T.6/compression /renderer /renderers /fop Can anyone shed any light on what the problem is here please? Any help much appreciated. Many Thanks -- View this message in context: http://old.nabble.com/FOP-1.0-TIFF-Image-Black-Pages-and-Poor-Image-Quality-tp29881437p29882800.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki attachment: images.fop.trunk.tif - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Postscript - Helvetica
The built-in Helvetica (part of the base 14 set) only supports WinAnsi encoding as you noticed. If you explicitely configure and embed the Helvetica Type 1 font, I expect FOP to handle all characters/glyphs found in the font file. You'd need to add the following to your config file: font embed-url=file:///C:/myfonts/HV__.PFB font-triplet name=Helvetica style=normal weight=normal/ /font On 06.10.2010 13:02:04 Bogusław Fries wrote: Hi, I have the following problem. In the xml file I have ( polish characters ) #8230;#8230; ReportHeader date06-08-2009 10:22:01/date courierNameąćęłńóśżź ĄĆĘŁŃÓŚŻŹ /courierName courierCodeRB8WA1/courierCode depot1305/depot documentTypeD/documentType /ReportHeader #8230;#8230;. In xsl transformate I use font-family=#8221;Helvetica#8221; My fop configuration: #8230; renderer mime=application/postscript auto-rotate-landscapetrue/auto-rotate-landscape fonts /fonts /renderer #8230;. I am using fop version 1.0 I did the fop transformation into POSTSCRIPT format. Instead of ąćęłńóśżź ĄĆĘŁŃÓŚŻŹ I got #ó### #Ó### unfortunately. So, I tried to solve this making some changes in the source code. I made in src/codegen/fonts some changes and now is everything fine. Here is my CEEncoding ( from the postscript output ) /CEEncoding [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /minus /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /tilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /Sacute /.notdef /.notdef /Zacute /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /sacute /.notdef /.notdef /zacute /space /.notdef /breve /Lslash /currency /Aogonek /.notdef /dieresis /.notdef /Scaron /Scedilla /Tcaron /Zacute /hyphen /Zcaron /Zdotaccent /degree /aogonek /ogonek /lslash /acute /lcaron /.notdef /caron /cedilla /aogonek /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla /Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron /Eth /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply /Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcedilla /germandbls /racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla /ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron /eth /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide /rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcedilla /dotaccent ] def After compilation and use the compiled version I got proper output : ąćęłńóśżź ĄĆĘŁŃÓŚŻŹ Of course I cannot use such a fop version in the producton environment. So, my question is: how to configure the fop to obtain proper encoding? Boguś Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: PDF\A-1a compliance check when fo file contains basic-links
Hi Peter, I've gone through a very simple example and I've been able to reproduce it with that older Acrobat version I have access to. However, going through the generated structures I cannot see anything that strikes me as wrong. I've also used another PDF/A validator (PDFTron PDF/A Manager) which barks at something in the XMP metadata but not about the link. I know from experience that Acrobat cannot be trusted when it comes to the PDF preflight functionality. And as always, Acrobat's error messages are completely unhelpful. So at this point, I'm unsure whether this is really a FOP problem or an Acrobat problem. I've attached this case in case anyone else here has a different PDF/A validator he can check with. On 30.09.2010 10:45:16 Peter Kester wrote: Hi, I am in the process of generating PDF\A-1a compliant PDF but I think I ran into a bug. When the fo file contains something like this: fo:basic-link external-destination=url(www.google.com)Google.com/fo:basic-link I can generate a PDF\A-1a compliant docuyment but when I try to validate in Adobe Acrobats Preflight I get the following error message: 'An error occurred while parsing a contents stream. Unable to analyze the PDF file.' When I disable the basic-link everything works like a charm. Best regards, Peter Kester Jeremias Maerki pdfa-sandbox.fop.trunk.pdf Description: Binary data - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: xsl fo errors and line numbers
Even in the latest Xalan version, this feature doesn't seem to work although it's mentioned in Xalan's docs. You could try another XSLT processor which might provide the required Locator data. Otherwise, proceed as Jörg indicated. At any rate, if the XML source provides Locator information, FOP will display it. XML parsers usually do. For XSLT processors, this trick is a bit harder. On 27.09.2010 21:41:07 thandana wrote: Hi All, Any help is greatly appreciated. I am using Apache Xalan 2.7.1, FOP .95 to generate pdf docs. The only issue is when i have an error in xsl-fo document, i am not seeing line numbers in the error message. What should be done to get the exact line # in xsl-fo document that is causing the error? I am using code like this but no use. transformFactoryInstance.setAttribute(TransformerFactoryImpl.FEATURE_SOURCE_LOCATION, Boolean.TRUE); Thanks Rathana. -- View this message in context: http://old.nabble.com/xsl-fo-errors-and-line-numbers-tp29822450p29822450.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: PDF 1.7 ISO 32000
FOP can handle all the listed languages but as Glenn mentioned: this is is not a question of PDF version. PDF 1.4 will do just fine. On 29.09.2010 09:07:37 Daniel Sánchez González wrote: We need oficial European Union languages (maybe not all, but most of them). They are: Bulgarian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Irish, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovene, Spanish and Swedish. On Tue, Sep 28, 2010 at 2:19 AM, Glenn Adams gl...@skynav.com wrote: probably more pdf readers support 1.4 than 1.7; also, PDF 1.7 does not have any particular features that 1.4 does not have that relate to multiple language support; which languages do you require support for? regards, glenn 2010/9/27 Daniel Sánchez González dsanch...@gmail.com We need multi-language support. We want to create ISO 32000 because it is standar and we think that it can be viewed in any browser. Is it correct? On Mon, Sep 27, 2010 at 10:10 AM, Peter Hancock peter.hanc...@gmail.comwrote: Hi Daniel, PDF support in FOP is currently limited to 1.4 - see FOP http://xmlgraphics.apache.org/fop/trunk/output.html#pdf I am not sure if there are any community plans to support later version of the format in the near future. Are there any specific features that have been introduced in the later versions that you require in particular? Peter 2010/9/26 Daniel Sánchez González dsanch...@gmail.com: Is it possible to create a 1.7 pdf version (ISO 32000) with apache fop? Thanks in advance, Daniel Sánchez - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Question on FOP Table between pages
By default, border-after-width.conditionality is discard which omits the border line at a break. You can set border-after-with.conditionality=retain and the border will appear again. Same on border-before-with on the top of the following page. See: http://www.w3.org/TR/xsl11/#border-after-width On 28.09.2010 21:11:40 Anil Pinto wrote: Hello, We have been using FOP in our solution for quite a few years now and are very pleased with the product! I have a question pertaining to the recently release version 1.0 We have noiticed that when creating documents with tables, if the table expands tro the next page, in previous versions if the table breaks in between a row, the row on the curent page ends with a horizontal line and the table then continues with a header on the next page, followed by the rest of the contents of the row below the header. In the new version, the current page row does not seem to end with a horizontal line i.e. it seems like the text is just hanging. The rest of the behavior is the on the next page is as in the older version. Is there a way we can get FOP to show that horizontal line that it previously did in older versions? Here is kind of a visual indication (in text format) to help describe what I see. FOP 1.0 # Current Page = +-+ | Head1| Head2| +-+ | Row 1 | | | | | |--|--| | Row 2 | | | | | There is no terminator line. Next Page = +-+ | Head1| Head2| +-+ | Row 2 | | |--|--| |: |: | FOP (older) # Current Page = +-+ | Head1| Head2| +-+ | Row 1 | | | | | |--|--| | Row 2 | | | | | +--|--+ This line is missing in the newer version for the same XSL Next Page = +-+ | Head1| Head2| +-+ | Row 2 | | +--|--| |: |: | I am sorry I have not included the XML and XSL due to customer data confidentiality restrictions. If absolutely required I will have to make some time and do a lot of cleaning before I can pass those along. Any suggestions to get that line in there is greatly appreciated. Thank you, Anil Pinto. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Postscript parser
What do you mean by postscript parser? A PostScript interpreter or a DSC parser like this one? http://xmlgraphics.apache.org/commons/postscript.html#dsc On 22.09.2010 00:56:49 Martin Edge wrote: Ah beautiful! Have already written a postscript parser, but will try this and pull it out :-) Thanks Chris :-) --- On 22/09/2010, at 12:33 AM, Chris Bowditch bowditch_ch...@hotmail.com wrote: Martin Edge wrote: Hey Guys, Hi Martin, snip/ Up till now, this has served me well, and larger commercial printers have no quams in dealing with the output. However, today, whilst trying to print on our FujiXerox ApeosPort 650I (I'd say a SME sized printer) - the duplex functions were not working correctly. This turned out to be because the printer is finicky enough to have a problem if on the reverse side of a duplex set, the PageSize is defined, it ignores the request completely. I found if I remove the offending Page Size (and other codes I may have added), the process works. Actually this problem is not only limited to the Printer model you mention. I have encountered this behaviour on about 50% of all PS Printers. To solve this problem we added an option to FOP to only put entries into the pagedevice dictionary, such as the /PageSize entry, when they change. This option is rather cryptically named dsc-compliant. If you add the following element to the PS Renderer section of fop.xconf you should find that duplex starts working again! dsc-compliantfalse/dsc-compliant Thanks, Chris This is the offending section: %FOPBeginSetPageDevice /PageSize [595 842] /ImagingBBox null setpagedevice %FOPEndSetPageDevice So; if I attempt to remove the width/height attributes from the page definition within the page sequence, as per below; page index=0 name=1 page-master-name=basicPage width=595275 height=841889 The FOP parser gets narky with me and talks about a number format exception ( I assume translating the lack of width/height to output ): javax.xml.transform.TransformerException: java.lang.NumberFormatException: null at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:302) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: javax.xml.transform.TransformerException: java.lang.NumberFormatException So, the rhetorical part of the question is - is it worth trying to modify FOP (and would I have my fingers removed) to deal with the lack of a width/height in the transformer to Postscript, or am I forced to write a secondary post processor on the PostScript file to look for a duplex, and then remove those lines for the following page? Hopefully, this makes sense. Thanks Martin - 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 - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org