AW: xsl:fo to svg rendering with raster images
The paths to the images are not the problem. They are absolute paths to a lokal image file on the hard disk. But I think the other 2 possibilities are the cause of the problem. I didn't declare the xlink namespace. And one image I use has a cmyk colorspace. I get the following exception while rendering: sun.awt.image.ImageFormatException: Unsupported color conversion request at sun.awt.image.JPEGImageDecoder.readImage(Native Method) at sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:144) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:257 ) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:168) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136) I got the same exception with AWTRenderer, which I used for a preview. So I tried to do the preview with SVG and JSVGCanvas from Batik. But the problem with the images is the same. (and I want to replace AWTRenderer with something else because the font rendering quality is really bad). I added my fo file and the produced svg file to this mail. Maybe you can take a look at it, and hopefully tell me whats wrong. Don't bother about the $data.getXXX() functions in the fo file. They come from Velocity which I use to fill my fo templates with data. Everything works fine with pdf creation but not with svg output. btw. svg creation is done with this function: public void renderToSvg(byte []foFile, File file) { try { FileOutputStream outStream; driver.setInputSource(new InputSource(new ByteArrayInputStream(foFile))); driver.setOutputStream(outStream = new FileOutputStream(file)); driver.setRenderer(Driver.RENDER_SVG); driver.run(); outStream.flush(); outStream.close(); } catch (FileNotFoundException fnfex) {fnfex.printStackTrace();} catch (IOException ioex) {ioex.printStackTrace();} catch (FOPException fopex) {fopex.printStackTrace();} } Could be I forgot something here as well. TIA Alex -Ursprungliche Nachricht- Von: J.Pietschmann [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 13. Marz 2003 00:11 An: [EMAIL PROTECTED] Betreff: Re: xsl:fo to svg rendering with raster images Alexander Koppelhuber wrote: I tried to render my fo files to svg, which works fine for text. But none of the external images makes it to the svg file. Batik can produce image tags with links to external images. Is this a limitation in fop? (producing a pdf with the same fo file works fine). Most likely your images weren't found. Check whether the source URLs would work with an fo:external-graphic. You might need to use absolute URLs. Other possiblities: - The image file formats are not supported. I'm not sure but perhaps installing Jimi (see FOP FAQ) helps with this issue. - You forgot to declare the xlink namespace. A code sample would have helped in diagnosing the problem. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ?xml version=1.0 encoding=ISO-8859-1? !-- Document : Visitenkarte.fo.xml Created on : 15. Februar 2003, 02:49 Author : Alexander Koppelhuber Description: Purpose of the document follows. -- fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=basic page page-height=55mm page-width=170mm margin-top=0cm margin-bottom=0cm margin-left=0mm margin-right=0mm fo:region-body margin-top=0cm margin-right=0mm/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=basic page fo:flow flow-name=xsl-region-body !--fo:block-container width=85mm height=55mm top=-1mm position=absolute fo:block fo:external-graphic src=url('$data.getBackground()') width=85mm height=55mm scaling=uniform/ /fo:block /fo:block-container -- fo:block-container width=85mm height=11mm left=85mm top=44mm position=absolute fo:block fo:external-graphic src=url('$data.getImage(0)') width=85mm height=11mm scaling=uniform/ /fo:block /fo:block-container fo:block-container width=31.16mm height=45mm left=85mm top=-1mm position=absolute fo:block fo:external-graphic src=url('$data.getImage(1)') width=31.16mm height=45mm scaling=uniform/
Re: SVG to PDF: CMYK conversion / Can't open PDF in Adobe Illustrator
Hi It seems I'm not the only one with this problem. Have a look in the Adobe user to user forum for the Illustrator (Win). There is a message with the topic File opens in all PDF viewers except Illustrator 10.. Forum: http://www.adobeforums.com/cgi-bin/webx?14@@.ee6b328 Hans Jeremias Maerki [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] On 11.03.2003 16:04:00 Hans Stoessel wrote: If I convert the SVG file with the version of FOP, the PDF file is much bigger (about 5 times). And a font I use (Arial) in the SVG file is changed in the PDF file. With the version 0.20.5 works this correct. I think I use the old version for the moment... Probably safe. The reason for these two problems is the lack of configuration (no compression, no custom fonts), I think. This will be addressed for the first release of the PDF transcoder. Monitor this mailing list for announcements. One more question: Can I change the size (widht and height) of the generated PDF file? There's something about that here: http://xml.apache.org/fop/dev/svg.html The test.svg and the resulting PDF you sent are pretty simple. I've cross-checked most elements in the PDF with the PDF spec and I can't see anything strange. Without access to Adobe Illustrator and/or a better error message from it I can't do anything else. Probably best if you sent the PDF to Adobe support. The PDF, by the way, opens nicely in GhostScript/GhostView and CorelDraw. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xsl-region-before flow control
Hi thx for replying, yes i did look @ that... But i wanted to avoid that, i hoped there is another way to do it. How idi i solve it? first time i had an empty xsl:variable, and then i printed something, just after the print i filled the variable with something and if it isn't empty it isn't printed anymore... that is how i did it, but it isn't always possible to do it (because of the variable's scope) thx anyway... Jochen Maes ICT Development KBC Securities (kbcsecurities.com) Havenlaan 12 Avenue du Port SIF 8683 B-1080 Brussels Belgium Tel: +32 2 429 96 81 GSM: +32 496 57 90 99 E-mail : [EMAIL PROTECTED] This message and any attachments hereto are for the named person's use only. It may contain confidential, proprietary or legally privileged information. You may not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. If you have received this e-mail message without being the intended recipient, please notify KBC Securities promptly and delete this e-mail. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of KBC Securities. KBC Securities reserves the right to monitor all e-mail communications through its networks and any messages addressed to, received or sent by KBC Securities or its employees are deemed to be professional in nature. The sender or recipient of any messages to or of KBC Securities agrees that those may be read by other employees of KBC Securities than the stated recipient or sender in order to ensure the continuity of work-related activities and allow supervision thereof. KBC Securities does not accept liability for the correct and complete transmission of the information, nor for any delay or interruption of the transmission, nor for damages arising from the use of, or reliance on, the information. J.Pietschman n To: [EMAIL PROTECTED] [EMAIL PROTECTED]cc: oo.de Subject: Re: xsl-region-before flow control 12/03/2003 21:40 Please respond to fop-user [EMAIL PROTECTED] wrote: I have been using FOP for more then a year and a half. Till now i needed to put something on the first page but not on the others, and i solved this with a variable. But as you all might know it's not really clean programming. So without having to define a new page-sequence, is there a way to find out if it's the first page or not? I have no idea what you mean by solved this with a variable. Did you look at the FAQ? http://xml.apache.org/fop/faq.html#fo_first_page_header Oh, *big* thanks to Victor for stable, meaningful FAQ anchors!!! J.Pietschmann - 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]
External Graphic border
Hello, I am trying to put a 1pt black border around images. I first tried to use the border common attribute on the fo:external-graphic tag, but it doesn't work (on fop 0.20.5rc2). Here is the tag I used : fo:external-graphic border-style=solid border-width=1pt border-color=black Then, I decided to include my image in a block, but the block doesn't fit the image perfectly so the result is really crappy ! Do you know if it's possible ? Or should I include the border into my image resizing process ? Thanks, Simon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Réf. : Re: Question about Word character encoding.
Thanks, I didn't know about that project... I think I'll use my own function to clean our users' input but this project looks like being quite interesting. Anyway, they choose really funny acronyms ! POI stands for Poor Obfuscation Implementation. HDF (Horrible Document Format) HDF is our port of the Microsoft Word 97 file format to pure Java. It supports read and write capability. Please see the HDF project page for more information. This component is in the early stages of design. Jump in! Simon J.Pietschmann [EMAIL PROTECTED] 12/03/2003 21:29 Veuillez répondre à fop-user Pour : [EMAIL PROTECTED] cc : Objet : Re: Question about Word character encoding. [EMAIL PROTECTED] wrote: I have a little query : I am looking for a table with the hexadecimal code for the MS Word specific characters (eg: ... or the ' character). You should probably take a look at jakarta POI http://jakarta.apache.org/poi/index.html The claim to be able to read/write Word and other MS proprietary file formats. BTW the peculiarities of Word files vary considerably between versions. J.Pietschmann - 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: Line-wrap in fo:leader
Many thanks for the suggestion. Your help is greatly appreciated again. Unfortunately the two leaders wind up on the same line, if blah is less than 50% long and the ref,ref text goes on the following line (see index.13.xsl). I've tried to use keep-together with some success (see index.14.xsl) and this improves matters, but you can see that it appears to be ignored on the 4th page of the output, when the refs are too long, and the leader is separated from the refs. Is this a Fop issue or am I expecting to achieve something from FO which is beyond its design? Links: http://coolbox.seseit.com/~rob/fo.index.13.html http://coolbox.seseit.com/~rob/fo.index.14.html -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: 12 March 2003 20:38 To: [EMAIL PROTECTED] Subject: Re: Line-wrap in fo:leader Rob Staveley (Tom) wrote: blah, blah, blah, blah, blah,... ref,ref,ref Add text-align=justify. I'd like to get: blahref,ref blahref,ref,ref blah, blah, blah, blah, blah,... .ref,ref,ref Getting a second leader on the second line is definitely tricky. You could try to add a second leader: fo:blockblah, blah, blah, blah, blah,fo:leader leader-pattern=dots/fo:leader leader-pattern=dots leader-length.optimum=50% leader-length.minimum=0/ref,ref,ref/fo:block This will (hopefully) break if the line is half full with blah text. J.Pietschmann - 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: PDF boomarks not created due to location?
On Wed, 2003-03-12 at 15:24, J.Pietschmann wrote: Philip Semanchuk wrote: Thank you very much Jeremias. The documentation that I have not been able to find is something that states whether this feature is WAD (working as designed) or if it is just a known quirk/bug. If patches are welcome then I guess it is the latter. =) I believe when bookmars were introduced it didn't matter where they were declared in the FO document. With 0.20.1 or so streaming rendering was introduced in order to reduce memory consumption, and since then it matters. Bookmarks are regarded a root extension and will be 'rendered' when the end tag of the first page sequence is encountered. This means bookmarks must be completely declared *before* the first page sequence, or they'll just be dropped. I'm sure this is an unintended consequence, but one which bothers me *much* less than others. This makes sense to me. I don't find the restriction onerous either, I just want to document it. Thanks for the background information. Philip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Printing using Java
Hi, I have only just started using fop and need to print the final output automatically from within my java code. I notice from the users mailing list that questions have been raised before (eg: 'Printing from FOP Driver' dated 2002-06-02 and 'Printing from Java-Application' 2002-04-16) but not answered. I have the same questions, ie how to overcome the exception and are there memory concerns. I have tried printing from the command line using ...Fop -print ... and have noticed that the positioning of the data is different to when I output the same file to pdf and then print the pdf. Does this suggest that the I have to set the layout differently for each style of output? Thanks Andrew -- Andrew Mercer, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Printing using Java
Andrew, I too have noticed a difference when I use -print and when I output to a file using -pdf. The primary differences I've found relate to VERTICAL FontMetrics. In other words, in the PDF version, the region-before and region-after sections appear larger than necessary. The percentage difference ranges from 112% larger to 150% larger (it appears to be almost exponential, generally depending on how large the region-before or region-after is). I think it has to do with postscript rendering differences, as I've moticed the same problem when I render to -ps. In addition, if I send it to -print, but specify Acrobat PDFWriter or Acrobat Distiller, I notice the same problem. What follows is not exactly a fix but instead is more of a work-around. My work-around is to have two versions of my FO files: a print version and a pdf version. Then, since I call FOP using either a script (*.BAT file for Win or a *.sh for Unix), I merely specify a different script depending on the output method. Since I'd rather not have to modify two files when making changes, the pdf version is fairly short and instead does an xsl:include of the print version. After the xsl:include line, I set the following: - xsl:attributes - fo:root - fo:layout-master-set - fo:simple-page-master - fo:region-body - fo:region-before - fo_region-after - fo:page-sequence-master - repeatable-page-master-reference - single-page-master-reference - fo:page-sequence - fo:static-content - fo:static-content - fo:flow Here's the actual code (I removed a bunch of comments and xsl:if choose statements to improve readability--if you find I haven't closed a tag that's why--the unmodified version works ;-). ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:include href=xml_med7_default.fo/ xsl:attribute-set name=attNormal xsl:attribute name=background-color#ff/xsl:attribute xsl:attribute name=color#00/xsl:attribute xsl:attribute name=font-familycourier new, courier, monospace/xsl:attribute xsl:attribute name=font-size8pt/xsl:attribute /xsl:attribute-set xsl:variable name=varNormalBGColor#ff/xsl:variable xsl:variable name=varHeadingBGColor#dd/xsl:variable xsl:variable name=varAccentBGColor#cc/xsl:variable xsl:variable name=varWIWCHeading2BGColor#99/xsl:variable xsl:variable name=varHeadingFontSize9pt/xsl:variable xsl:template match=/ xsl:apply-templates select=doc/ /xsl:template xsl:template match=doc fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=repeating page-height=28cm page-width=22cm margin-top=1cm margin-bottom=1cm margin-left=1cm margin-right=0cm fo:region-body margin-bottom=2.6cm margin-top=6.4cm/ fo:region-before extent=6.4cm/ fo:region-after extent=2.6cm/ /fo:simple-page-master fo:simple-page-master master-name=refundletter page-height=28cm page-width=22cm margin-top=1cm margin-bottom=1cm margin-left=1cm margin-right=1cm fo:region-body region-name=refundletter/ /fo:simple-page-master fo:page-sequence-master master-name=repeating_pm fo:repeatable-page-master-reference master-name=repeating/ fo:single-page-master-reference master-reference=refundletter/ /fo:page-sequence-master /fo:layout-master-set fo:page-sequence master-reference=repeating fo:static-content flow-name=xsl-region-before fo:block padding=0pt xsl:use-attribute-sets=attNormal xsl:call-template name=tmpHeader/ /fo:block /fo:static-content fo:static-content flow-name=xsl-region-after fo:block xsl:use-attribute-sets=attNormal xsl:call-template name=tmpFooter/ /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block xsl:use-attribute-sets=attNormal xsl:call-template name=tmpBody/ fo:block padding=0pt font-size=1pt fo:marker marker-class-name=table-continued/ /fo:block /fo:block /fo:flow /fo:page-sequence fo:page-sequence master-reference=refundletter fo:flow flow-name=refundletter fo:block xsl:use-attribute-sets=attNormal xsl:call-template name=tmpRefundLetter/ /fo:block /fo:flow /fo:page-sequence /fo:root /xsl:template /xsl:stylesheet BTW, you may notice that I've placed all of my content for each fo:page-sequence item in a template. I found this makes it easier for me to make modifications to margins, etc. You may also notice my table-continued marker at the end of the fo:flow which I use for a Continued on next page marker on every page except the last. I hope you find this useful. --
[WARNING] Screen logger not set.
Hey folks, I'm using FOP 0.20.4 and when I run FOP embedded in a java program I can't seem to get rid of the message [WARNING] Screen logger not set. I've tried... import org.apache.avalon.framework.logger.Logger; import org.apache.avalon.framework.logger.ConsoleLogger; import org.apache.avalon.framework.logger.NullLogger; Driver driver = new Driver(); Logger logger = new NullLogger(); driver.setLogger(logger); MessageHandler.setScreenLogger(logger); and also... import org.apache.avalon.framework.logger.Logger; import org.apache.avalon.framework.logger.ConsoleLogger; import org.apache.avalon.framework.logger.NullLogger; Driver driver = new Driver(); Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_DISABLED); driver.setLogger(logger); MessageHandler.setScreenLogger(logger); And I still get the warning message on stdout. Any ideas? Jackie Wilson Sword Microsystems, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: External Graphic border
[EMAIL PROTECTED] wrote: I am trying to put a 1pt black border around images. I first tried to use the border common attribute on the fo:external-graphic tag, but it doesn't work (on fop 0.20.5rc2). It's not implemented. Then, I decided to include my image in a block, but the block doesn't fit the image perfectly so the result is really crappy ! That's a well known bug which nobody yet bothered to track down. You are invited. Do you know if it's possible ? Or should I include the border into my image resizing process ? The latter is certainly the best short-term solution. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Line-wrap in fo:leader
Rob Staveley (Tom) wrote: Unfortunately the two leaders wind up on the same line, if blah is less than 50% long and the ref,ref text goes on the following line (see index.13.xsl). At the XSLT level, you can try to estimate the width of the blah and ref on one entry: string-length($stuff)*$font-size If width($blah)+$minimal-leader-length+width($ref) $allocated-width increase leader-length.optimum to $allocated-width and insert the second leader with default length set. I've tried to use keep-together with some success Spurious success, I'd bet. Keeps don't have no effect whatsoever on line breaking, unfortunately. I should know, I had already bad dreams featuring the current line breaking code. In fact, the keep properties are not even delivered anywhere near the line breaking code. Is this a Fop issue or am I expecting to achieve something from FO which is beyond its design? Tricky question: it should be possible to get it to work with keep-with-next.within-line, for example: fo:block text-align=justify text-align-last=justify fo:inline keep-with-next.within-line=alwaysblah/fo:inlinefo:leader leader-pattern=dots leader-length.minimum=6pt leader-length.optimum=100% keep-with-next.within-line=5/fo:leader leader-pattern=dots leader-length.optimum=100% keep-with-next.within-line=always/ref/fo:block This is overconstrained: The processor is advised to both keep everything within a line but expand the leaders to the full line width. OTOH the leader length can be decreased to 6pt for the first and to 0 for the secons leader, therefore if blah+(6pt leader)+ref fits on the line, nothing special happens, but if not the processor can insert a break somewhere, preferably beween the leaders, which then expand each by itself to fill all available space. However this isn't all that well defined in the spec, some processors could do something else, like simply overflowing the line. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xsl-region-before flow control
[EMAIL PROTECTED] wrote: But i wanted to avoid that, i hoped there is another way to do it. Why? It's the way things are supposed to be done. How idi i solve it? first time i had an empty xsl:variable, and then i printed something, just after the print i filled the variable with something and if it isn't empty it isn't printed anymore... that is how i did it, but it isn't always possible to do it (because of the variable's scope) I don't understand, except that you appear to seriously confuse XSLT and XSLFO. Did you work through a good book? J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Réf. : RE: Question about Word character encoding.
try to use UTF-8 as XML input encoding. It works for me Bernard -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 12 March, 2003 17:38 To: [EMAIL PROTECTED] Subject: Réf. : RE: Question about Word character encoding. Many thanks for your answer, and your expertise ! I didn't know about that unused range, it will help me a lot since I just have to focus my attention on it now. Simon Philip Semanchuk [EMAIL PROTECTED] 12/03/2003 15:53 Veuillez répondre à fop-user Pour : [EMAIL PROTECTED] [EMAIL PROTECTED] cc : Objet : RE: Question about Word character encoding. On Wed, 2003-03-12 at 09:16, [EMAIL PROTECTED] wrote: Here is the function I just coded to resolve my issue with the Word's specific characters (appearing as # in the resulting PDF). As I said, I did'nt find any complete table of the M$ Word's specific characters, so this function is not complete at all, but it is enought for my problem ! Simon, I don't know what Word uses for internal character representation, but I would not be surprised if it is the Windows-1252 character set. Win1252 is a superset of ISO8859-1. It defines the characters between 0x80 and 0x9f which ISO8859-1 specifically leaves undefined. It is in this range that you find the curly quotes, em dash and TM symbol that often make their way into documents and then don't display properly on non-Windows platforms. There is a great Web page about it here: http://czyborra.com/charsets/iso8859.html HTH Philip - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]