Column balancing issue
I am noticing some white space in the last two pages of a PDF document that I am trying to render using 0.94. Also, the columns are not balanced properly (using dual column layout). The weird thing about this test is that the problem disappears once I reduce some text in the .FO file. The only suspicious message I see during rendering is as shown below: Nov 12, 2007 5:05:04 PM org.apache.fop.layoutmgr.PageBreaker doPhase3WithColumnBalancing WARNING: Breaking algorithm produced more columns than are available. I tried to cut down the .FO file to recreate the issue but could not do so. The file is about 692 Kb and hence I am hesitant to attach it, unless needed. Any idea what might be causing this? Thanks, Kumar Puppala
RE: Images not resized properly in fop 0.94
Thanks Jeremias for pointing me to the examples. From the examples, I could not find one that suits my testcase. However, I was able to find one from another website: http://www.renderx.net/lists/xep-support/0376.html I tried this approach for my image and it worked. The trick is to specify the markup as shown below: Since we do not have this particular testcase in the images.fo file, can you please add this? It might be helpful for those who wish to scale only those images that do not fit in the page. Appreciate your help. Thanks!! -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Friday, November 09, 2007 5:00 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Images not resized properly in fop 0.94 May I suggest that you have a look at "examples/fo/basic/images.fo" in the FOP distribution? The example shows various ways to use fo:external-graphic. I'm sure you'll find the pattern you need there. Good luck! Jeremias Maerki On 09.11.2007 22:50:23 Puppala, Kumar (LNG-CON) wrote: > Thanks for the information. I tried to use both content-height and > content-width (setting them to 'scale-to-fit') in my testcase and it > still did not work. I think there might be some issue here. Below is the > code snippet from AbstractGraphicsLayoutManager.java file: > > > > In getInlineArea() function: > > > > Line 72 onwards... > > int bpd = -1; > > int ipd = -1; > > > > The bpd and ipd values are only overwritten if > > Line 129 onwards... > > if ((scaling == EN_UNIFORM) || (cwidth == -1) || cheight == -1) > { > > if (cwidth == -1 && cheight == -1) { > > cwidth = fobj.getIntrinsicWidth(); > > cheight = fobj.getIntrinsicHeight(); > > } > > > > Line 164 onwards... > > if (ipd == -1) { > > ipd = cwidth; > > } > > if (bpd == -1) { > > bpd = cheight; > > } > > > > The ipd and bpd values are set as per this flow for my FO file. As such, > the values are not being scaled. We might be missing something here but > since I am not an expert in this area, any input to fix this issue will > be greatly appreciated. > > > > > > Thanks, > > Kumar Puppala > > > > -Original Message- > From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] > Sent: Friday, November 09, 2007 2:21 PM > To: fop-users@xmlgraphics.apache.org > Subject: Re: Images not resized properly in fop 0.94 > > > > On Nov 9, 2007, at 20:08, Puppala, Kumar (LNG-CON) wrote: > > > > Hi Kumar > > > I am running into an issue with both gif and png images in fop > > > 0.94. I am trying to render a big GIF image in my PDF document. > > > Since the image does not fit in a single page, it should be > > > resized. In FOP 0.20.5, I do see the correct behavior and the image > > > is rendered properly. However in both 0.93 and 0.94 releases, the > > > image is not truncated and hence only rendered partially. I am > > > hereby attaching the FO file and the outputs from old and new fop. > > > Are there any known issues here? > > > > Yes, the behavior in FOP 0.20.5 is non-compliant. > > > > Take a look at the fo:external-graphic, and the XSL-FO Rec, more > > precisely: > > > > http://www.w3.org/TR/xsl11/#d0e22982 (Area Dimension Properties) > > > > You have no explicit (content-)width/height, so: > > > > content-width="auto" => intrinsic image width > > content-height="auto" => intrinsic image height > > height="auto" > > width="auto" > > > > => the image should not be scaled to fit the viewport, but clipped. > > > > The trick is to set content-height and/or content-width explicitly to > > "scale-to-fit". That should normally do it. > > > > Hope this helps! > > > > > > Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Images and NullPointerExceptions
Hi, I do not reproduce your problem (with your FO file and your PNG image) I use JRE 1.6 from Sun, Win platform. Have you tried FOP with command line? Pascal > -Message d'origine- > De : Jared Smith [mailto:[EMAIL PROTECTED] > Envoyé : lundi 12 novembre 2007 16:44 > À : fop-users@xmlgraphics.apache.org > Objet : Images and NullPointerExceptions > > I apologize in advance if this question has already been covered > before... I've spent the last week trying everything I can think of to > get FOP to work for me, and I can't get anything to work. > I've tried to > do my homework and make sure I'm not doing anything silly, but I'm > stuck. > > Going from DocBook to FO (using either xsltproc or xalan) and > then from > FO to PDF using FOP seems to work fine for me, until I add > images. The > instant I add an image to my document, FOP starts giving me > null pointer > exceptions. I've boiled the problem down to a very simple document, > which I've pasted on my website at http://www.jaredsmith.net/fop/. In > that directory, you'll find a very simple DocBook article. I've also > included the output FO of both xsltproc and xalan, as well as a log of > what I did to create them (and the errors I got from FOP) in log.txt. > > Things I've tried: > o using FOP 0.94 > o using FOP trunk (compiled with support for jai and Jimi) > o using GIF images instead of PNG images > o using both JAI and JIMI > > Please let me know if you see anything out of the ordinary with my > files, or would like me to try something else. I'm open to > any and all > suggestions at this point. > > -Jared Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Images and NullPointerExceptions
I apologize in advance if this question has already been covered before... I've spent the last week trying everything I can think of to get FOP to work for me, and I can't get anything to work. I've tried to do my homework and make sure I'm not doing anything silly, but I'm stuck. Going from DocBook to FO (using either xsltproc or xalan) and then from FO to PDF using FOP seems to work fine for me, until I add images. The instant I add an image to my document, FOP starts giving me null pointer exceptions. I've boiled the problem down to a very simple document, which I've pasted on my website at http://www.jaredsmith.net/fop/. In that directory, you'll find a very simple DocBook article. I've also included the output FO of both xsltproc and xalan, as well as a log of what I did to create them (and the errors I got from FOP) in log.txt. Things I've tried: o using FOP 0.94 o using FOP trunk (compiled with support for jai and Jimi) o using GIF images instead of PNG images o using both JAI and JIMI Please let me know if you see anything out of the ordinary with my files, or would like me to try something else. I'm open to any and all suggestions at this point. -Jared Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Character encoding problem
I didn't see this before. It solved my problem and the code is a bit nicer, too. Thanks a lot. I will also keep the font issue in mind when refining the PDF. Michael Manuel Mall <[EMAIL PROTECTED]> wrote: Have you seen http://www.nabble.com/How-to-create-XML-Source-from-Java-String--tf4600917.html? Jeremias made a point in that post about not using the coding pattern you use because of encoding issues. Manuel __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Character encoding problem
Have you seen http://www.nabble.com/How-to-create-XML-Source-from-Java-String--tf4600917.html? Jeremias made a point in that post about not using the coding pattern you use because of encoding issues. Manuel Michael Niemann wrote: > > I'm actually not using any specific fonts in the current phase. > Instead of the unicodes starting with '#' the ü is displayed like this: ü > > Chris Bowditch <[EMAIL PROTECTED]> wrote: > > If the PDF isn't showing the correct character it may not be caused by > encoding problems. If you are seeing a # character where the umlaute > should be then the problem is caused by the Font you are using not > having a glyph for the corresponding codepoint. If so, then you will > need to change the Font Family to one which does a glyph for the German > Umlaute character. > > > > Chris > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > -- View this message in context: http://www.nabble.com/Character-encoding-problem-tf4790359.html#a13704546 Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Character encoding problem
Michael Niemann wrote: I'm actually not using any specific fonts in the current phase. Instead of the unicodes starting with '#' the ü is displayed like this: ü If you don't specify a Font Family then FOP uses "Times" by default. Indeed the symptoms you describe seem to be more consistent with an encoding problem than a Font problem. What is the encoding of the source XML and XSLT files? The XML parser looks at the Byte order Mark as well as the XML processing instruction. Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Character encoding problem
I'm actually not using any specific fonts in the current phase. Instead of the unicodes starting with '#' the ü is displayed like this: ü Chris Bowditch <[EMAIL PROTECTED]> wrote: If the PDF isn't showing the correct character it may not be caused by encoding problems. If you are seeing a # character where the umlaute should be then the problem is caused by the Font you are using not having a glyph for the corresponding codepoint. If so, then you will need to change the Font Family to one which does a glyph for the German Umlaute character. Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Character encoding problem
Michael Niemann wrote: Hello, I've read quite a few older postings about encodig problems and mine might not be connected to FOP directly. I pass two streams to FOP. The xslt stream includes the output tag with its encoding set to UTF-8 but still the resulting pdf doesn't show the german Umlaute correctly. If the PDF isn't showing the correct character it may not be caused by encoding problems. If you are seeing a # character where the umlaute should be then the problem is caused by the Font you are using not having a glyph for the corresponding codepoint. If so, then you will need to change the Font Family to one which does a glyph for the German Umlaute character. Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Character encoding problem
Hello, I've read quite a few older postings about encodig problems and mine might not be connected to FOP directly. I pass two streams to FOP. The xslt stream includes the output tag with its encoding set to UTF-8 but still the resulting pdf doesn't show the german Umlaute correctly. I'm using the following code to call the transformer. The method get both the XML and XSLT as Strings via the parameters xmlinput and xsltinput: InputStream xmlin = new ByteArrayInputStream(xmlinput.getBytes()); InputStream xsltin = new ByteArrayInputStream(xsltinput.getBytes()); out = new ByteArrayOutputStream(); FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xsltin)); transformer.setOutputProperty("encoding", "UTF-8"); Source src = new StreamSource(xmlin); Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); Is there some setting I am missing? regards Michael. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com