RE: Question about PDF API used in FOP v0.95
The original FOP project was for transforming XSLFO into a PDF. Then other features were added, to transform XSLFO into other outputs including PCL, image files, and direct printouts. Now there is a new feature to FOP which is most useful to us, to create a PDF by drawing to a Graphics object as if drawing to a screen. The question of where is the API is a bit confusing. The source is on the site (http://xmlgraphics.apache.org/fop/). Old Javadocs are on the web and new ones can be created from the source. AFAIK FOP cannot read in or manipulate existing PDFs. I would suggest trying the pdfbox project for that. -Original Message- From: Chris Bowditch [mailto:bowditch_ch...@hotmail.com] Sent: Wednesday, November 16, 2011 5:02 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Question about PDF API used in FOP v0.95 On 15/11/2011 15:27, 刘寅 wrote: Hi Liu, Hello,now I am doing a research about document format transformation and I have got a lot of help from FOP. But there is a problem that I can't distinguish the PDF API from FOP source v0.95. I want to know how many PDF APIs used in FOP v0.95, who are they and where are there(in which package)? I have successfully run all the examples in fop-0.95-src on my computer and read some of FOP API Document. Also I have tried to find my answers from FAQs but I can't find any. So could you help me or give me some advices ? FOP doesn't publish a API to manipulate PDF. FOP can generate a PDF from XSL-FO.If you just want to build a PDF from another source using Java API then take a look at the PDF Box project. Looking forward to your reply, thank you very much! Sincerely, liu Yin Thanks, Chris - 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: Generating PNG files from FO sources
If you're using embedded code you have a Fop fop = fopFactory.newFop( ... statement which accepts an outputstream. If you want to keep your output in memory instead of writing it to disk you can read it from that stream. Use a ByteArrayOutputStream instead of a FileOutputStream. -Original Message- From: Todd Hivnor [mailto:spambox_98...@yahoo.com] Sent: Sunday, October 30, 2011 7:40 PM To: fop-users@xmlgraphics.apache.org; Todd Hivnor Subject: Re: Generating PNG files from FO sources More info: I now realize that the convertFO2PDF from https://xmlgraphics.apache.org/fop/1.0/embedding.html#ExampleFO2PDF can be modified to use MimeConstants.MIME_PNG in place of MimeConstants.MIME_PDF. Very straight-forward! However ... that solution isn't quite what I'm looking for. In some cases I want a BufferedImage not a file. I guess I could save a file and then read in a BufferedImage. But I'm hoping to get the BufferedImage without having to write it out to disk. Also I can't get the page count. With AWTRenderer from FOP 0.20, I could call getNumberOfPages to see if my report fit onto a single page. I've got code which then reduced the font size tried again if the page count was greater than 1. So, I guess my subject line should really be Generating BufferedImages from FO sources ... - Original Message - From: Todd Hivnor spambox_98...@yahoo.com To: fop-users@xmlgraphics.apache.org fop-users@xmlgraphics.apache.org Cc: Sent: Sunday, October 30, 2011 2:12 PM Subject: Generating PNG files from FO sources I'm _finally_ getting around to upgrading from FOP 0.20 to FOP 1.0! My existing code uses org.apache.fop.apps.Driver. I see that is no longer available, so I'm trying to figure out how to port my code. I figured out PDF generation, but can't figure out how to render a PNG from an FO file. All the examples in documentation talk about PDF, I can't find a PNG example. Is there sample code I haven't found? Or can someone provide a hint as to what classes I should be using and the key method calls? I found PNGRendererMaker so I can get a renderer. But I'm not sure what to do with it. Perhaps call it's renderXml method? In that case, what do I need for the namespace argument? I don't use XSLT, I just generate the FO code directly in Java. Any clues appreciated ... - 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
Where's the class?
I downloaded fop as the latest trunk snapshot and it says you took away a class? What happened to org.apache.fop.render.pdf.PDFRenderer?
RE: Conversion from 0.23 to 1.00
Try some sort of wrapper (tag within a tag)? I never got FOP to properly find external images so I'm currently only using inline SVG for images but it has size and positioning on multiple tag levels (if that helps?). fo:block xsl:attribute name=line-height1/xsl:attribute xsl:attribute name=font-size0pt/xsl:attribute fo:instream-foreign-object xsl:attribute name=content-widthxsl:value-of select=$BLOCKW//xsl:attribute xsl:attribute name=content-heightxsl:value-of select=$BLOCKH//xsl:attribute xsl:attribute name=scalingnon-uniform/xsl:attribute svg:svg xsl:attribute name=preserveAspectRatioxMinYMin meet/xsl:attribute xsl:attribute name=width100%/xsl:attribute xsl:attribute name=height100%/xsl:attribute xsl:attribute name=viewBoxxsl:value-of select=concat('0',',','0',',','556',',','84')//xsl:attribute From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: Friday, September 16, 2011 3:22 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Conversion from 0.23 to 1.00 I found the problem, whilst 0.23 does not moan when you set the content-width=123mm apparently in 0.95 and above, You have to have it set to auto-scale otherwise it will just appear as full size Oh well Maybe the rescaling will work better - and what if you want to crop it? Kindest regards Theresa Forster Senior Software Developer From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: 15 September 2011 16:17 To: fop-users@xmlgraphics.apache.org Subject: RE: Conversion from 0.23 to 1.00 A sample would help. Is it an external image? an instream image? Are you setting the attributes? content-width, content-height, scaling? In my image block I also set line-height='1' and font-size='0pt' From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: Thursday, September 15, 2011 11:10 AM To: fop-users@xmlgraphics.apache.org Subject: Conversion from 0.23 to 1.00 I have converted my code from 0.23 to 1.00 But I am having problems with my graphics. In the past we have used scale and it has scaled properly, Now under 1.00 its not scaling at all (well cropping) Am I missing something (the original 0.23 had been modded to provide extras like cmyk as %, z-index and float) My xsl is creating a fo file but the image is not being cropped, Is there any way to keep it inside the block-container I am getting errors like this WARNING: Line 1 of a paragraph overflows the available area by 11339 millipoints. (See position 1399:11) 15-Sep-2011 16:01:04 org.apache.fop.events.LoggingEventListener processEvent WARNING: Content overflows the viewport of an fo:block-container in block-progression direction by 17123 millipoints. (See position 1398:91) 15-Sep-2011 16:01:04 org.apache.fop.events.LoggingEventListener processEvent WARNING: Content overflows the viewport of an fo:block-container in block-progression direction by 5784 millipoints. (See position 1984:91) 15-Sep-2011 16:01:04 org.apache.fop.events.LoggingEventListener processEvent WARNING: Content overflows the viewport of an fo:block-container in block-progression direction by 5784 millipoints. (See position 1989:134) Kindest regards Theresa Forster Senior Software Developer No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1410 / Virus Database: 1520/3898 - Release Date: 09/15/11
RE: Producing PDF from subset of IF file pages
Actually, did you upload them somewhere to link? I believe this distribution list does not allow attachments. -Original Message- From: jeanyo [mailto:melanie.dr...@gmail.com] Sent: Wednesday, September 14, 2011 11:43 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Producing PDF from subset of IF file pages Actually, here are the file attachments... jeanyo wrote: I have attached two files: - http://old.nabble.com/file/p32464608/premod.if.xml premod.if.xml : This is the untouched IF file. - http://old.nabble.com/file/p32464608/postmod.if.xml postmod.if.xml : This is premod.if.xml, but with many of the page elements and some page-sequence elements removed. You will notice extra white space where elements were deleted. -- View this message in context: http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-t p32463958p32464608.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Can FOP work backwards?
I know the intention of FOP is to create PDF, but since FOP did create the PDF the code should be there to read the PDF. I want to take a PDF (generated by FOP) and read it back in, to be able to print it, or to display it in a Swing component. I already have a Swing component, if FOP can tell me enough information about what it put in the PDF and where.
FOP font warning invalid
FOP spits out warning messages on the transform. Sep 13, 2011 11:32:54 AM org.apache.fop.events.LoggingEventListener processEvent WARNING: Font Lucida Sans Typewriter,normal,700 not found. Substituting with Lucida Sans Typewriter,normal,600. I never told it to use 700. My FO file just has font-weight=bold. Is there a simple fix for this or do I just have to save the font's actual weight where I'm loading in my custom fonts and replace the word bold?
RE: FOP font warning invalid
font-weight=demibold doesn't give me a font replace message, and doesn't print bold. 700 = bold? 600 = ? Is there an official keyword list? From: Rob Sargent [mailto:rsarg...@xmission.com] Sent: Tuesday, September 13, 2011 11:53 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP font warning invalid 700=bold, iirc, and you only have demi-bold? On 09/13/2011 09:40 AM, Eric Douglas wrote: FOP spits out warning messages on the transform. Sep 13, 2011 11:32:54 AM org.apache.fop.events.LoggingEventListener processEvent WARNING: Font Lucida Sans Typewriter,normal,700 not found. Substituting with Lucida Sans Typewriter,normal,600. I never told it to use 700. My FO file just has font-weight=bold. Is there a simple fix for this or do I just have to save the font's actual weight where I'm loading in my custom fonts and replace the word bold?
How to make embedded font readable?
FOP created the PDF. Pdfbox is trying to read it. I'm not sure which end is missing what. I'm embedding fonts and pdfbox says there's something there it can't read. Sep 12, 2011 9:18:12 AM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont INFO: Can't read the embedded font ED+LucidaSans-Typewriter
RE: How to make embedded font readable?
I'll look into that JIRA, thanks. The pdfbox error in the original message below shows the class and method producing this message in the Java log. Digging a little deeper, this is caused by the pdfbox method: org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2() This is trying to read the FontFile2 key which was written by FOP. org.apache.fop.pdf.PDFFontDescriptor.setFontFile() One of these is missing something. -Original Message- From: Andreas Lehmkuehler [mailto:andr...@lehmi.de] Sent: Monday, September 12, 2011 3:30 PM To: us...@pdfbox.apache.org Cc: fop-users@xmlgraphics.apache.org Subject: Re: How to make embedded font readable? Hi, Am 12.09.2011 15:31, schrieb Eric Douglas: FOP created the PDF. Pdfbox is trying to read it. I'm not sure which end is missing what. I'm embedding fonts and pdfbox says there's something there it can't read. I guess it is an issue with PDFBox, but without a sample PDF it's only a guess. Please create an issue on JIRA [1] and attach a sample pdf to it. Sep 12, 2011 9:18:12 AM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont INFO: Can't read the embedded font ED+LucidaSans-Typewriter BR Andreas Lehmkühler [1] https://issues.apache.org/jira/browse/PDFBOX - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: XSL vs. FOP [was: Re: pagenumbering]
XSLFO is what you get when you combine XSLT with XML. XSLFO is an extension of XSLT and includes XSLT commands. XSLFO is as unrelated to FOP as XSLT when you're talking about it's creation for expected output. If you want only FOP related questions they should be about XSLFO commands and only as far as whether they're supported and whether they're producing the expected output. There is likely a better place for questions about how to generate XSLT or XSLFO which should produce particular output which don't question whether FOP is processing it correctly, and you're welcome to point people to such a place if you don't have an answer or don't feel like answering, though I personally wouldn't mind helping if I do have an answer. I use FOP with XML + XSLT with embedded code. I have had some issues with how FOP works which require looking at the XSLFO, so I actually split the process so I call the Java transform method twice. One passes the XSL on the Transformer create and the XML as input and the output is XSLFO I can write to a file if I need. The second transform uses no XSL and passes the XSLFO as input and the FOP handler on the output. If you don't want to 'misspend' any time answering questions that should include questions about how to write XSLT or XSLFO. Once someone has valid XSLFO and they're not getting the expected output then it's an FOP question. From: Glenn Adams [mailto:gl...@skynav.com] Sent: Tuesday, August 30, 2011 11:41 PM To: fop-users@xmlgraphics.apache.org Subject: Re: XSL vs. FOP [was: Re: pagenumbering] Christopher, We may be applying different ontological models here. I label anything having to do with XSL-FO as FO related. I label anything having to do with XSLT as XSL related. For me, FO related != XSL related. In fact, there is no necessary logical connection between the two, except insofar as FO borrows/reuses certain constructs from XSL(T), the only one of which I know of is the number to string conversion properties, which, coincidentally, have to do with the current subject matter: page number generation. In any case, by model, page number properties are FO related, not XSL related. Because FOP supports both XSL(T) [indirectly} and FO, it certainly covers both areas, but as far as I'm concerned the XSL(T) portion of it is a convenience function, unrelated to its core functionality. Given the amount of traffic (mis)spent on issues related to the XSL(T) features of FOP, I often wish it did not support this convenience function. But that's neither here nor there. G. On Tue, Aug 30, 2011 at 9:12 AM, Christopher R. Maden cr...@maden.org wrote: On 08/30/2011 10:52 AM, Glenn Adams wrote: actually, this is an FO issue, not XSL, since it is FOP that generates page numbers via fo:page-number XSL encompasses both Formatting Objects (sometimes XSL-FO) and XSL Tranformations (XSLT). An FO issue *is* an XSL issue. It is FOP that generates page numbers, but what Theresa needed was the FO instruction, which is agnostic about the software that consumes it (whether FOP, RenderX, Antenna House, or anything else). The XSL List (URL: http://www.mulberrytech.com/xsl/xsl-list/ ) covers all of XSL, including XSL-FO. We've previously had discussions on this list about allowing XML+XSLT as input to FOP, and the potential user confusion that results as to what FOP actually does. For similar reasons, when I reply to questions here, I try to make it clear what parts are specific to FOP, and which questions are about XML, XSLT, or FO, and orthogonal to FOP's operation specifically. the correct answer is that you need to use the initial-page-number property on fo:page-sequence to specify a different starting number than is generated by auto; see http://www.w3.org/TR/2006/REC-xsl11-20061205/#initial-page-number and and http://www.w3.org/TR/2006/REC-xsl11-20061205/#fo_page-sequence for details; Yes, and I apologize for not taking the time to look up the references that Theresa needs. ~Chris [Emotional content notice (since plain text is really bad at communicating this): I want to be very clear that I am not attacking or criticizing Glenn or Theresa. And certainly, I've known Glenn by his work for far too long to accuse him of anything remotely resembling ignorance. I have simply attempted to be somewhat detailed and pedantic here for maximal clarity to everyone who might read this.] -- Chris Maden, text nerd URL: http://crism.maden.org/ The present tendency and drift towards the Police State gives all free Americans pause. - Alabama Supreme Court, 1955 (Pike
RE: pagenumbering
I agree that discussion was petty. If someone thought the question was off topic they are welcome to respond with links to point you somewhere you might get better answers or ignore the question. While I haven't checked what other XSLFO processors exist, it seems the XSLT and XSLFO specifications are both generic and unrelated to FOP. If the question is about creating XSL in either form it may be technically off topic, though I for one don't care. If the question is about how FOP specifically interprets your XSLFO, or about whether a feature is supported then it's most relevant. I use FOP in a most unconventional way but I've stuck with it for 2 reasons I can think of. 1) I don't know of any other free project which creates PDFs with all the options FOP has. 2) FOP was initially recommended to us by a consultant and I've gotten it to work so if it isn't broken there's no need to change. If there is another PDF create project with all the features we need that can create more efficiently we'll likely switch eventually. FOP doesn't handle large transforms. I tested creating a 1000 page PDF and it ran out of memory, though the output is small and the input is reasonably small. I got around this bug by creating 1 page PDFs. We generate our input programmatically so we know what goes on each page, so I just broke it up. I increment the page number on each PDF and just pass it in as a tag. fo:page-sequence xsl:attribute name=master-referenceSTANDARD_PAGE/xsl:attribute xsl:attribute name=initial-page-numberxsl:value-of select=IPN//xsl:attribute Then I use pdfbox to mrge the resulting PDFs. From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: Wednesday, August 31, 2011 9:41 AM To: fop-users@xmlgraphics.apache.org Subject: RE: pagenumbering Thanks for the response but the question was already answered, but then a petty discussion started about whether fo:page-number was FOP or XSLT Kindest regards Theresa Forster Senior Software Developer From: Chen Yang [mailto:cy...@hrsg.ca] Sent: 31 August 2011 14:20 To: fop-users@xmlgraphics.apache.org Subject: RE: pagenumbering Hey Theresa, Not sure if this answer your question, I need to start the page 1 after cover page and Table of contents xsl:call-template name=insert_cover_page_template/ xsl:call-template name=insert_bookmarks/ xsl:call-template name=insert_table_of_contents_page_template/ Then I bought in my contents template xsl:call-template name=insert_contents_page_template/ Inside the insert_contents_page_template xsl:template name=insert_contents_page_template fo:page-sequence master-reference=A4-landscape initial-page-number=1 xsl:call-template name=insert_page_header-template/ xsl:call-template name=side_bar/ xsl:call-template name=insert_page_footer_template/ fo:flow flow-name=xsl-region-body xsl:apply-templates/ fo:block id=TheVeryLastPage/ /fo:flow /fo:page-sequence /xsl:template Page number template !-- page number -- xsl:template name=page_number fo:block-container absolute-position=absolute top=5mm fo:block font-family=sans-serif font-size=7pt text-align=right color=black Page fo:page-number/ of fo:page-number-citation ref-id=TheVeryLastPage/ /fo:block /fo:block-container /xsl:template Finally,Insert page number into footer template !-- footer -- xsl:template name=insert_page_footer_template fo:static-content flow-name=xsl-region-after . . . xsl:call-template name=page_number/ /fo:static-content /xsl:template Now the Page 1 of X will start on the first content page, not on my cover page or table of contents page. Regards Chen Yang Programmer / Analyst HRSG (Human Resource Systems Group) 6 Antares Drive,Phase II Suite 100 Ottawa, ON, K2E 8A9 Tel:613-745-6605 tel:613-745-6605 x 254 Fax:613-745-4019 Email: cy...@hrsg.ca mailto:cy...@hrsg.ca Web: www.hrsg.ca http://www.hrsg.ca/ Competency-based HR Solutions From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: August-30-11 9:50 AM To: fop-users@xmlgraphics.apache.org Subject: pagenumbering I was wondering, how can you change the page numbering on page-number-citation stuff, We have the requirement of numbering starting on the inside cover as page 1 not page 2 as currently the front page is classed as page 1. Is there any way to make the numbering start from 1 on the inside of the front cover? Kindest regards Theresa Forster Senior Software Developer
RE: FOP 1.0 Japanese # marks
Yes and yes Your FOP should have configuration telling it what fonts are available. Your XSLFO should have tags in it telling what font to use. If you can provide more details about what you're doing someone may provide more details about what you're missing. Are you using fop.xconf file? What's that look like? -Original Message- From: michael mclaughlin [mailto:m_mcl...@yahoo.co.uk] Sent: Friday, August 12, 2011 5:23 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP 1.0 Japanese # marks Do you mean configure FOP 1.0 to use a Japanese font? Or is there an XSL stylesheet option to do this? Or do I manually edit the .fo file. Thanks, Mike --- On Fri, 12/8/11, Sergiu Dumitriu ser...@xwiki.com wrote: From: Sergiu Dumitriu ser...@xwiki.com Subject: Re: FOP 1.0 Japanese # marks To: fop-users@xmlgraphics.apache.org Date: Friday, 12 August, 2011, 2:03 On 08/11/2011 03:48 PM, mike 675 wrote: I used to use FOP 0.20.5 to build Japanese PDFs and they looked fine. Now after upgrading to FOP 1.0 the PDF build completes with no errors. But the PDF file is full of # marks. I am running on Red Hat 5.5. # usually means that the font is missing those characters. Make sure you've configured your FO to use a font that does cover the Japanese Unicode range. -- Sergiu Dumitriu http://purl.org/net/sergiu/ - 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: FOP 1.0 Japanese # marks
You don't supply metrics in 1.0. -Original Message- From: mike 675 [mailto:m_mcl...@yahoo.co.uk] Sent: Friday, August 12, 2011 11:35 AM To: fop-users@xmlgraphics.apache.org Subject: RE: FOP 1.0 Japanese # marks I see the config file format has changed from 0.20.5. 0.20.5 config file used these params: embed-file metrics-file 1.0 config file uses these params: embed-url metrics-url Am I on to something? mike 675 wrote: It's the default fop.xconf file. I haven't made any changes or specified any fonts in there. Eric Douglas wrote: Yes and yes Your FOP should have configuration telling it what fonts are available. Your XSLFO should have tags in it telling what font to use. If you can provide more details about what you're doing someone may provide more details about what you're missing. Are you using fop.xconf file? What's that look like? -Original Message- From: michael mclaughlin [mailto:m_mcl...@yahoo.co.uk] Sent: Friday, August 12, 2011 5:23 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP 1.0 Japanese # marks Do you mean configure FOP 1.0 to use a Japanese font? Or is there an XSL stylesheet option to do this? Or do I manually edit the .fo file. Thanks, Mike --- On Fri, 12/8/11, Sergiu Dumitriu ser...@xwiki.com wrote: From: Sergiu Dumitriu ser...@xwiki.com Subject: Re: FOP 1.0 Japanese # marks To: fop-users@xmlgraphics.apache.org Date: Friday, 12 August, 2011, 2:03 On 08/11/2011 03:48 PM, mike 675 wrote: I used to use FOP 0.20.5 to build Japanese PDFs and they looked fine. Now after upgrading to FOP 1.0 the PDF build completes with no errors. But the PDF file is full of # marks. I am running on Red Hat 5.5. # usually means that the font is missing those characters. Make sure you've configured your FO to use a font that does cover the Japanese Unicode range. -- Sergiu Dumitriu http://purl.org/net/sergiu/ - 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 -- View this message in context: http://old.nabble.com/FOP-1.0-Japanese---marks-tp32244995p32251273.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Tool or schema to validate report xsl files
I've used a free version of a tool from editix.com just to validate some xsl syntax. Eclipse Java editor can also edit xsl files. FOP's web page lists which xslfo commands it supports. FOP's input is the xslfo. It accepts xslt along with xml as a convenience only. With embedded code this part can be broken out to a second step which references no FOP classes. -Original Message- From: vjintegrates [mailto:vijaypawnar...@gmail.com] Sent: Monday, August 01, 2011 6:46 AM To: fop-users@xmlgraphics.apache.org Subject: Tool or schema to validate report xsl files Is there tool or schema to validate report xsl files for a specific version of FOP at development time. ? -- View this message in context: http://old.nabble.com/Tool-or-schema-to-validate-report-xsl-files-tp3216 8625p32168625.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Tool or schema to validate report xsl files
Official xslfo keywords are on the official website: http://www.w3.org/TR/xsl/ FOP supported xslfo keywords are on the FOP page: http://xmlgraphics.apache.org/fop/compliance.html You can read about xsd stuff on the official site also: http://www.w3.org/TR/xmlschema-0/ Xsd is optional. I don't use it.. -Original Message- From: vjintegrates [mailto:vijaypawnar...@gmail.com] Sent: Monday, August 01, 2011 9:35 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Tool or schema to validate report xsl files Could you please point me to these - unofficial xsd schema. - There are several unofficial xsd for fo file too. Some tool provide such fo schema... Giuseppe Briotti-2 wrote: 2011/8/1 Eric Douglas edoug...@blockhouse.com: I've used a free version of a tool from editix.com just to validate some xsl syntax. Eclipse Java editor can also edit xsl files. FOP's web page lists which xslfo commands it supports. FOP's input is the xslfo. It accepts xslt along with xml as a convenience only. With embedded code this part can be broken out to a second step which references no FOP classes. I agree with Eric: xml will be transformed to fo via xslt using an appropriate xslt engine (saxon, xalan, etc.). The input format for FOP is fo. You can appropriate validate your xml (if a xsd is provided) and xslt. There are several unofficial xsd for fo file too. Some tool provide such fo schema... G. -- Giuseppe Briotti g.brio...@gmail.com Alme Sol, curru nitido diem qui promis et celas aliusque et idem nasceris, possis nihil urbe Roma visere maius. (Orazio) - 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/Tool-or-schema-to-validate-report-xsl-files-tp32168625p32169695.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: What am I missing (loading custom font to embed)?
Thank you for your interest. It had some problem reading the font in the fop class. I gave up trying to debug it and fixed the error by reloading the project from a previous state. -Original Message- From: Chris Bowditch [mailto:bowditch_ch...@hotmail.com] Sent: Monday, July 25, 2011 8:43 AM To: fop-users@xmlgraphics.apache.org Subject: Re: What am I missing (loading custom font to embed)? On 20/07/2011 21:27, Eric Douglas wrote: This was working before but I changed something in my project, I'm not sure what, now it crashes on the last line of this bit. Crashes you say. What is the stack trace? *public**static**final*FopFactory/myFopFactory/= FopFactory./newInstance/(); TTFFontLoader myTTFLoader; CustomFont myCustomFont; FOUserAgent myUserAgent; myUserAgent =/myFopFactory/.newFOUserAgent(); FontResolver fontResolver =*new*DefaultFontResolver(myUserAgent); InputStream is; String fontFileURI; loadFontFileName = LTYPEB.TTF; is = getClass().getResourceAsStream(/resources/+ loadFontFileName); fontFileURI = DataURLUtil./createDataURL/(is,*null*); myTTFLoader =*new*TTFFontLoader(fontFileURI, fontResolver); myCustomFont = myTTFLoader.getFont(); - 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
What am I missing (loading custom font to embed)?
This was working before but I changed something in my project, I'm not sure what, now it crashes on the last line of this bit. public static final FopFactory myFopFactory = FopFactory.newInstance(); TTFFontLoader myTTFLoader; CustomFont myCustomFont; FOUserAgent myUserAgent; myUserAgent = myFopFactory.newFOUserAgent(); FontResolver fontResolver = new DefaultFontResolver(myUserAgent); InputStream is; String fontFileURI; loadFontFileName = LTYPEB.TTF; is = getClass().getResourceAsStream(/resources/ + loadFontFileName); fontFileURI = DataURLUtil.createDataURL(is, null); myTTFLoader = new TTFFontLoader(fontFileURI, fontResolver); myCustomFont = myTTFLoader.getFont();
RE: unknownFormattingObject
Try attaching a sample so someone can reproduce it. From: Boguslaw Fries [mailto:bfr...@dpd.com.pl] Sent: Tuesday, July 19, 2011 5:03 AM To: fop-users@xmlgraphics.apache.org Subject: unknownFormattingObject Hi, I am using FOP version 1.0 I got the following error java.util.MissingResourceException: Can't find resource for bundle org.apache.fop.util.XMLResourceBundle, key org.apache.fop.fo.FOValidationEventProducer.unknownFormattingObject When I am using FOP 0.95 - same data and same tranformation - there is no error. How to diagnose it? Regards Bogusław Fries DPD Polska Sp. z o.o. 02-274 Warszawa, ul. Mineralna 15 mobile: 502 777 254 bfr...@dpd.com.pl BLOCKED::mailto:bfr...@dpd.com.pl
RE: unknownFormattingObject
Yes, that is an XSL file, which is meaningless without some XML. FOP doesn't process XSL. It accepts XSL input as a convenience which must transform to FO before any FOP classes are involved. From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, July 19, 2011 8:24 AM To: fop-users@xmlgraphics.apache.org Subject: AW: unknownFormattingObject Hi Bogusław, Actually, Eric was talking about the fo-file. Can you post that? 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 http://www.irs-nbg.de Willmy PrintMedia GmbH: www.willmy.de http://www.willmy.de Willmy Consult Content GmbH: www.willmycc.de http://www.willmycc.de Von: Bogusław Fries [mailto:bfr...@dpd.com.pl] Gesendet: Dienstag, 19. Juli 2011 14:11 An: fop-users@xmlgraphics.apache.org Betreff: RE: unknownFormattingObject OK., it is: ?xml version=1.0 encoding=UTF-8? !DOCTYPE xsl:stylesheet [ !ENTITY nbsp #160; !ENTITY start #135; !ENTITY stop #138; !ENTITY tab #9; !ENTITY crlf #13;#10; !ENTITY bull #8226; ] xsl:stylesheet version=2.0 xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:barcode=http://barcode4j.krysalis.org/ns; xsl:output encoding=UTF-8 indent=no/ xsl:strip-space elements=* / xsl:template match=/ fo:root fo:layout-master-set fo:simple-page-master master-name=page-domestic page-height=279mm page-width=210mm margin-top=8mm margin-left=1cm margin-bottom=2mm margin-right=1cm fo:region-body region-name=content margin-top=25mm/ fo:region-before region-name=header-domestic extent=15mm/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=page-domestic force-page-count=no-force fo:static-content flow-name=header-domestic xsl:call-template name=ReportHeader / /fo:static-content fo:flow flow-name=content font-size=12pt fo:block content /fo:block /fo:flow /fo:page-sequence /fo:root /xsl:template xsl:template name=ReportHeader fo:block fo:table table-layout=fixed width=100% fo:table-column column-width=20%/ fo:table-body fo:table-row fo:table-cell fo:block text-align=center fo:instream-foreign-object barcode:barcode xsl:attribute name=message xsl:value-of select=123/ /xsl:attribute barcode:intl2of5 barcode:height11mm/barcode:height barcode:module-width0.375mm/barcode:module-width barcode:wide-factor3.0/barcode:wide-factor barcode:checksumadd/barcode:checksum human-readable placementbottom/placement font-nameArial/font-name font-size8pt/font-size display-checksumtrue/display-checksum /human-readable /barcode:intl2of5 /barcode:barcode /fo:instream-foreign-object /fo:block /fo:table-cell /fo:table-row /fo:table-body /fo:table /fo:block /xsl:template /xsl:stylesheet And error: java.util.MissingResourceException: Can't find resource for bundle org.apache.fop.util.XMLResourceBundle, key org.apache.fop.fo.FOValidationEventProducer.unknownFormattingObject Of course the library barcode4j-fop-ext-complete is attached. When I used fop 0.95 everything is ok. Regerds Bogusław Fries From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Tuesday
RE: pdftops eps font issue
What do you mean create svg? FOP allows svg for input. As far as I know it doesn't have an svg output. Do you have a sample giving you an error using svg input? -Original Message- From: Alberto Priore [mailto:alberto.pri...@gmail.com] Sent: Friday, July 08, 2011 9:47 AM To: fop-users@xmlgraphics.apache.org Subject: Re: pdftops eps font issue This is why I do not tried to use SVG http://xmlgraphics.apache.org/fop/0.95/output.html#svg I my version on FOP if a try to create a svg it returns me that it isn't a allowed format. Michael Rubin-3 wrote: A little bit more research flagged up Batik, which can convert SVG to EPS but I guess that is off at a tangent. There is plenty of talk around using EPS images inside a PDF in FOP and other formatters. But not much about going the other way and converting a PDF to an EPS. Does anyone else have any idea at all? I see Batik can convert SVG to EPS but I gather from the thread that is not an option. Thanks. -Mike On 08/07/11 12:20, 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 - Multibyte characters are not supported. If I write a à è ì ò it will not showed on .ps file, I need to show that charachter. 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 Transform log?
Where does FOP log? 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.
RE: fop .95 PDF generation issue with IE 6 (working fine in IE7)
I hate people who stop supporting my software. It was only recently web sites started popping up which don't display properly in IE6, forcing us to finally install something newer on all the users. Of course IE8 has to be supported indefinitely because WinXP doesn't run IE9 and we can't afford to upgrade their OSs. I don't know anything about servlets. I suspect I should learn soon. -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: Sunday, June 19, 2011 5:42 AM To: fop-users@xmlgraphics.apache.org Subject: Re: fop .95 PDF generation issue with IE 6 (working fine in IE7) On 17 Jun 2011, at 22:07, Chetan Shirol wrote: Hi Chetan I have set the content/type properly to PDF but still the issue is there. Actually we are migrating from fop .25 to .95 and this migration has caused this issue. Yes, but you also mention the issue is limited to IE6. People should really stop supporting it, and push their customers to modern browsers. That's the only way IE6 is ever going to die. (Still have to support it at my day-job too, to my dismay...) For the remainder, we have little context information about your servlet code. Can you check if the hint in the FAQ about using a ByteArrayOutputStream is implemented? (see the note at: http://xmlgraphics.apache.org/fop/1.0/servlets.html#xslt) The issue seems to be that IE6 thinks it has to display a text-file, rather than a PDF. I see no hard evidence so far that the PDF is actually corrupted. Another idea may to force the URL to end in .pdf by adding a dummy parameter. That used to be the way to trick browsers that depend on file extensions in the URL, rather than the content type in the HTTP header... see also: http://xmlgraphics.apache.org/fop/1.0/servlets.html#ie Regards Andreas --- - 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 Extension to handle Wiki Syntax
It could handle any format you want to write your input in as long as it can be translated to FO. If another format is commonly used for generating FOP input someone would just have to write an input translator extension. FOP doesn't even do anything with XML/XSL. It accepts input as XML/XSL as a courtesy extension. I wrote a transform with embedded code starting with data in XML using an XSL to translate it. Then I figured out how to generate FO and split that out as a separate step. That uses the javax transformer. That step doesn't use any FOP objects. If you think about it, output could be considered extensions also. The main task of the FOP is to input FO and generate the IF. Once that's laid out it can take various renderers and generate output so you have a PDF extension, a PNG extension, a TIFF extension, etc. They don't need to be in the FOP package. Someone who only wants to create PDFs doesn't need any classes which create PNGs. If you could break all the extensions out into subprojects it would make it a few extra steps to download but it would be simplified into smaller jars which of course load faster if you don't need them all. -Original Message- From: Christopher R. Maden [mailto:cr...@maden.org] Sent: Tuesday, June 14, 2011 9:44 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP Extension to handle Wiki Syntax On 06/14/2011 07:25 AM, kalgon wrote: Yes I could transform the XML prior to rendering it to PDF but that wouldn't be as nice and clean as an extension which would take care of everything. Moreover, an extension can be reused whereas pre-transforming the XML would require a specific XSLT for each XML schema... definitely not the way I want to go. Except that's how XSL works, and what FOP implements. FOP takes exactly[*] 1 kind of input: the FO markup in XML defined by the XSL Recommendations. Nearly all FOP users, as well as users of other XSL formatters, transform their source either with XSLT or some other tool into FO for presentation to the formatter. If FOP supports MediaWiki syntax natively, why not MoinMoin or some other wiki? Why not HTML, DocBook, DITA, CALS, ...? ~Chris [*] approximately -- Chris Maden, text nerd URL: http://crism.maden.org/ Before I built a wall I'd ask to know / What I was walling in or out, / And to whom I was like to give offence. - RF, Mending Wall GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319 - 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 Extension to handle Wiki Syntax
I'm not sure where I suggested it's not appropriate to consider an extension. I believe I suggested as you say it might be better to rip out the function of allowing XML and XSL as input, to provide a separate convenience jar and/or the code to embed that process, since creating the FO doesn't involve any fop classes. I already split out that process in my embedded code if you want to see the 2 step. I don't know what the wiki text looks like or how common it might be for users to want to use it as input. If it has a standard format which can be translated to FO tags and someone wants to write the code to translate it, it would be nice if code like that could be included as a separate download on the fop site. I'm not sure what you consider an extension (plugin?) if they're normally compiled into the fop.jar, if they're separate jars to download to call as separate tasks, or if they're separate jars to put on the classpath to accept different types of values from the mainline fop (ie the -xml -xsl tags)? I think anything unique to one type of input or output can be a separate jar with the code kept separately whether you call them extensions, plugins, or subprojects. They can either be documented second step processes (output of this = input of that) or extension options (use -xml and -xsl tags to send input as xml instead of the -fo tag). From: Glenn Adams [mailto:gl...@skynav.com] Sent: Tuesday, June 14, 2011 10:47 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP Extension to handle Wiki Syntax You know, given the time spent answering questions about XSL and the XML+XSL - XSL-FO front-end (convenience mechanism) in FOP, I sometimes wonder if it would be better to rip out that function. Perhaps then folks would understand better that FOP is fundamentally an XSL-FO - output format processor. As to the original comment, I agree with Eric that is is not appropriate to consider an FOP extension to accommodate semantics that apply to the XML+XSL - XSL-FO 'convenience mapping' mechanism. G. On Tue, Jun 14, 2011 at 8:29 AM, Eric Douglas edoug...@blockhouse.com wrote: It could handle any format you want to write your input in as long as it can be translated to FO. If another format is commonly used for generating FOP input someone would just have to write an input translator extension. FOP doesn't even do anything with XML/XSL. It accepts input as XML/XSL as a courtesy extension. I wrote a transform with embedded code starting with data in XML using an XSL to translate it. Then I figured out how to generate FO and split that out as a separate step. That uses the javax transformer. That step doesn't use any FOP objects. If you think about it, output could be considered extensions also. The main task of the FOP is to input FO and generate the IF. Once that's laid out it can take various renderers and generate output so you have a PDF extension, a PNG extension, a TIFF extension, etc. They don't need to be in the FOP package. Someone who only wants to create PDFs doesn't need any classes which create PNGs. If you could break all the extensions out into subprojects it would make it a few extra steps to download but it would be simplified into smaller jars which of course load faster if you don't need them all. -Original Message- From: Christopher R. Maden [mailto:cr...@maden.org] Sent: Tuesday, June 14, 2011 9:44 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP Extension to handle Wiki Syntax On 06/14/2011 07:25 AM, kalgon wrote: Yes I could transform the XML prior to rendering it to PDF but that wouldn't be as nice and clean as an extension which would take care of everything. Moreover, an extension can be reused whereas pre-transforming the XML would require a specific XSLT for each XML schema... definitely not the way I want to go. Except that's how XSL works, and what FOP implements. FOP takes exactly[*] 1 kind of input: the FO markup in XML defined by the XSL Recommendations. Nearly all FOP users, as well as users of other XSL formatters, transform their source either with XSLT or some other tool into FO for presentation to the formatter. If FOP supports MediaWiki syntax natively, why not MoinMoin or some other wiki? Why not HTML, DocBook, DITA, CALS, ...? ~Chris [*] approximately -- Chris Maden, text nerd URL: http://crism.maden.org/ Before I built a wall I'd ask to know / What I was walling in or out, / And to whom I was like to give offence. - RF, Mending Wall GnuPG Fingerprint
RE: FOP with embedded font running in Oracle 10g
I'm wondering that myself. I tested loading in images when I first started using it and had some issues with the path reference to get FOP to find the image file. I haven't gotten back to it. That's on my to do list. My workaround was to load my image into a program which saved it as SVG draw commands and I put it directly into my XSL. Of course this means I can only use one image but that's all I needed for now. To load in custom fonts embedded in the jar I did this. TTFFontLoader myTTFLoader; MultiByteFont myCustomFont; ArrayListFontTriplet myFontTriplets; Object[] myFontFamilyNames; String familyName; String loadFontPath; String loadFontFileName; EmbedFontInfo myEmbedFontInfo; FOUserAgent myUserAgent = createFOUserAgent(); InputStream is; String fontFileURI; AbstractRendererMaker myAbstractRendererMaker; PDFRenderer myPDFRenderer; RendererFactory myRendererFactory; // Load Normal Font loadFontPath = /resources/; loadFontFileName = LTYPE.TTF; is = getClass().getResourceAsStream(loadFontPath + loadFontFileName); fontFileURI = DataURLUtil.createDataURL(is, null); myTTFLoader = new TTFFontLoader(fontFileURI, new DefaultFontResolver(myUserAgent)); myCustomFont = (MultiByteFont)myTTFLoader.getFont(); myFontTriplets = new ArrayListFontTriplet(); myFontFamilyNames = myCustomFont.getFamilyNames().toArray(); if (myFontFamilyNames.length 1) { System.err.println(WARNING: Font + loadFontPath + loadFontFileName + Cannot Find Font Families); } else if (myFontFamilyNames.length 1) { System.err.println(WARNING: Font + loadFontPath + loadFontFileName + Contains Multiple Font Families); } else { familyName = (String) (myFontFamilyNames[0]); myNormalFont = new FontTriplet(familyName, Font.STYLE_NORMAL, myCustomFont.getWeight()); myFontTriplets.add(myNormalFont); } myEmbedFontInfo = new EmbedFontInfo(null, myCustomFont.isKerningEnabled(), myFontTriplets, fontFileURI, ); myFontList.add(myEmbedFontInfo); is.close(); // Setup custom renderer myRendererFactory = myUserAgent.getRendererFactory(); myAbstractRendererMaker = myRendererFactory.getRendererMaker(MimeConstants.MIME_PDF); myPDFRenderer = (PDFRenderer) (myAbstractRendererMaker.makeRenderer(myUserAgent)); myPDFRenderer.setUserAgent(myUserAgent); myPDFRenderer.setFontList(myFontList); myPDFRenderer.setupFontInfo(new FontInfo()); myUserAgent.setRendererOverride(myPDFRenderer); -Original Message- From: Flipz-007 [mailto:flipz-...@seznam.cz] Sent: Friday, June 03, 2011 6:31 PM To: fop-users@xmlgraphics.apache.org Subject: RE: FOP with embedded font running in Oracle 10g Ok, it sound great. Could you notice any example please? I have also another question - is there any way how to register images stored inside java archive? And then how to specify path in FO element fo:external-graphic src=url('...path...')/ ? Small example would be very useful... Thank you Jiri If you're using embedded code doing your own transform with all custom fonts you can use FOP's FontLoader classes to manually load your own fonts into the renderer. It's a bit more complicated but it should run faster than trying to find the font on the path. -Original Message- From: Michael Rubin [mailto:mrubin@...] Sent: Friday, June 03, 2011 6:38 AM To: fop-users@... Subject: Re: FOP with embedded font running in Oracle 10g Ooh didn't know about that. Shows I'm still very new to FOP and learning all the while... This sounds much better than my idea to programmatically extract the font to a temporary location which may be disregarded... Thanks. -Mike On 03/06/11 11:33, Theresa Jayne Forster wrote: Are you just saying your Java App has to be able to access the font to create the PDF based on data from the database or are you saying you have to store the ttf file inside the database? The former, just useauto-detect/ in the fopconfig. With 1.0 it searches the classpath (which includes your application Jar) to find fonts, and you can also have external jar files containing the Fonts as well. Auto-Detect and auto-embed feature When the auto-detect flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system. FOP will also auto-detect fonts which are available in the classpath, if they are described as application/x-font in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf: Manifest-Version: 1.0 Name: font/myfont.ttf Content-Type: application/x-font This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providing them in the classpath, e.g. copying them into the lib/ directory. Kindest regards Theresa Forster Senior Software Developer [hide part of quote] Michael Rubin Developer T: +44 20 8238 7400 F: +44 20 8238 7401 mrubin@... The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless
RE: Problems since upgrading,
I'm not sure what you're trying to do here but XSL is not used by FOP. For convenience, FOP can accept FO input or XML and XSL input but it only uses the FO. I'm using embedded code to transform XML with an XSL, and for debugging I wanted to see the FO, so I split out the FOP and call the transform twice. I'm not sure what you mean by calculations on page number. If you're letting FOP overrun blocks to show one thing on multiple pages you can get the page count after the transform, and you can call the transform again if you retain your input. If you can do what I do and just know what fits on a page, you can call the transform once for each page. I started doing that to save memory and I can generate really large reports. I just have to pass a value in with each input to use the xsl:initial-page-number so the first page of the second document can come out identified as page 2. I retain the PDFs in memory, no physical files have to be written, and I create PDF objects with them using the pdfbox project which is able to create a new PDF and copy in the pages. I tested this on a report with over 1800 pages. Trying to get FOP to put that all in one document crashed out of memory long before that. From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: Friday, June 03, 2011 9:04 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Problems since upgrading, On that note, is it possible to chain XSL files on the fop input, or even make it double process, Ie multi pass processing to allow for calculations on page number etc? Kindest regards Theresa Forster Senior Software Developer
RE: Hair ripping time
1. You can and should reuse the TransformerFactory. 2. FO is not a stylesheet. The FO is the input to the transform, where you were putting the XML not the XSL. Leave out the XSL part on the FO one. From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: Friday, June 03, 2011 10:30 AM To: fop-users@xmlgraphics.apache.org Subject: Hair ripping time Ok I cannot see what is wrong here, A test app does this Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); TransformerFactory factory = TransformerFactory.newInstance(); Source xslt = new StreamSource(new File(C:/sample.xsl)); Transformer transformer = factory.newTransformer(xslt); And works fine, The app I am working on does this Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(inputFO)); And it immediately jumps out when it hits the newTransformer() line In the first it's an xslt, in the second it's a FO file, do I have to do something different for that? WTF aren't these the same, and why does so much of FOP jump out without even trying to give debug output? Or is there a way of doing that? Kindest regards Theresa Forster Senior Software Developer
RE: FOP with embedded font running in Oracle 10g
If you're using embedded code doing your own transform with all custom fonts you can use FOP's FontLoader classes to manually load your own fonts into the renderer. It's a bit more complicated but it should run faster than trying to find the font on the path. -Original Message- From: Michael Rubin [mailto:mru...@thunderhead.com] Sent: Friday, June 03, 2011 6:38 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP with embedded font running in Oracle 10g Ooh didn't know about that. Shows I'm still very new to FOP and learning all the while... This sounds much better than my idea to programmatically extract the font to a temporary location which may be disregarded... Thanks. -Mike On 03/06/11 11:33, Theresa Jayne Forster wrote: Are you just saying your Java App has to be able to access the font to create the PDF based on data from the database or are you saying you have to store the ttf file inside the database? The former, just useauto-detect/ in the fopconfig. With 1.0 it searches the classpath (which includes your application Jar) to find fonts, and you can also have external jar files containing the Fonts as well. Auto-Detect and auto-embed feature When the auto-detect flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system. FOP will also auto-detect fonts which are available in the classpath, if they are described as application/x-font in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf: Manifest-Version: 1.0 Name: font/myfont.ttf Content-Type: application/x-font This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providing them in the classpath, e.g. copying them into the lib/ directory. Kindest regards Theresa Forster Senior Software Developer 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. -Original Message- From: Flipz-007 [mailto:flipz-...@seznam.cz] Sent: 03 June 2011 10:04 To: fop-users@xmlgraphics.apache.org Subject: FOP with embedded font running in Oracle 10g Dear all, I need to create Java application which will generate PDF report from given data. This application needs to be run in Oracle DB 10g environment as a stored procedure. The main problem is that I don't know how to configure FOP to use my specific font which is embedded in application jar as a resource. In Internet there are many examples how to configure FOP if the font is located on filesystem, but in my case I need to load the font into DB inside my java archive. I searched through the Internet but I didn't find any solution. Could you give me any advice please? Thank you very much. Jiri - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - 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
Measuring
How does Fop measure? If I put a tag in my .fo for fo:block-container position=absolute left= ... Does it measure in pixels / points (are they the same thing?)? Do I need to specifiy? left=10px or just left=10? It appears to work the same with or without a unit of measure, assuming the page measurement to be 72PPI, but I don't want to make an assumption and be wrong later.
RE: Measuring
That's exactly what I was looking for on block placement, thanks. What about SVG? My SVG code looks like this (doesn't mention UOM). fo:instream-foreign-object content-width=236.25 content-height=auto scaling=non-uniformsvg:svg preserveAspectRatio=xMinYMin meet width=100% height=100% viewBox=0,0,556,84svg:path d= M 0.00 0.00 L 0.30 0.00 ... Can I assume that is pt? I'm assuming page size is 792 x 612 (or 612 x 792 landscape). From: Glenn Adams [mailto:gl...@skynav.com] Sent: Thursday, June 02, 2011 10:36 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Measuring length in XSL-FO is as defined by CSS 2. A unit designator is required unless the value is 0. The available unit designators are: * em * ex * in * cm * mm * pt * pc * px The unit 'pt' is an absolute measurement equal to 1/72 inch. FOP non-conformantly permits unit-less lengths not equal to zero, in which case it is interpreted as 'px', which is device/implementation dependent. If you want a precise, absolute measurement, use 'pt', 'mm', or another absolute unit. Glenn On Thu, Jun 2, 2011 at 8:16 AM, Eric Douglas edoug...@blockhouse.com wrote: How does Fop measure? If I put a tag in my .fo for fo:block-container position=absolute left= ... Does it measure in pixels / points (are they the same thing?)? Do I need to specifiy? left=10px or just left=10? It appears to work the same with or without a unit of measure, assuming the page measurement to be 72PPI, but I don't want to make an assumption and be wrong later.
RE: Problems since upgrading,
heavy is not a standard keyword. If you select the wrong value for the fonts you have loaded it should log a warning for font replacement. Keywords translate to specific numbers. You would want to use the numbers instead of the words to be sure it's always correct. They might think light is 200 but your light font has a weight of 100, or normal 300 / 400 etc. http://www.w3.org/TR/CSS2/fonts.html#font-boldness Standard keywords are normal (400) and bold (700), and lighter / bolder (relative to parent). From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: Thursday, June 02, 2011 10:46 AM To: fop-users@xmlgraphics.apache.org Subject: Problems since upgrading, Since upgrading the fop I use from 0.23 to 1.0 I am now getting problems One of which is that the font designations I used to use are now no longer possible, and was wondering why this has seemingly changed, and is there plans to support the method I am used to using? Before fo:block font-family=Frutiger font-style=normal font-weight=heavy/ Now apparently I need to do weight as a number 700=bold etc Kindest regards Theresa Forster Senior Software Developer
dash
I ran into a minor issue. I can't get Fop to print dashes. I've tried passing in various codes that look like dashes, like #151; but it just wraps to the next line instead of printing. Other codes just print squares. I would think there should be just a print code. I'll try the workaround today to just set the attribute to no wrap.
RE: dash
If I use any character for dash it may print a dash but it follows it with a linefeed. I tried the #x2014; code you mention and it did the same thing. I was not specifying the wrap-option attribute anywhere. I just tried a test adding wrap-option=no-wrap and it printed correctly. -Original Message- From: Pascal Sancho [mailto:pascal.san...@takoma.fr] Sent: Tuesday, May 17, 2011 8:49 AM To: fop-users@xmlgraphics.apache.org Subject: Re: dash Hi Eric, #151; (AKA #x97;) is the control code for [EPA] (END OF GUARDED AREA). (While in Windows Codepage 1252 this is the code for Dash). With unicode encoding (like UTF-8), you should use the code #x2014; (EM dash) or #x2014; (EN dash). I don't remember if this character is handled with ISO 8851-1. Le 17/05/2011 14:30, Eric Douglas a écrit : I ran into a minor issue. I can't get Fop to print dashes. I've tried passing in various codes that look like dashes, like #151; but it just wraps to the next line instead of printing. Other codes just print squares. I would think there should be just a print code. I'll try the workaround today to just set the attribute to no wrap. -- Pascal - 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: AWTRenderer With Intermediate Format
Are you using embedded code? Do you have a better description, any example, of what exactly you're trying to do? Source code? Test files? I'm sure this is possible but there are several ways to do it depending what exactly your goal is. I needed it to break up large reports because I kept running out of memory. I just broke up my input to multiple jobs, setting an initial-page-number attribute under my fo:page-sequence. I'm currently using the PDFRenderer and the PNGRenderer. The PDFs create in memory and I merge them using pdfbox. The PNGs are already in an array so I just add the next set of pages without resetting the array. Are you doing everything on one machine? I tried using the AWTRenderer initially to create a print preview, but if you're able to transform on a server and display on a client as I am I think you'll find the PNGRenderer to be a much faster method as I did. -Original Message- From: Jonathan Spooner [mailto:spooner...@gmail.com] Sent: Tuesday, May 17, 2011 9:41 AM To: fop-users@xmlgraphics.apache.org Subject: AWTRenderer With Intermediate Format Hello, Is it currently possible to render an intermediate format with the AWTRenderer? I am using the intermediate format to concatenate pages as shown in the ExampleConcat.java example and I would like to be able to render the results to an AWTRenderer. I've found a post in the archive that hinted at the capability (http://www.mail-archive.com/fop-users@xmlgraphics.apache.org/msg09528.h tml) but it does not work with FOP 1.0. - 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: How do I set page margins?
If I'm reading this right, you're suggesting I hard code any margins I might want into different From: Rob Sargent [mailto:rsarg...@xmission.com] Sent: Friday, May 13, 2011 2:47 PM To: fop-users@xmlgraphics.apache.org Subject: Re: How do I set page margins? On 05/13/2011 12:20 PM, Eric Douglas wrote: The basic page margin is in the page setup. fo:simple-page-master xsl:attribute name=margin-topxsl:value-of select=MT//xsl:attribute This works at the top level but sets the same margin for all pages. What if I want each page to be different? I can assign this attribute from an xsl:variable if I create that variable above the fo:layout-master-set section. If I assign a value for it down below within the fo:page-sequence it doesn't seem to have an effect. I generate the XML myself to calculate what goes on each page, so the page processing looks like this. fo:page-sequence fo:flow xsl:for-each select=PD fo:block xsl:attribute name=break-beforepage/xsl:attribute I tried moving that margin-top attribute to that fo:block and it doesn't look like it's having any effect, though it does indent my text blocks if I add a margin-left to that block. I suspect you have to define your simple-page-masters, filling in the margin values, then lay out their order of appearance(s) in a page-sequence-master.
How do I set page margins?
The basic page margin is in the page setup. fo:simple-page-master xsl:attribute name=margin-topxsl:value-of select=MT//xsl:attribute This works at the top level but sets the same margin for all pages. What if I want each page to be different? I can assign this attribute from an xsl:variable if I create that variable above the fo:layout-master-set section. If I assign a value for it down below within the fo:page-sequence it doesn't seem to have an effect. I generate the XML myself to calculate what goes on each page, so the page processing looks like this. fo:page-sequence fo:flow xsl:for-each select=PD fo:block xsl:attribute name=break-beforepage/xsl:attribute I tried moving that margin-top attribute to that fo:block and it doesn't look like it's having any effect, though it does indent my text blocks if I add a margin-left to that block.
RE: Problem with whitespace-treatment
I couldn't get it to print blank spaces properly either. If you can modify your xml the simple solution is to replace all spaces. I replace blank spaces with #160; From: Michael Seeberger [mailto:michael.seeber...@isys-software.de] Sent: Wednesday, May 11, 2011 9:37 AM To: fop-users@xmlgraphics.apache.org Subject: Problem with whitespace-treatment Hello, i have a problem with whitespace-treatment in FOP. I'm using FOP 1.0 and can't get my text formatted the way i want to: my formatted text is (leading whitespaces before Bank, BLZ, Konto and Empfänger) Bank: X BLZ:X Konto: X Empfänger:X Gutschriften überweisen wir auf die uns seinerzeit mitgeteilte Bankverbindung. Sofern sich diese geändert haben sollte, bitten wir zur Vermeidung von Fehlbuchungen um Bekanntgabe. the value in my xml-tag is: abrechnungsfreitext isMonospace=false text=Bank: X#xA;BLZ:X#xA;Konto: X#xA;Empfänger: X#xA;#xA;Gutschriften überweisen wir auf die uns seinerzeit mitgeteilte Bankverbindung. Sofern sich diese geändert haben sollte, bitten wir zur Vermeidung von Fehlbuchungen um Bekanntgabe. / i tried several combinations of white-space-collapse, white-space-treatment and linefeed-treatment. For example when using 1. white-space-collapse=false, linefeed-treatment=preserve, white-space-treatment=preserve or ignore-if-before-linefeed = The text Gutschriften überweisen gets wrapped at diese and a leading whitespace is added to the following line so it looks like this: Gutschriften überweisen wir auf die uns seinerzeit mitgeteilte Bankverbindung. Sofern sich diese geändert haben sollte, bitten wir zur Vermeidung von Fehlbuchungen um Bekanntgabe. 2. white-space-collapse=false, linefeed-treatment=preserve, white-space-treatment=ignore-if-after-linefeed or ignore-if-surrounding-linefeed = The leading whitespaces before Bank, BLZ etc. are beeing ignored so the text is printed this way; Bank: X BLZ:X Konto: X Empfänger:X Gutschriften überweisen wir auf die uns seinerzeit mitgeteilte Bankverbindung. Sofern sich diese geändert haben sollte, bitten wir zur Vermeidung von Fehlbuchungen um Bekanntgabe. Is there a way to prevent FOP from deleting the inserted whitespaces before Bank, and inserting a whitespace when performing an automatic linebreak?? I hope you get my point and can help me. Thx Michael Seeberger
Can you mix page values in the same report?
Am I missing something? Is there a way to pass the page parameters as variables? I have an fo:flow nested inside a fo:page-sequence tag. The fo:page-sequence has a master-reference attribute which points to a master-name attribute of a fo:simple-page-master tag. The fo:simple-page-master has all the page attributes (reference-orientation, margin-right, etc). The fo:flow tag processes pages from the xml with an xsl:for-each tag. Within the for-each loop new pages are generated with fo:block having a break-before=page attribute. Is there any way to pass in variable values, to for instance say a 10 page report should have page 2 rotated 90 degrees? I tried specifying different values within xml tags under the tags being processed by the for-each, but with conditional attributes set up in the simple-page-master to look for these values, all pages come out the same.
RE: Change bars
I'm currently drawing lines with xslfo code programatically, so yes I do it with absolute positioning and it may be difficult to do if you need to print something without absolute positioning. I had started out trying to set a border on a block to draw a line and ended up drawing the block as such. fo:block-container xsl:attribute name=positionabsolute/xsl:attribute xsl:attribute name=background-colorblack/xsl:attribute xsl:attribute name=padding-top0px/xsl:attribute xsl:attribute name=padding-bottom0px/xsl:attribute xsl:attribute name=padding-left0px/xsl:attribute xsl:attribute name=padding-right0px/xsl:attribute fo:block xsl:attribute name=line-height0/xsl:attribute xsl:attribute name=linefeed-treatmentpreserve/xsl:attribute /fo:block /fo:block-container Then of course I set the left, top, width, and height attributes to tell it where to draw. -Original Message- From: Fredrik Bengtsson [mailto:fredrik.bengts...@lemontree.se] Sent: Monday, May 02, 2011 3:57 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Change bars You mean absolutely positioned AT blocks, not fo:blocks? Right, I thought I'd do something like that. It'd be hard to solve at the FO level at any rate, for corner cases like tables, indented/nested blocks or variablelists. Do you mean that this is a sort of confirmation of the proposed method, that you are doing something similar? I tried just blindly adding a new attribute to my FO blocks but FOP-trunk choked on that because it did not recognize the foreign attributes. So I assume I'll have to handle them somehow specially? I seem to remember an old mail discussion that mentioned using ID attributes, maybe that is a way forward? Has anybody else experimented with having custom information fall through to the intermediate formats in general? /F -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Monday, May 02, 2011 5:49 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Change bars If you're just trying to draw lines you can do what I do. Currently I'm using empty block tags with border attributes. When I get around to rewriting it I want to use actual SVG line drawing commands. -Original Message- From: Fredrik Bengtsson [mailto:fredrik.bengts...@lemontree.se] Sent: Sunday, May 01, 2011 4:53 PM To: fop-users@xmlgraphics.apache.org Subject: Change bars Hey, I'm trying to make a workaround for the lack of change bar support in FOP. I was thinking about making a two-pass solution that analyzes the area tree and adds additional content where necessary. I have really modest needs so maybe that could be workable. * No nesting, only one class * Just thin simple black lines, ok if they overlap since that won't be visible * Always positioned on the exact same x-position relative to the left page margin * Just apply on entire building blocks (such as paragraphs, a title etc) However, that would need some form of tagging in the AT, that is lifted from the transform stage. That is, ideally I'd like to be able to add a myns:changed=true attribute to my input docbook blocks, and that would result in block elements in the AT that are decorated in such a way that I can pick it up. I can't just add a border-left at the fo level though, because the changed blocks might be part of a variable list or other types of elements that aren't flush with the left edge. Has anybody done something like this? Does it sound silly? Any other suggestions for workarounds? Regards, /Fredrik - 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: PDF size reduction
It should depend on how the image is referenced, if it's embedding the image once in the document, if it's referenced multiple times and embedding it multiple times, or if it's an external link. The obvious answer if you don't care about quality is to reduce the size of the image before you try to embed it. There are many programs which can transform an image to a smaller file, which you could do with either embedded code or a batch script. From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Monday, May 02, 2011 11:13 AM To: fop-users@xmlgraphics.apache.org Subject: PDF size reduction Hello fop users! Is there a way in FOP to reduce the size of the PDF? We are embedding the PDF with a high resolution graphics which creates a huge PDF document. One of the departments here at work would prefer a smaller PDF document, and they don't care about the quality of the graphics. Is there a way we can do this? Note, we are only using the batch file of FOP to generate the PDF. Thank you for your response. -Roberto 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.
RE: Change bars
If you're just trying to draw lines you can do what I do. Currently I'm using empty block tags with border attributes. When I get around to rewriting it I want to use actual SVG line drawing commands. -Original Message- From: Fredrik Bengtsson [mailto:fredrik.bengts...@lemontree.se] Sent: Sunday, May 01, 2011 4:53 PM To: fop-users@xmlgraphics.apache.org Subject: Change bars Hey, I'm trying to make a workaround for the lack of change bar support in FOP. I was thinking about making a two-pass solution that analyzes the area tree and adds additional content where necessary. I have really modest needs so maybe that could be workable. * No nesting, only one class * Just thin simple black lines, ok if they overlap since that won't be visible * Always positioned on the exact same x-position relative to the left page margin * Just apply on entire building blocks (such as paragraphs, a title etc) However, that would need some form of tagging in the AT, that is lifted from the transform stage. That is, ideally I'd like to be able to add a myns:changed=true attribute to my input docbook blocks, and that would result in block elements in the AT that are decorated in such a way that I can pick it up. I can't just add a border-left at the fo level though, because the changed blocks might be part of a variable list or other types of elements that aren't flush with the left edge. Has anybody done something like this? Does it sound silly? Any other suggestions for workarounds? Regards, /Fredrik - 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: AW: AW: OutOfMemoryException while transforming large XML to PDF
I currently only have one fo:page-sequence tag in my xsl. How would auto page numbering with fo:page-number work otherwise? Is it possible the memory requirements could be reduced for extremely large documents by adding an option to swap some values out to temp files? Maybe save information in a file for each 100 pages? -Original Message- From: Dennis van Zoerlandt [mailto:dvzoerla...@vanboxtel.nl] Sent: Friday, April 01, 2011 10:25 AM To: fop-users@xmlgraphics.apache.org Subject: Re: AW: AW: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF Hi Georg, At this moment we don't use fixed page breaks, just 1 page-sequence. The stylesheet files are generated with Digiforms Designer. Best regards, Dennis van Zoerlandt Georg Datterl wrote: Hi Dennis, Page-sequences start with a new page. If you start a new page-sequence instead of inserting a fixed page break, the layout does not change, as far as I can tell. 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: Dennis van Zoerlandt [mailto:dvzoerla...@vanboxtel.nl] Gesendet: Freitag, 1. April 2011 13:13 An: fop-users@xmlgraphics.apache.org Betreff: Re: AW: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF Hi Andreas, Alright, it seems a logical explanation you need a large heap to produce this kind of large documents. Font auto detection seems to be off. In the FOP configuration file no auto-detect flag is present and I also didn't include a manifest file with x-fonts. I will look further into modifying the XSL file in a such way multiple page-sequences are used. I think it's the best solution this far. Am I correct to say multiple page-sequences won't affect the definitive page lay-out of the PDF file? How can I split up the content in multiple page-sequences? I think there's also a modification necessary in the XML input file? Another question: is there a reliable way to 'predict' or calculate the page count the PDF file will have, before any transformation is started? I can check the file size of the XML input file, but that isn't really reliable because the complexity of the XSL stylesheet is also a factor. I'm thinking of aborting the task when the resulting PDF file will have 100+ pages (for instance). Is this possible? Best regards, Dennis van Zoerlandt Andreas Delmelle-2 wrote: On 31 Mar 2011, at 15:08, Dennis van Zoerlandt wrote: Hi Dennis In the meanwhile I have tested a few things. In the attachment you'll find a FO file ( http://old.nabble.com/file/p31286241/fop1.0-5000-fo.zip fop1.0-5000-fo.zip ) which has scrambled data because of confidentiality. I created the FO file with XMLspy and tried to create a PDF file with Apache FOP 1.0 (fop.bat) on my Windows XP workstation. It produced (what it seems) this error (see below). No PDF file was created. It seems like the classic cram all content into one page-sequence issue. With a file of that size, there is little or nothing you can do. The current architecture of FOP does not allow to render such documents without a sufficiently large heap. That said: I wrote the above while I was running your sample file (with FOP Trunk, using Saxon as XSLT/JAXP implementation), and it just completed on my end, with a heap of 1GB. It did take about 7 minutes, but still... I got a nice output file of 455 pages. I doubt that it is related to images, as there is only one fo:external-graphic. Do you have font auto-detection enabled, by any chance? That might consume an unnecessary amount of heap space, for example, if you only actually use a handful of custom fonts, but have a large number of those installed on your system. Another option is that some fixes for memory-leaks, applied to Trunk after the 1.0 release, are actually helping here. Splitting the XML input file into several chunks is not a preferable option for me, nevertheless it is a valid one. Note: it is, strictly speaking, not necessary to split up the input so that you have several FOs. What would suffice is to modify the stylesheet, so that the content is divided over multiple page-sequences. If you can keep the size of the page-sequences down to, say, 30 to 40 pages, that might already reduce the overall memory usage significantly. There are known cases of people rendering documents of +10.000 pages. No problem, iff not all of those pages are generated by the same
RE: AW: AW: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF
I only reference the words page-sequence once. Is this the single page sequence problem you're talking about, or is my page loop referencing multiple page sequences? My input is already formatted so I know what goes on each page. I just need the pages connected for the page variable references with fo:page-number keeping track of the page count, and an fo:page-number-citation needing to know the number of the last page which I do with the empty block. fo:page-sequence xsl:attribute name=master-referenceSTANDARD_PAGE/xsl:attribute fo:flow xsl:attribute name=flow-namexsl-region-body/xsl:attribute xsl:for-each select=PAGE_DATA fo:block xsl:attribute name=break-beforepage/xsl:attribute ... /fo:block /xsl:for-each fo:block xsl:attribute name=idlast-page/xsl:attribute xsl:attribute name=positionabsolute/xsl:attribute xsl:attribute name=left0/xsl:attribute xsl:attribute name=top0/xsl:attribute xsl:attribute name=width0/xsl:attribute xsl:attribute name=height0/xsl:attribute /fo:block /fo:flow /fo:page-sequence If the conserve option can help with memory use for very large reports I'll look for it, but I don't call it from the command line. My code is all embedded. -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: Friday, April 01, 2011 2:32 PM To: fop-users@xmlgraphics.apache.org Subject: Re: AW: AW: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF On 01 Apr 2011, at 16:47, Eric Douglas wrote: I currently only have one fo:page-sequence tag in my xsl. How would auto page numbering with fo:page-number work otherwise? If you do not use the 'initial-page-number' property, the numbering for the next page-sequence just continues from where the previous one left off. In other words, by default, page-number does work across page-sequences. See also: http://www.w3.org/TR/xsl/#initial-page-number Is it possible the memory requirements could be reduced for extremely large documents by adding an option to swap some values out to temp files? Maybe save information in a file for each 100 pages? We already have a '-conserve' option on the command line, that results in pages being serialized to disk to avoid keeping them in memory, but that would likely not help in this particular situation. It is meant to be used in conjunction with multiple page-sequences if there are a lot of cross-references. That is a scenario where even multiple page-sequences might still consume too much memory for the remainder of the process to run smoothly. Regards Andreas --- - 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: Thread safe?
What Saxon are you talking about? The Saxon project (http://saxon.sourceforge.net/)? The Oracle sax (http://download.oracle.com/javase/6/docs/api/javax/xml/transform/sax/SA XTransformerFactory.html)? Would a Transformer work any better if it's created from the sax factory rather than the TransformerFactory? Transformer = javax.xml.transform.TransformerFactory.newTransformer() Vs Transformer = javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler().ge tTransformer() Somehow they both arrive at javax.xml.transform.Transformer. -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: Tuesday, March 29, 2011 5:11 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Thread safe? On 29 Mar 2011, at 22:55, Eric Douglas wrote: I have yet to see any threading problems with the FOP objects. Well, there probably are /some/, but in general, care has been taken to make sure that each rendering-run is isolated, and the process itself is currently completely single-threaded (which does leave room for optimization on the one hand, extra debugging headaches on the other ;-)). Those parts that are meant to be shared among threads are usually properly synchronized, although glitches do pop up from time to time. Mostly in the Java2D/AWT area. Understandable, since the API docs do not mention anything about classes not being thread-safe, and often it concerns the real 'innards' of the JVM, and you'll find some sun.com classes in the stack trace, references to native methods, etc. Nothing we could have foreseen... My error seems to be just on Oracle's Transformer. Ahaaa!!! Them again! :-) So, you're saying it doesn't happen with, say, Saxon? Regards, Andreas --- - 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
Thread safe?
I think this is what they mean by thread safe. I seem to have a concurrency issue. If I call a transform using the Fop handler with a PNGRenderer from 2 JVM sessions at or near the same time one crashes. I haven't been able to reproduce the problem so far with the PDFRenderer so either it doesn't have the issue or my timing is off on attempting to use it in 2 sessions at once.
RE: Thread safe?
Ok I crashed it again and checked the stack. This must be crashing on the PDF rendering too. My test must not have run 2 of those at the same time or close enough together. My PNG tests shouldn't be running at exactly the same time but one must be close enough behind the other. It actually crashes before it gets into the render. I am of course using embedded code. I had it creating a transformer with an xsl file and passing in the xml file as input and the fo handler as output to render it all at once. I split that to pass an empty stream as output so it creates an fo file then created a second transformer without the xsl to pass that in with the fop handler to render the output. It's actually crashing on the first transformer. It only crashes if I run 2 of these at once. Is there something obvious I'm missing in this java code? File myXslFile; FileInputStream myXslFIS; byte[] myXslSource; ByteArrayInputStream myXslBAIS; InputSource myXslIS; myXslFile = new File(xslPath + xslFile); myXslFIS = new FileInputStream(myXslFile); myXslSource = new byte[myXslFIS.available()]; myXslFIS.read(myXslSource); myXslFIS.close(); myXslBAIS = new ByteArrayInputStream(myXslSource); myXslIS = new InputSource(myXslBAIS); myXslSS = new SAXSource(myXslIS); myFoByteArrayOutputStream = new ByteArrayOutputStream(); myStreamResult = new StreamResult(myFoByteArrayOutputStream); myXmlSAXSource = createSAXSource(myXmlByteData); myTransformer = myTransformerFactory.newTransformer(myXslSS); myTransformer.setParameter(versionParam, 2.0); myTransformer.transform(myXmlSAXSource,myStreamResult); I get this error on the setParameter line. [Fatal Error] :2:2: The markup in the document preceding the root element must be well-formed. SystemId Unknown; Line #2; Column #2; org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed. null java.lang.NullPointerException -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: Tuesday, March 29, 2011 1:48 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Thread safe? On 29 Mar 2011, at 17:29, Eric Douglas wrote: Hi Eric I think this is what they mean by thread safe. I seem to have a concurrency issue. If I call a transform using the Fop handler with a PNGRenderer from 2 JVM sessions at or near the same time one crashes. I haven't been able to reproduce the problem so far with the PDFRenderer so either it doesn't have the issue or my timing is off on attempting to use it in 2 sessions at once. The answer is that the PDFRenderer is entirely under our control --and thus we are virtually certain it works well with concurrent runs--, while the PNGRenderer (and also other formats, like TIFF) relies heavily on Java2D and AWT. Those latter libraries are not thread-safe themselves, and not always used in a thread-safe manner in XMLGraphics and FOP... Do you have a stack trace to go with the crash? If yes, do the processes consistently fail on the same method call? If so, there is a chance that we might be able to offer a fix in the short term. Regards, Andreas --- - 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: Thread safe?
I did include the new statement. The declaration is up at the class level. There should be one factory for the class and one transformer per instance. This only crashes when I have 2 sessions running this same program at the same time. Each should have one instance of this class object. The variable statements look like this. private Transformer myTransformer; public static final TransformerFactory myTransformerFactory = TransformerFactory.newInstance(); It's reusing that Transformer variable within each method to create a new transformer object as needed. So we have the xsl Transformer in that method where I create the fo file. myTransformer = myTransformerFactory.newTransformer(myXslSS); And a plain transformer in the methods where it pulls in the fo handler with the different renderers to generate the output from the fo. myTransformer = myTransformerFactory.newTransformer(); That part works. It's only when I run 2 at once the first transform crashes. That error message sounds like there was an error reading in the xsl file though the read statements didn't crash. -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: Tuesday, March 29, 2011 3:57 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Thread safe? On 29 Mar 2011, at 21:23, Eric Douglas wrote: It's actually crashing on the first transformer. It only crashes if I run 2 of these at once. Is there something obvious I'm missing in this java code? snip / Perhaps... We do not see the declaration of 'myTransformer'. Is that variable local to each thread? Transformers are definitely not thread-safe, so should be separate instances for multiple concurrent transformations. The TransformerFactory is thread-safe, so can be shared without issues. Regards Andreas --- - 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: Thread safe?
I would guess the answer is yes based on http://xmlgraphics.apache.org/fop/0.95/embedding.html // Reuse the FopFactory if possible! -Original Message- From: Terence M. Bandoian [mailto:tere...@tmbsw.com] Sent: Tuesday, March 29, 2011 5:22 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Thread safe? Hi- Is FopFactory thread-safe? -Terence Bandoian On 3/29/2011 1:56 PM, Andreas L. Delmelle wrote: On 29 Mar 2011, at 21:23, Eric Douglas wrote: It's actually crashing on the first transformer. It only crashes if I run 2 of these at once. Is there something obvious I'm missing in this java code? snip / Perhaps... We do not see the declaration of 'myTransformer'. Is that variable local to each thread? Transformers are definitely not thread-safe, so should be separate instances for multiple concurrent transformations. The TransformerFactory is thread-safe, so can be shared without issues. Regards Andreas --- - 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: Thread safe?
Yeah, that means you should only have one per class which should work for multiple instances. The threading issue is what I'm looking at now, where I have multiple sessions running concurrently. I have yet to see any threading problems with the FOP objects. My error seems to be just on Oracle's Transformer. That page also mentions threading, at your own risk, though it was from 0.95 so I don't know if they've done much additional testing or changes since. Multithreading FOP Apache FOP may currently not be completely thread safe. The code has not been fully tested for multi-threading issues, yet. If you encounter any suspicious behaviour, please notify us. There is also a known issue with fonts being jumbled between threads when using the Java2D/AWT renderer (which is used by the -awt and -print output options). In general, you cannot safely run multiple threads through the AWT renderer. -Original Message- From: Terence M. Bandoian [mailto:tere...@tmbsw.com] Sent: Tuesday, March 29, 2011 6:01 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Thread safe? Hi- Thanks. However, reusability doesn't necessarily mean thread-safe. -Terence Bandoian On 3/29/2011 2:15 PM, Eric Douglas wrote: I would guess the answer is yes based on http://xmlgraphics.apache.org/fop/0.95/embedding.html // Reuse the FopFactory if possible! -Original Message- From: Terence M. Bandoian [mailto:tere...@tmbsw.com] Sent: Tuesday, March 29, 2011 5:22 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Thread safe? Hi- Is FopFactory thread-safe? -Terence Bandoian On 3/29/2011 1:56 PM, Andreas L. Delmelle wrote: On 29 Mar 2011, at 21:23, Eric Douglas wrote: It's actually crashing on the first transformer. It only crashes if I run 2 of these at once. Is there something obvious I'm missing in this java code? snip / Perhaps... We do not see the declaration of 'myTransformer'. Is that variable local to each thread? Transformers are definitely not thread-safe, so should be separate instances for multiple concurrent transformations. The TransformerFactory is thread-safe, so can be shared without issues. Regards Andreas --- - 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 - 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: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF
How to feed the FO file? Using the command line transform you just pass it to the -fo parameter. Using embedded code I feed it as a SAXSource. Reading in from file you have: java.io.File java.io.FileInputStream org.xml.sax.InputSource javax.xml.transform.sax.SAXSource Creates the input. Pass that in to: javax.xml.transform.TransformerFactory javax.xml.transform.Transformer I'm not sure it's required but I copied this code from the FOP website: Transformer.setParameter(versionParam, 2.0) Then your transform, with the FOP output generated with these classes. org.apache.fop.apps.FopFactory org.apache.fop.apps.Fop javax.xml.transform.sax.SAXResult The SAXResult is created from the Fop.getDefaultHandler. The Transformer can be created with an XSL file parameter to pass XML into the transform, or with no XSL to pass the FO in. -Original Message- From: Dennis van Zoerlandt [mailto:dvzoerla...@vanboxtel.nl] Sent: Friday, March 25, 2011 10:30 AM To: fop-users@xmlgraphics.apache.org Subject: Re: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF Hi Georg, I'm currently running the XML and XSLT through XMLspy with FOP 0.95 (it seems Altova doesn't support FOP 1.0). I'm not really sure how to feed the FO file to FOP? Can I just put the FO file as source file for the transformer.transform()? I'll get back to you when I have a FO file. My pc's currently performing very badly, so it seems it's a heavy job. Best regards, Dennis van Zoerlandt - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
How to transform embedded FO?
So I have this code which works. ByteArrayInputStream myByteArrayInputStream; InputSource myInputSource; SAXSource myXmlSAXSource; ByteArrayOutputStream myPdfBAOS; myFoFileOutputStream = new FileOutputStream(myFoFile); myFoByteArrayOutputStream = new ByteArrayOutputStream(); myStreamResult = new StreamResult(myFoByteArrayOutputStream); myByteArrayInputStream = new ByteArrayInputStream(myXmlByteData); myInputSource = new InputSource(myByteArrayInputStream); myXmlSAXSource = new SAXSource(myInputSource); myTransformer.transform(myXmlSAXSource,myStreamResult); myFoByteArrayOutputStream.writeTo(myFoFileOutputStream); myFoByteArrayOutputStream.close(); myPdfBAOS = new ByteArrayOutputStream(); myByteArrayInputStream = new ByteArrayInputStream(myXmlByteData); myInputSource = new InputSource(myByteArrayInputStream); myXmlSAXSource = new SAXSource(myInputSource); myFop = myFopFactory.newFop(fopMimeValue, myUserAgent, myPdfBAOS); myTransformResult = new SAXResult(myFop.getDefaultHandler()); myTransformer.transform(myXmlSAXSource, myTransformResult); Now I try to rearrange that to a 2 step process to use the FO as input, and it crashes on the last statement. What am I missing? ByteArrayOutputStream myFoByteArrayOutputStream; StreamResult myStreamResult; SAXSource myXmlSAXSource; byte[] myFoByteData; ByteArrayOutputStream myPdfBAOS; myFoByteArrayOutputStream = new ByteArrayOutputStream(); myStreamResult = new StreamResult(myFoByteArrayOutputStream); myXmlSAXSource = createSAXSource(myXmlByteData); myTransformer.transform(myXmlSAXSource,myStreamResult); myFoByteData = myFoByteArrayOutputStream.toByteArray(); myFoByteArrayOutputStream.close(); ByteArrayInputStream myByteArrayInputStream; InputSource myInputSource; SAXSource myFoSAXSource; myPdfBAOS = new ByteArrayOutputStream(); myByteArrayInputStream = new ByteArrayInputStream(myFoByteData); myInputSource = new InputSource(myByteArrayInputStream); myFoSAXSource = new SAXSource(myInputSource); myFop = myFopFactory.newFop(fopMimeValue, myUserAgent, myPdfBAOS); myTransformResult = new SAXResult(myFop.getDefaultHandler()); myTransformer.transform(myFoSAXSource, myTransformResult);
FW: How to transform embedded FO?
Nevermind. I realized the answer shortly after I asked the question. A new Transformer must be created. A Transformer must be created with an XSL file to transform an XML file. The Transformer with the XSL can pass XML as input and create a document directly using an output created from the Fop handler. The Transformer with the XSL can pass XML as input and create FO output using an empty SAX stream output object. A Transformer without an XSL can pass FO as input and create a document using an output created from the Fop handler.
RE: PDF version specification
PDF readers should be backward compatible. AFAIK there's no reason to write a newer version number unless a newer version adds a feature you need. -Original Message- From: mehdi houshmand [mailto:med1...@gmail.com] Sent: Monday, March 14, 2011 10:10 AM To: fop-users@xmlgraphics.apache.org Subject: Re: PDF version specification Hi Markus, Unfortunately looking at the code, the PDF version (1.4) is hard-coded. This is presumably because FOP doesn't support any of the features of subsequent versions, though I'm sure someone in the community will be able to tell you the exact reasons for this. You may be able to change this to 1.6, but either someone else in the community will be able to help you out there, or I'd suggest looking at the PDF spec, if PDF is backward compatible you can change the version with impunity. The PDF version is set in o.a.f.pdf.PDFDocument line 103. You'll probably have to do something to PDFProfile and add an extra case in PDFDocument.getPDFVersionString(). But that shouldn't be too difficult, that is of-course if there aren't any calamitous affects to do with the PDF spec, which I sadly lack knowledge in. Hope that helps, Mehdi On 14 March 2011 13:46, Markus Ruggiero mailingli...@kataputt.com wrote: When I generate a simple PDF from within my Java app the resulting PDF file says PDF Version 1.4. My customer talks about going to PDF version 1.6 or higher. Is this something I have to explicitly set? Where would I do this? My tests are based on FOP 1.0 and the simple embedding examples from the xmlgraphics website. Thanks for any enlightening ---markus--- - 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: PDF version specification
Yes you can only have one flow. You don't have to use more than one region. If you want to place data in 2 different areas of the page using the flow you define separate blocks. You can have as many blocks and block containers as you like. Normally a block starts where the last one ended. If you want it somewhere else you can always hardcode absolute positions like I do. -Original Message- From: Zac Nichol [mailto:zacnic...@gmail.com] Sent: Monday, March 14, 2011 2:48 PM To: fop-users@xmlgraphics.apache.org Subject: Re: PDF version specification Hi. I'm very new to FOP and xml-fo. I want to flow data into 2 different regions (region-body and region-before). is this possible? when i do it, FOP complains that For fo:page-sequence, only one fo:flow may be declared. It seems weird to me that you can have many fo:static-content objects within a single page-sequence, but you can't have many fo:flow objects. How can I flow data into 2 different regions in a single .fo file? thanks in advance! - Zac - 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: Flow data in 2 different regions?
I use the position=absolute attribute. With that there are attributes for left, top, width, and height. I set them all but they may be optional. If you just leave out height does it spill to the next page? If not, that could get complicated trying to wrap text to a new page. My case is the ideal absolute positioning. I have the whole page in one region and position everything. Everything I print is one custom fixed width font. I write programs which generate the xml input so I know exactly what needs to print on each page and how big it needs to be. -Original Message- From: Andreas Delmelle [mailto:andreas.delme...@telenet.be] Sent: Monday, March 14, 2011 3:00 PM To: fop-users@xmlgraphics.apache.org Subject: Flow data in 2 different regions? On 14 Mar 2011, at 19:48, Zac Nichol wrote: Hi Zac, I want to flow data into 2 different regions (region-body and region-before). is this possible? when i do it, FOP complains that For fo:page-sequence, only one fo:flow may be declared. It seems weird to me that you can have many fo:static-content objects within a single page-sequence, but you can't have many fo:flow objects. How can I flow data into 2 different regions in a single .fo file? Currently, with FOP, this is not possible. There is no support at all for XSL 1.1 fo:flow-maps, and fo:flow can only be mapped to the fo:region-body. Basically, that leaves only fo:static-content as a candidate to be mapped to fo:region-before. The only alternative might be what Eric just suggested: use a combination of fo:block-containers, but then absolute-positioned block-containers will not flow to the next page, so the content would have to be very well prepared to pull that off... It depends on the requirements whether this is feasible. Regards, Andreas --- - 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: Flow data in 2 different regions?
That's basically what I do, all precomputed data. Most people do one extreme or the other, either calculating what fits on a page and forcing all text into specific areas, or flowing everything (book printing). It is rare you would want to flow everything over like a book on 2 areas. Of course I have a report which does that, but since I'm calculating with fixed font size what fits it's a simple compound condition (if {this area needs a new page} or {this area needs a new page}). -Original Message- From: Andreas Delmelle [mailto:andreas.delme...@telenet.be] Sent: Monday, March 14, 2011 3:30 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Flow data in 2 different regions? On 14 Mar 2011, at 20:09, Eric Douglas wrote: Hi Eric I use the position=absolute attribute. With that there are attributes for left, top, width, and height. I set them all but they may be optional. If you just leave out height does it spill to the next page? Nope. :-( If height=auto, and the content grows sufficiently large, absolute-positioned block-containers will eventually cause overflow at the relevant edge of the page (or more precisely: whatever area they are 'absolutely' positioned in), but will never trigger a page-break themselves. I guess you could see it as kind of a static-content, but then, not repeated. If not, that could get complicated trying to wrap text to a new page. Indeed. You would basically have to precompute and force all the breaks yourself, instead of leaving that up to FOP. :-/ Regards, Andreas --- - 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: manipulate fop configuration file via java
What are you trying to save? What you're talking about here is an either or. You can load font information using the configuration file or you can load them straight from the ttf with embedded code. If you're using the embedded code you don't need the configuration file for fonts. You also don't need a metrics file anymore. From: ingo peter [mailto:ingo.pe...@ip-software.de] Sent: Thursday, March 10, 2011 8:13 AM To: fop-users@xmlgraphics.apache.org Subject: manipulate fop configuration file via java hi, i can embed fonts via command-line to the file fop.xml and render a pdf with special fonts. fop.xml fop version=1.0 renderers renderer mime=application/pdf filterList valuenull/value /filterList filterList type=image valueflate/value valueascii-85/value /filterList font-base/tmp//font-base fonts font metrics-url=testfont.xml kerning=yes embed-url=testfont.ttf font-triplet name=testfont style=normal weight=normal/ /font /fonts /renderer /renderers target-resolution300/target-resolution /fop is it also via java possible to safe the font-information to fop.xml for later use? i tried this, but i don't know to save my changes back to a xml-file! ... String fontname = test1; String filename = test1.ttf;i // set own configuation file: try { FontTriplet fontTriplet = new FontTriplet(fontname,Font.STYLE_NORMAL, Font.WEIGHT_NORMAL); ListFontTriplet fontTriplets = new ArrayListFontTriplet(); fontTriplets.add(fontTriplet); EmbedFontInfo nfont = new EmbedFontInfo(filename.substring(0,datei.length()-3)+xml, true, fontTriplets, filename, fontname); DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File(/tmp/fop.xml)); FopFactory fopFactory = FopFactory.newInstance(); fopFactory.setUserConfig(cfg); fopFactory.getFontManager().setFontBaseURL/tmp/); fopFactory.getFontManager().getFontCache().addFont(nfont); fopFactory.getFontManager().getFontCache().save(); } catch (Exception ex) { ex.printStackTrace(); } } } ... how can i save my configuration?
RE: attaching a zip file in PDF
MIME_PDF is not in FOP. FOP's MimeConstants extends the MimeConstants from xmlgraphics. Do you have xmlgraphics-commons-1.4.jar in your classpath? From: Neeraj Malik [mailto:nmqu...@yahoo.co.uk] Sent: Thursday, March 10, 2011 10:35 AM To: fop-users@xmlgraphics.apache.org Cc: matthias8...@gmx.at Subject: Re: attaching a zip file in PDF Hello Matthias, Many thanks. I downloaded and tested it. It works. Now I am integrating it in my project. import org.apache.fop.apps.MimeConstants; FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); MIME_PDF is not found. Can you please suggest if it has been relocated? Thanks. Regards Neeraj --- On Thu, 10/3/11, Matthias Reischenbacher matthias8...@gmx.at wrote: From: Matthias Reischenbacher matthias8...@gmx.at Subject: Re: attaching a zip file in PDF To: fop-users@xmlgraphics.apache.org Date: Thursday, 10 March, 2011, 12:28 Neeraj, I think the PDF attachment feature was added after the 1.0 release. You might want to try a nightly snapshot: http://ci.apache.org/projects/xmlgraphics/fop/snapshots/ HTH, Matthias nmquery wrote: Hi, I am not able to attach a zip file in PDF. Message on console - WARNING: Unknown formatting object {http://xmlgraphics.apache.org/fop/extensions/pdf}embedded-file; encountered (a child of fo:declarations}. (No context info available) I am using Apache FOP 1.0. I tried 0.95 as well. Please check xsl code below. Can you please suggest why its not attaching the zip in PDF? Thanks. Regards Neeraj ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.1 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; exclude-result-prefixes=fo xsl:output method=xml version=1.0 omit-xml-declaration=no indent=yes/ xsl:template match=OriginalNotification fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:pdf=http://xmlgraphics.apache.org/fop/extensions/pdf; fo:layout-master-set fo:simple-page-master master-name=simpleA4 page-height=29.7cm page-width=21cm margin-top=1cm margin-left=1.5cm margin-right=1.5cm margin-bottom=0.5cm fo:region-body margin-bottom=1.5cm margin-top=3cm/ /fo:simple-page-master /fo:layout-master-set fo:declarations pdf:embedded-file filename=attachments.zip src=url(file:///C:/attachments.zip) description=Attachments/ /fo:declarations fo:page-sequence master-reference=simpleA4 fo:flow flow-name=xsl-region-body fo:block /fo:block /fo:flow /fo:page-sequence /fo:root !-- fo:basic-link external-destination=url(file:///C:/attachments.zip)Attachments/fo:b asic-link -- /xsl:template /xsl:stylesheet -- View this message in context: http://old.nabble.com/attaching-a-zip-file-in-PDF-tp31114498p31115152.ht ml 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: manipulate fop configuration file via java
I'm not sure what you're talking about here, but FOP is not serializable, and the input and output is all serializable. -Original Message- From: mehdi houshmand [mailto:med1...@gmail.com] Sent: Thursday, March 10, 2011 10:44 AM To: fop-users@xmlgraphics.apache.org Subject: Re: manipulate fop configuration file via java Hi, Correct me if I'm wrong but I think you're trying to serialize the data that you configure progammatically. If so, but I don't think that feature currently exists in FOP (or if it does, I haven't come across it). If you wish to set and save config settings, you could use the various XML DOM libraries out there to create a custom fop.xconf. That will allow you to serialize any changes you make and you can make changes at run-time. There maybe another way of doing this, but short of creating your own serialization format (which in fairness wouldn't be very difficult), that's the only way I can think of. I may however have the wrong end of the stick here, if so, my apologies. Mehdi On 10 March 2011 15:34, Eric Douglas edoug...@blockhouse.com wrote: What are you trying to save? What you're talking about here is an either or. You can load font information using the configuration file or you can load them straight from the ttf with embedded code. If you're using the embedded code you don't need the configuration file for fonts. You also don't need a metrics file anymore. From: ingo peter [mailto:ingo.pe...@ip-software.de] Sent: Thursday, March 10, 2011 8:13 AM To: fop-users@xmlgraphics.apache.org Subject: manipulate fop configuration file via java hi, i can embed fonts via command-line to the file fop.xml and render a pdf with special fonts. fop.xml fop version=1.0 renderers renderer mime=application/pdf filterList valuenull/value /filterList filterList type=image valueflate/value valueascii-85/value /filterList font-base/tmp//font-base fonts font metrics-url=testfont.xml kerning=yes embed-url=testfont.ttf font-triplet name=testfont style=normal weight=normal/ /font /fonts /renderer /renderers target-resolution300/target-resolution /fop is it also via java possible to safe the font-information to fop.xml for later use? i tried this, but i don't know to save my changes back to a xml-file! ... String fontname = test1; String filename = test1.ttf;i // set own configuation file: try { FontTriplet fontTriplet = new FontTriplet(fontname,Font.STYLE_NORMAL, Font.WEIGHT_NORMAL); ListFontTriplet fontTriplets = new ArrayListFontTriplet(); fontTriplets.add(fontTriplet); EmbedFontInfo nfont = new EmbedFontInfo(filename.substring(0,datei.length()-3)+xml, true, fontTriplets, filename, fontname); DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File(/tmp/fop.xml)); FopFactory fopFactory = FopFactory.newInstance(); fopFactory.setUserConfig(cfg); fopFactory.getFontManager().setFontBaseURL/tmp/); fopFactory.getFontManager().getFontCache().addFont(nfont); fopFactory.getFontManager().getFontCache().save(); } catch (Exception ex) { ex.printStackTrace(); } } } ... how can i save my configuration? - 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: Apache FOP Newbie needs Help Converting XML to PDF
-xm? Try -xml? Then take the dashes out of your file name, or try putting it in quotes. -Original Message- From: italocardwell [mailto:italo.cardw...@gmail.com] Sent: Wednesday, March 09, 2011 9:10 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Apache FOP Newbie needs Help Converting XML to PDF I was using fop -xm la91ec9d3-e021-4e5e-933f-54992cdc415c.20110308172937.xml -xsl ccr.xsl -pdf test.pdf Peter Hancock-2 wrote: Hi, Can you tell us exactly which files you are using when you invoke fop, please. Your command should look something like fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf judging by the files you have attached. I am guessing you missed out the -xml/-xsl flags, leading FOP to believe you were supplying an FO file. When an XML and XSL files are supplied, FOP will perform an XSLT transform using the Xalan XSLT Xalan library (I am guessing you will need to know more about this stage in your project), generating the FO document stream that is then processed to generate the output in the desired format: XML + XSL - [XSLT transformer] - FO - [XSL:FO processor] - PDF This initial stage just saves on from having to do the transform first. I hope this info helps, Peter On Wed, Mar 9, 2011 at 12:43 PM, italocardwell italo.cardw...@gmail.com wrote: Ill be upfront I know nothing about XML. I am a SQL developer and I have a project where I need to convert XML files to a PDF. The XML are going to be the same format every time with different data in them. I am wanting to use apache fop 1.0 at the command line to convert these. I am getting an error every time that I attempt to do this. I will attach the files and the error. Would someone please help me out. Thanks. http://old.nabble.com/file/p31105999/a91ec9d3-e021-4e5e-933f-54992cdc 415c.20110308172937.xml a91ec9d3-e021-4e5e-933f-54992cdc415c.20110308172937.xml http://old.nabble.com/file/p31105999/ccr.xsl ccr.xsl http://old.nabble.com/file/p31105999/date.format-date.template.xsl date.format-date.template.xsl http://old.nabble.com/file/p31105999/str.padding.template.xsl str.padding.template.xsl The error that I get states that fo needs to be in xml-fo format. -- View this message in context: http://old.nabble.com/Apache-FOP-Newbie-needs-Help-Converting-XML-to- PDF-tp31105999p31105999.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/Apache-FOP-Newbie-needs-Help-Converting-XML-to-PDF-tp31105999p31106656.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Apache FOP Newbie needs Help Converting XML to PDF
That error means exactly what it says. The file you're passing with the -xsl parameter is incorrect. It's not xslfo. Your xsl file is designed for viewing xml in a browser, not for transforming xml into a document. HTML xsl (http://www.w3schools.com/xsl/default.asp) Xslfo (http://www.w3schools.com/xslfo/xslfo_documents.asp) That xslfo page shows how to create the fo which would be the xsl combined with xml, as it doesn't have the stylesheet tag. The file FOP is looking for on the -xsl parameter is the combination of those, with the stylesheet tag and the fo:root tag. The FO tutorials explain how you can mix the xsl and fo together (http://www.w3schools.com/xslfo/xslfo_xslt.asp). -Original Message- From: italocardwell [mailto:italo.cardw...@gmail.com] Sent: Wednesday, March 09, 2011 9:26 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Apache FOP Newbie needs Help Converting XML to PDF Sorry the -xm was a fat finger. I was using -xml and even if I change the file name to test it still produces the same error. Complete error below. SEVERE: Exception javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: First element must be the fo:root formatting object. Found (Namespace URI: , Local Name: html) instead. Please make sure you're producing a valid XSL-FO do cument. Eric Douglas wrote: -xm? Try -xml? Then take the dashes out of your file name, or try putting it in quotes. -Original Message- From: italocardwell [mailto:italo.cardw...@gmail.com] Sent: Wednesday, March 09, 2011 9:10 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Apache FOP Newbie needs Help Converting XML to PDF I was using fop -xm la91ec9d3-e021-4e5e-933f-54992cdc415c.20110308172937.xml -xsl ccr.xsl -pdf test.pdf Peter Hancock-2 wrote: Hi, Can you tell us exactly which files you are using when you invoke fop, please. Your command should look something like fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf judging by the files you have attached. I am guessing you missed out the -xml/-xsl flags, leading FOP to believe you were supplying an FO file. When an XML and XSL files are supplied, FOP will perform an XSLT transform using the Xalan XSLT Xalan library (I am guessing you will need to know more about this stage in your project), generating the FO document stream that is then processed to generate the output in the desired format: XML + XSL - [XSLT transformer] - FO - [XSL:FO processor] - PDF This initial stage just saves on from having to do the transform first. I hope this info helps, Peter On Wed, Mar 9, 2011 at 12:43 PM, italocardwell italo.cardw...@gmail.com wrote: Ill be upfront I know nothing about XML. I am a SQL developer and I have a project where I need to convert XML files to a PDF. The XML are going to be the same format every time with different data in them. I am wanting to use apache fop 1.0 at the command line to convert these. I am getting an error every time that I attempt to do this. I will attach the files and the error. Would someone please help me out. Thanks. http://old.nabble.com/file/p31105999/a91ec9d3-e021-4e5e-933f-54992cd c 415c.20110308172937.xml a91ec9d3-e021-4e5e-933f-54992cdc415c.20110308172937.xml http://old.nabble.com/file/p31105999/ccr.xsl ccr.xsl http://old.nabble.com/file/p31105999/date.format-date.template.xsl date.format-date.template.xsl http://old.nabble.com/file/p31105999/str.padding.template.xsl str.padding.template.xsl The error that I get states that fo needs to be in xml-fo format. -- View this message in context: http://old.nabble.com/Apache-FOP-Newbie-needs-Help-Converting-XML-to - PDF-tp31105999p31105999.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/Apache-FOP-Newbie-needs-Help-Converting-XML-to-P DF-tp31105999p31106656.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/Apache-FOP
RE: Font Weight
Yes. Generally one font file contains one font set with one weight. You would need to supply a custom font set to get a different weight. Any program which allows you to print in a different weight would do the same, to either require you to have a font set in that weight or to guess at it. Guessing can be bad. For instance I create images from FOP with the PNGRenderer. It gets larger images if I increase targetresolution. If I generate a smaller image then try to make it bigger with the Graphics2D transforming method you can see it gets fuzzy. Optional fuzzy logic could be useful, currently not implemented. From: Marquart, Joshua D [mailto:joshua.marqu...@firstdata.com] Sent: Wednesday, March 09, 2011 11:50 AM To: Glenn Adams; fop-users@xmlgraphics.apache.org Subject: RE: Font Weight FOP does not synthesize fonts with different weights. You need to supply the fonts with the weights you specify in FO content. I understand Fop doesn't synthesize the weights. I understand that it has two specific built-in weights (700 and 400) that are being used to replace other weights per the following: When I set-up using a Java2DRenderer and specify the following FO content snippets: fo:table-cell font-size=10pt font-family=Helveticafo:block line-height=13pt fo:block white-space-collapse=true fo:inline font-weight=900900 Weight /fo:inline ... fo:inline font-weight=800800 Weight /fo:inline ... fo:inline font-weight=700700 Weight /fo:inline ... fo:inline font-weight=600600 Weight /fo:inline ... fo:inline font-weight=500500 Weight /fo:inline ... fo:inline font-weight=400400 Weight /fo:inline ... fo:inline font-weight=300300 Weight /fo:inline /fo:block/fo:block/fo:table-cell ... the logger gives me the following information: WARNING: Font Helvetica,normal,900 not found. Substituting with Helvetica,normal,700. WARNING: Font Helvetica,normal,800 not found. Substituting with Helvetica,normal,700. WARNING: Font Helvetica,normal,600 not found. Substituting with Helvetica,normal,700. WARNING: Font Helvetica,normal,500 not found. Substituting with Helvetica,normal,400. WARNING: Font Helvetica,normal,300 not found. Substituting with Helvetica,normal,400. So I would need to supply very specific replacement fonts for Helvetica,normal,900 ( and 800-300, not counting 400)? (Same as above when replacing Helvetica with Arial). I DO understand the following: 1- that per the current specs, item 7.9.9 for font-weight has a TODO relative font weights message. 2 - that per the current build, the font classes generated from Helvetica.xml and HelveticaBold.xml are used for 400 and 700 respectively 3 - that per the fuzzy replacement, 700 is used for 900-600 and 400 is used for 500-100(probably). So my questions still stand 1 - is there a simpler way to use / access / apply a darker 500 or 600 weight Helvetica and if so, what's the best process to handle it given the codebase? 2 - should I instead render a Helvetica500.xml and generate the appropriate font class; obviously since that's not yet been done with the existing fop codebase, it is probably a lot more work than needed. 3 - Any other option I should pursue? If there is a process started to handle item 7.9.9, I would be happy to pitch in and help, I am just not certain where to start. Thanks, Josh From: Glenn Adams [mailto:gl...@skynav.com] Sent: Tuesday, March 08, 2011 6:40 PM To: fop-users@xmlgraphics.apache.org Cc: Marquart, Joshua D Subject: Re: Font Weight FOP does not synthesize fonts with different weights. You need to supply the fonts with the weights you specify in FO content. Regards, Glenn On Tue, Mar 8, 2011 at 4:31 PM, Marquart, Joshua D joshua.marqu...@firstdata.com wrote: I have a question about Font Weight. We're using Helvetica and using FOP to take the FO file and generate it as both (1) a PostScript file and (2) a TIFF file. Additionally, we are able to use third-party software to take the PostScript file and convert it directly to a second TIFF file (for comparison reasons). Of course, the fonts on the TIFF from FOP are a little pixilated and the normal font could stand to be rendered a bit darker. I am using Helvetica and tried to set the font-weight to 500 or 600, but it gets replaced with weight 400, which is apparently the normal Helvetica font registered in the system. Font-weight Bold and values of 800 and 900 use the bold Helvetica which is weight 700. Is there an easy way to use / access a darker 500 or 600 weight Helvetica, or possibly render the or am I really sunk here? I've already extended the Java2DRenderer, for my own purposes. The following Graphics2D rendering hints don't seem to do much when included: graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RE: Font Weight
I tested all the renderers. The TIFFRenderer created an image file and I didn't like it. The PSRenderer didn't like my TTFs. The PDFRenderer works for generating PDF documents and sending output indirectly to the printer. I actually use embedded code and pass a PDFRenderer to the FOUserAgent then get the output in PDF format from the transform in a stream and pass it into the load of PDDocument in the pdfbox project and use the java print job to print it. That has printed everything I've attempted to every printer we have. I'm also now using the PNGRenderer to get the output as images of pages to load into a custom preview window. This is working great. My preview window allows me to transform the document on the server and stream the output images to the client to display so I don't have to generate a transformer or renderer on the client machine and it's pretty fast (way faster than the FOP PreviewPanel). The PNGRenderer of course extends the Java2DRenderer. From: Glenn Adams [mailto:gl...@skynav.com] Sent: Wednesday, March 09, 2011 2:37 PM To: Marquart, Joshua D Cc: fop-users@xmlgraphics.apache.org Subject: Re: Font Weight I agree it there are differences between Java2DRenderer and PsRenderer that could account for this. Differences in anti-aliasing may also be at work here. I'm afraid I have exclusively used the PDFRenderer to date, so I can't offer more help on this difference. Perhaps another party may have something more to offer. G. On Wed, Mar 9, 2011 at 12:06 PM, Marquart, Joshua D joshua.marqu...@firstdata.com wrote: I was just doing research on this topic, came back here to supplement my message with info, and saw you already beat me to it. Helpful method: getFontInfo().dumpAllTripletsToSystemOut() So... yes, I do not have fonts installed for font weights of 300, 500, etc. and that would account for resolving to 400/700. The problem I'm seeing is when generating a PostScript and a Tiff from the same xsl-fo file. The text generated in the Tiff (for the 400 weight) appears much lighter than identical text in the PostScript and is likely due to using the Java2DRenderer vs. the PsRenderer. Oddly, when I set the font to Arial in the xsl-fo: - the font in the resulting PostScript appears Times Roman - the font in the resulting Tiff is identical to the font used in the Tiff when Helvetica was specified. Other than hunting down, installing and registering a weight 500 or so font for Helvetica or Arial (where might I find one? No idea.), are there other options that might I employ to lessen the lightness of the 400-weight ? Thanks, -Josh From: Glenn Adams [mailto:gl...@skynav.com] Sent: Wednesday, March 09, 2011 12:02 PM To: Marquart, Joshua D Cc: fop-users@xmlgraphics.apache.org Subject: Re: Font Weight Josh, What you have not said yet is whether you actually have (on your system) a font with the desired weight or not. Specifically, do you actually have installed multiple font instances with the distinct weights you wish to reference? If you do not, then it doesn't do much good to discuss referring to them. On the other hand, if you do have distinct faces with weights 300, 500, 600, 800, 900, etc., installed, then it is merely a matter of ensuring that the reference in your FO file correctly maps to the associated font instance. That can be handled in different ways. So please answer whether you do have the fonts installed in the first place with these weights. G. On Wed, Mar 9, 2011 at 9:50 AM, Marquart, Joshua D joshua.marqu...@firstdata.com wrote: FOP does not synthesize fonts with different weights. You need to supply the fonts with the weights you specify in FO content. I understand Fop doesn't synthesize the weights. I understand that it has two specific built-in weights (700 and 400) that are being used to replace other weights per the following: When I set-up using a Java2DRenderer and specify the following FO content snippets: fo:table-cell font-size=10pt font-family=Helveticafo:block line-height=13pt fo:block white-space-collapse=true fo:inline font-weight=900900 Weight /fo:inline ... fo:inline font-weight=800800 Weight /fo:inline ... fo:inline font-weight=700700 Weight /fo:inline ... fo:inline font-weight=600600 Weight /fo:inline ... fo:inline font-weight=500500 Weight /fo:inline ... fo:inline font-weight=400400 Weight /fo:inline ... fo:inline font-weight=300300 Weight /fo:inline
RE: PrintPreview
Why would you access an AreaTreeHandler? It looks like you've got correct code to create a PreviewPanel there. What are you trying to embed it in? I expect you'll want a window of some sort. -Original Message- From: pedro [mailto:pedro.r...@libero.it] Sent: Friday, February 18, 2011 5:55 AM To: fop-users@xmlgraphics.apache.org Subject: PrintPreview HI all i use the PrintPreviewPanel [code] FopFactory fopFactory = FopFactory.newInstance(); AWTRenderer renderer = new AWTRenderer(); FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.setRendererOverride(renderer); renderer.setScaleFactor( 25.4 * 800 / (Toolkit.getDefaultToolkit().getScreenResolution() * 210.0)); renderer.setPreviewDialogDisplayed(false); renderer.setUserAgent(userAgent); Fop fop = fopFactory.newFop(userAgent); PreviewPanel previewPanel = new PreviewPanel(userAgent, null, renderer); // Standard fop usage... TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); ByteArrayInputStream arrayInputStream = new ByteArrayInputStream(fo. getBytes()); Source src = new StreamSource(arrayInputStream); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); // To handle several pages on the same panel : previewPanel.setDisplayMode(PreviewPanel.CONTINUOUS); [/code] The problem is that i have to use a AreaTreeHandler but i don't know how to do it. The other problem is how to display the toolbar. Thanks! -- View this message in context: http://old.nabble.com/PrintPreview-tp30957628p30957628.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: PrintPreview
I skipped over your other message. I see now where you tried to reference an AreaTreeHandler, but that's not necessary. You sent 2 incomplete pieces of code. The second one looks closer. Here's a bit of a combination. See if this helps. [code] File fileXsl = new File(c:\\xsl.xml); FileInputStream xslFIS = new FileInputStream(fileXsl); byte[] xslSource = new byte[xslFIS.available()]; xslFIS.read(xslSource); xslFIS.close(); ByteArrayInputStream xslBAIS = new ByteArrayInputStream(xslSource); InputSource xslIS = new InputSource(xslBAIS); xslSS = new SAXSource(xslIS); File xmlFile = new File(c:\\xml.xml); FileInputStream xmlFIS = new FileInputStream(xmlFile); byte[] xmlSource = new byte[xmlFIS.available()]; xmlFIS.read(xmlSource); xmlFIS.close(); ByteArrayInputStream xmlBAIS = new ByteArrayInputStream(xmlSource); InputSource xmlIS = new InputSource(xmlBAIS); xmlSS = new SAXSource(xmlIS); FopFactory fopFactory = FopFactory.newInstance(); AWTRenderer renderer = new AWTRenderer(true); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); renderer.setUserAgent(foUserAgent); foUserAgent.setRendererOverride(renderer); PreviewPanel previewPanel = new PreviewPanel(foUserAgent, null, renderer); renderer.setScaleFactor(25.4 * 800 / (Toolkit.getDefaultToolkit().getScreenResolution() * 210.0)); renderer.setPreviewDialogDisplayed(false); Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_AWT_PREVIEW, foUserAgent); // Standard fop usage... TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(xslSS); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(xmlSS, res); // To handle several pages on the same panel : previewPanel.setDisplayMode(PreviewPanel.CONTINUOUS); previewPanel.showPage(); previewPanel.setPage(0); [/code] That's pretty much how I wrote mine initially, excluding some custom code like font loading. The only problem I found with this built in preview panel is the renderer attached to the PreviewPanel. 1) I'm doing client-server code. Transforms normally run on the server. The PreviewPanel of course has to run on the client. Changing the zoom (ScaleFactor) has to re-render the entire document. 2) This also has to create a transformer and renderer object on the client which is taking a long time. In my new custom preview panel I'm using the PNGRenderer. This holds the transformed output in the renderer. I can use it's getNumberOfPages method to create an array and retrieve the pages with getPageImage. For the zoom I just use drawImage from Graphics2D which makes the pages a little fuzzy at any level other than the initial size but they're readable and it's a lot faster. -Original Message- From: pedro [mailto:pedro.r...@libero.it] Sent: Friday, February 18, 2011 5:55 AM To: fop-users@xmlgraphics.apache.org Subject: PrintPreview HI all i use the PrintPreviewPanel The problem is that i have to use a AreaTreeHandler but i don't know how to do it. The other problem is how to display the toolbar. Thanks! -- View this message in context: http://old.nabble.com/PrintPreview-tp30957628p30957628.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: converting to PNG format
If you read the documentation I believe it's in there. PNG produces images which are single page so you only get the first page. If you use FOUserAgent.setOutputFile() to assign a name you can get one file per page. If you use embedded code and want the page objects get them from the renderer. -Original Message- From: nikhil pingili [mailto:nikhilping...@gmail.com] Sent: Wednesday, February 16, 2011 1:55 PM To: fop-users@xmlgraphics.apache.org Cc: fop-users-h...@xmlgraphics.apache.org Subject: converting to PNG format Hi Currently I am converting an XML to PDF format and this is woking fine.I want to convert the XML to PNG format. What I have done is change Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out) to Fop fop = fopFactory.newFop(MimeConstants.MIME_PNG, foUserAgent, out). The output comes,but the problem is instead of 4(the output should be 4 pages,this is how it is in the PDF) pages it only shows one page. Any thoughts on why is this happening Thanks Nikhil. - 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: Shading Issue
The xslfo file. It's the intermediate file. I was a bit confused when I first started working with FOP as I don't use the fo file. If you don't have an fo file you could generate one or provide the xsl and xml files. The fo file must exist to process FOP but it doesn't need to normally be a physical file. If you start with xml the fo may only be generated in memory. -Original Message- From: hirenshah [mailto:hiren.s...@rbs.co.uk] Sent: Friday, February 04, 2011 9:12 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Shading Issue What do you exactly mean by the FO? mehdi houshmand wrote: Hi Hirenshah, If you could post the FO, cut out anything that's not pertinent, I'll take a look as well. Mehdi -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30844681.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Shading Issue
No Your input file. That would be the file ending in .fo, or the .xml and .xsl. -Original Message- From: hirenshah [mailto:hiren.s...@rbs.co.uk] Sent: Friday, February 04, 2011 9:22 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Shading Issue The fop.xconf? Eric Douglas wrote: The xslfo file. It's the intermediate file. I was a bit confused when I first started working with FOP as I don't use the fo file. If you don't have an fo file you could generate one or provide the xsl and xml files. The fo file must exist to process FOP but it doesn't need to normally be a physical file. If you start with xml the fo may only be generated in memory. -- View this message in context: http://old.nabble.com/Shading-Issue-tp30842457p30844790.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: font missing warning
Obviously it means it can't find the font. auto-detect is usually not a good idea. It depends on the font file being found on the machine it's running on. What file contains that font triplet? Is that installed on the production machine? Obviously it's either not installed there or there's something different about the search path. From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 9:12 AM To: fop-users@xmlgraphics.apache.org Subject: font missing warning Hello! We are getting this warning when we try to create a PDF: Feb 1, 2011 4:35:03 PM org.apache.fop.fonts.FontInfo notifyFontReplacement WARNING: Font 'Consolas,normal,400' not found. Substituting with 'any,normal,400'. Our environment - we have another program that creates the XML and XSL. We use FOP to create the PDF from these files. Some things to note about our problem: - If we have a simple XSL, then we don't get this error - We have two environments (TEST and PRODUCTION), it works OK in our TEST environment - We are using FOP 0.95 - We use auto-detect/ in the fop configuration file to detect the font. Does anybody know what could be causing this issue? Thank you! 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.
RE: Problem regarding font substitution
There are 3 options. 1) You must include font-name for each block with a reference to a font which contains every character you're trying to print. If you want bold text you must reference a bold font name on the tag. If you want unicode you must name a font set which includes the unicode characters. If you want bold unicode you must have a bold unicode font. 2) You can reference a bold font name to get normal characters to print in bold and a fallback font name of unicode to get unicode characters to print. You'd still need a font file containing a unicode bold triplet to get the unicode to print in bold. 3) The program must be able to use a normal font and generate a bold font from it. I'm no expert on generating fonts, I don't know how difficult it might be to identify lines of characters in fonts, but I think there's more to creating a good bold font than simply making the lines thicker. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Wednesday, February 02, 2011 3:31 AM To: fop-users@xmlgraphics.apache.org Subject: 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.fo nts.FontEventProducer.fontSubstituted,key=fontSubstituted,params={r equested=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 - To unsubscribe, e-mail: fop-users-unsubscr
RE: font missing warning
That depends what you mean by simple versus not simple. It would be a lot easier to understand what you're talking about if you have one that works and one that doesn't work on the same machine, Are they referencing the same fop config file? Can you send a sample of each xslt or fo file? From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 9:57 AM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Hello Eric, What I don't understand is that a simple page does not get this error and finds the font. The file is installed on the production machine (Windows Server 2003 Enterprise Edition), it's called CONSOLA.TTF (Consolas True Type). I'm going to run a couple of experiments today to see what's up with this issue. Roberto Cahanap Developer, Reporting Department Bio-Reference Laboratories, Inc. Phone: 800-229-5227 x8499 Cell: 201-693-0132 Fax: 201-475-0344 Email: rcaha...@bioreference.com From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 9:19 AM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Obviously it means it can't find the font. auto-detect is usually not a good idea. It depends on the font file being found on the machine it's running on. What file contains that font triplet? Is that installed on the production machine? Obviously it's either not installed there or there's something different about the search path. From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 9:12 AM To: fop-users@xmlgraphics.apache.org Subject: font missing warning Hello! We are getting this warning when we try to create a PDF: Feb 1, 2011 4:35:03 PM org.apache.fop.fonts.FontInfo notifyFontReplacement WARNING: Font 'Consolas,normal,400' not found. Substituting with 'any,normal,400'. Our environment - we have another program that creates the XML and XSL. We use FOP to create the PDF from these files. Some things to note about our problem: - If we have a simple XSL, then we don't get this error - We have two environments (TEST and PRODUCTION), it works OK in our TEST environment - We are using FOP 0.95 - We use auto-detect/ in the fop configuration file to detect the font. Does anybody know what could be causing this issue? Thank you! 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. 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.
RE: font missing warning
If it's not working at all on the production server then if it is actually working on the test server that suggests the search path is wrong. Have you tried hardcoding the path? If it's not actually working on the test server it may just not like your font. I don't recal if OpenType fonts are fully supported in FOP 0.95. Can you try 1.0, or test a different type of font? From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 10:29 AM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Eric, After doing some testing, the simple one was not working also. It also had that missing font warning. I had the output from our other software set it to HTML instead of routing it to FOP for pdf.
RE: font missing warning
We're assuming it is correctly finding and using the font on the test server. Have you tried hardcoding the path to the fonts on the production server instead of using auto-detect? From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 11:16 AM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Eric, Our Test server's fonts are located in the C: drive. The Production server's fonts are located in the H: drive (that's where Windows was installed). How do I tell FOP that the fonts are located on the H: drive? Maybe that's the issue? From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 10:49 AM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning If it's not working at all on the production server then if it is actually working on the test server that suggests the search path is wrong. Have you tried hardcoding the path? If it's not actually working on the test server it may just not like your font. I don't recal if OpenType fonts are fully supported in FOP 0.95. Can you try 1.0, or test a different type of font? From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 10:29 AM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Eric, After doing some testing, the simple one was not working also. It also had that missing font warning. I had the output from our other software set it to HTML instead of routing it to FOP for pdf. 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.
RE: font missing warning
Remote debugging means assumptions or questions or both. I started by assuming this user like most is running from a command line. Finding the fonts correctly is a lot easier from embedded code. It's even easier if I can compile the fonts into a jar and reference them internally so they never have a path. The second easiest way is if you can reference them with a path relative to the path of the fop.jar. Users frequently expect remote debugging but unless you have remote access to view their machine instructions look like Step 1: Does your screen show this? If yes do this, else do that. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Wednesday, February 02, 2011 1:35 PM To: fop-users@xmlgraphics.apache.org Subject: 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. - 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
Yes. If you're using FOP you're running Java. Somewhere you have a file fop.jar. To compile the fonts into a jar you would need a Java editor (Eclipse, Netbeans). To use them as such you'd have to write your own Java code. That's the path I'm going. Fop doesn't provide an easy way to do that, but embedding them in a jar puts them in with the programs so using embedded code you can reference them directly. The custom jar has to be on the Java classpath so you don't have to worry about hardcoded font paths or auto detection. If you got it to work with the config file telling it where your fonts are I wouldn't worry about it. Other advantages to embedding the specific fonts you need in a jar 1) You can load custom fonts and get them to work on any system. 2) You don't need a config file. 3) The fonts go with the programs so you wouldn't have to worry about different machines having different versions of the same file. We actually had a problem years ago running reports in Courier font on client PCs which were running Windows 98 and for some reasons some PCs had a different version of font so the same report using a font file of the same name produced different output. If I'm testing a program on my PC or a test server I'd rather not rely on the test machine having the same file as the production server or another client machine unless It's a file I specifically put there. -Original Message- From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 2:08 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning compile the fonts into a jar... Yikes! That's foreign language to me, that sounds like java talk. Still testing and getting advice... :-) -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 1:48 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Remote debugging means assumptions or questions or both. I started by assuming this user like most is running from a command line. Finding the fonts correctly is a lot easier from embedded code. It's even easier if I can compile the fonts into a jar and reference them internally so they never have a path. The second easiest way is if you can reference them with a path relative to the path of the fop.jar. Users frequently expect remote debugging but unless you have remote access to view their machine instructions look like Step 1: Does your screen show this? If yes do this, else do that. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Wednesday, February 02, 2011 1:35 PM To: fop-users@xmlgraphics.apache.org Subject: 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. - 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. - 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: font missing warning
Those are arguments. The bat accepts arguments as a pass value. So it's just Fop.bat -xsl \temp\roberto\test2.xsl -xml \temp\roberto\test2.xml -pdf \temp\roberto\test2c.pdf -c conf\fop.xconf -Original Message- From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 2:52 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning I'm getting somewhere... On the Test server, I renamed conf.xconf. When I tried to create the pdf from the Test server, I get this: WARNING: Font 'Consolas,normal,400' not found. Substituting with 'any,normal,400' But when I renamed it back to conf.xconf, I am still getting this error. I read in the docs that you can specify the config, so I did this: C:\Program Files\Apache\fopfop -xsl \temp\roberto\test2.xsl -xml \temp\roberto\test2.xml -pdf \temp\roberto\test2c.pdf -c conf\fop.xconf It worked again. I did the same on the PRODUCTION server, adding the -c option at the end, it also worked. Now, I'm trying to figure out where to put this -c option in the FOP.BAT so that it can work within. Thanks again Eric and Jeremias. -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 2:43 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Yes. If you're using FOP you're running Java. Somewhere you have a file fop.jar. To compile the fonts into a jar you would need a Java editor (Eclipse, Netbeans). To use them as such you'd have to write your own Java code. That's the path I'm going. Fop doesn't provide an easy way to do that, but embedding them in a jar puts them in with the programs so using embedded code you can reference them directly. The custom jar has to be on the Java classpath so you don't have to worry about hardcoded font paths or auto detection. If you got it to work with the config file telling it where your fonts are I wouldn't worry about it. Other advantages to embedding the specific fonts you need in a jar 1) You can load custom fonts and get them to work on any system. 2) You don't need a config file. 3) The fonts go with the programs so you wouldn't have to worry about different machines having different versions of the same file. We actually had a problem years ago running reports in Courier font on client PCs which were running Windows 98 and for some reasons some PCs had a different version of font so the same report using a font file of the same name produced different output. If I'm testing a program on my PC or a test server I'd rather not rely on the test machine having the same file as the production server or another client machine unless It's a file I specifically put there. -Original Message- From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 2:08 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning compile the fonts into a jar... Yikes! That's foreign language to me, that sounds like java talk. Still testing and getting advice... :-) -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 1:48 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Remote debugging means assumptions or questions or both. I started by assuming this user like most is running from a command line. Finding the fonts correctly is a lot easier from embedded code. It's even easier if I can compile the fonts into a jar and reference them internally so they never have a path. The second easiest way is if you can reference them with a path relative to the path of the fop.jar. Users frequently expect remote debugging but unless you have remote access to view their machine instructions look like Step 1: Does your screen show this? If yes do this, else do that. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Wednesday, February 02, 2011 1:35 PM To: fop-users@xmlgraphics.apache.org Subject: 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. - To unsubscribe, e-mail: fop
RE: font missing warning
If you can modify the batch file and you can't modify the line which calls the batch file just put the arguments into the batch file if you want to hardcode them. Just put your argument string in where it's accepting arguments. That would be the line ending with %1. Either that or put the Fop.bat statement as I described below (except start with fop2.bat) into a new file named fop.bat and rename fop.bat. -Original Message- From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 3:02 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Yes, but is there a way to place the -c conf\fop.xconf inside this batch file. Our software runs the FOP.BAT, I don't really know how this software tells it where the XSL and XML is located. I'm just wondering how I can hard code this inside the batch file. -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 3:01 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Those are arguments. The bat accepts arguments as a pass value. So it's just Fop.bat -xsl \temp\roberto\test2.xsl -xml \temp\roberto\test2.xml -pdf \temp\roberto\test2c.pdf -c conf\fop.xconf -Original Message- From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 2:52 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning I'm getting somewhere... On the Test server, I renamed conf.xconf. When I tried to create the pdf from the Test server, I get this: WARNING: Font 'Consolas,normal,400' not found. Substituting with 'any,normal,400' But when I renamed it back to conf.xconf, I am still getting this error. I read in the docs that you can specify the config, so I did this: C:\Program Files\Apache\fopfop -xsl \temp\roberto\test2.xsl -xml \temp\roberto\test2.xml -pdf \temp\roberto\test2c.pdf -c conf\fop.xconf It worked again. I did the same on the PRODUCTION server, adding the -c option at the end, it also worked. Now, I'm trying to figure out where to put this -c option in the FOP.BAT so that it can work within. Thanks again Eric and Jeremias. -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 2:43 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Yes. If you're using FOP you're running Java. Somewhere you have a file fop.jar. To compile the fonts into a jar you would need a Java editor (Eclipse, Netbeans). To use them as such you'd have to write your own Java code. That's the path I'm going. Fop doesn't provide an easy way to do that, but embedding them in a jar puts them in with the programs so using embedded code you can reference them directly. The custom jar has to be on the Java classpath so you don't have to worry about hardcoded font paths or auto detection. If you got it to work with the config file telling it where your fonts are I wouldn't worry about it. Other advantages to embedding the specific fonts you need in a jar 1) You can load custom fonts and get them to work on any system. 2) You don't need a config file. 3) The fonts go with the programs so you wouldn't have to worry about different machines having different versions of the same file. We actually had a problem years ago running reports in Courier font on client PCs which were running Windows 98 and for some reasons some PCs had a different version of font so the same report using a font file of the same name produced different output. If I'm testing a program on my PC or a test server I'd rather not rely on the test machine having the same file as the production server or another client machine unless It's a file I specifically put there. -Original Message- From: Roberto Cahanap [mailto:rcaha...@bioreference.com] Sent: Wednesday, February 02, 2011 2:08 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning compile the fonts into a jar... Yikes! That's foreign language to me, that sounds like java talk. Still testing and getting advice... :-) -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, February 02, 2011 1:48 PM To: fop-users@xmlgraphics.apache.org Subject: RE: font missing warning Remote debugging means assumptions or questions or both. I started by assuming this user like most is running from a command line. Finding the fonts correctly is a lot easier from embedded code. It's even easier if I can compile the fonts into a jar and reference them internally so they never have a path. The second easiest way is if you can reference them with a path relative to the path of the fop.jar. Users frequently expect remote debugging but unless you have remote access to view their machine instructions look like Step 1: Does your screen show this? If yes do this, else do that. -Original Message- From: Jeremias Maerki [mailto:d
RE: Problem regarding font substitution
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
RE: FOP output
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). - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: FOP output
Ok, that's confusing. 1) I've seen the method setOutputFile, but that accepts a single file name? I've looked at the code in the PNGRenderer and saw an object having to do with multiple files but didn't understand how that works. 2) If possible I want to create the output as an array of PNG images without physically writing files. I create the PDF output without writing any files, then I can either use that output to generate an object to pass to a printer or I clone the object as bytes from a server to a client to save as a PDF on the client. I want to clone the array of images the same way to display on the client in a custom GUI window. Basically I want to do what the PreviewPanel does but simpler. The PreviewPanel object requires a renderer and transformer and rerenders the document for zooming and all that going on the client takes a ton of processing time. I want to do all rendering on the server to just preview as images. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, January 27, 2011 10:27 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP output Sorry, Eric, I assumed you know about how the PNGRenderer works. You can set a java.io.File using FOUserAgent.setOutputFile(File). This way the PNGRenderer has a filename and directory to produce multiple output files. This is documented here: http://xmlgraphics.apache.org/fop/1.0/output.html#bitmap On 27.01.2011 15:24:31 Eric Douglas wrote: So resolution should be the easy part. The tricky part is the question you didn't answer. How do I generate a multipage document as an image with a separate image for each page? Here's what I'm getting so far. I wrote an embedded code program. It can produce a PDF with multiple pages. It can load the PDF into pdfbox to create a Pageable object and it can print that. I tried just changing the PDF generate part to use the PNG mime with the PNGRenderer. It created one PNG image, which only shows the first page. After the transform I tried the Fop.getResults method. It returned an object of type org.apache.fop.apps.FormattingResults. I tried executing the getPageSequences method. It returned an object of type java.util.List, an array with one element. I can get that one element which is an object of type org.apache.fop.apps.PageSequenceResults. That object only has 2 methods, getID and getPageCount. getPageCount returns 11. How do I get images of the other pages? -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, January 27, 2011 3:35 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP output On 24.01.2011 17:30:43 Eric Douglas wrote: I generated a one page document as a PNG but 1) The image looks fine at 100% which is small on my screen. If I zoom in it gets blurry. Sure, it's a bitmap. Some viewers apply some kind of interpolation when zooming in which causes the blur. If they don't the image becomes blocky. 2) I need to figure out how to generate a multipage document as an image with a separate image for each page so I can use them to build a print preview screen. Looking at the code for the renderers it appears able to do this. I just can't quite figure out how to put it together. Just set the resolution high enough so you get a good quality for the size you need in the preview screen. You may have to re-render the documents at different resolutions when the user zooms in or out in order not to have to render at 600dpi every time and thus making the downloads very large. You can set the (target) resolution using the config file or the FOUserAgent (i.e. for each document separately). Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
FW: FOP output
So I passed a File object to the PNGRenderer and it created a file of that name for page 1 and a file of that name plus a number for each additional page. Now how do I get it to do that in memory, to give me image objects instead of physically writing files? -Original Message- From: Eric Douglas Sent: Thursday, January 27, 2011 10:47 AM To: 'fop-users@xmlgraphics.apache.org' Subject: RE: FOP output Ok, that's confusing. 1) I've seen the method setOutputFile, but that accepts a single file name? I've looked at the code in the PNGRenderer and saw an object having to do with multiple files but didn't understand how that works. 2) If possible I want to create the output as an array of PNG images without physically writing files. I create the PDF output without writing any files, then I can either use that output to generate an object to pass to a printer or I clone the object as bytes from a server to a client to save as a PDF on the client. I want to clone the array of images the same way to display on the client in a custom GUI window. Basically I want to do what the PreviewPanel does but simpler. The PreviewPanel object requires a renderer and transformer and rerenders the document for zooming and all that going on the client takes a ton of processing time. I want to do all rendering on the server to just preview as images. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, January 27, 2011 10:27 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP output Sorry, Eric, I assumed you know about how the PNGRenderer works. You can set a java.io.File using FOUserAgent.setOutputFile(File). This way the PNGRenderer has a filename and directory to produce multiple output files. This is documented here: http://xmlgraphics.apache.org/fop/1.0/output.html#bitmap On 27.01.2011 15:24:31 Eric Douglas wrote: So resolution should be the easy part. The tricky part is the question you didn't answer. How do I generate a multipage document as an image with a separate image for each page? Here's what I'm getting so far. I wrote an embedded code program. It can produce a PDF with multiple pages. It can load the PDF into pdfbox to create a Pageable object and it can print that. I tried just changing the PDF generate part to use the PNG mime with the PNGRenderer. It created one PNG image, which only shows the first page. After the transform I tried the Fop.getResults method. It returned an object of type org.apache.fop.apps.FormattingResults. I tried executing the getPageSequences method. It returned an object of type java.util.List, an array with one element. I can get that one element which is an object of type org.apache.fop.apps.PageSequenceResults. That object only has 2 methods, getID and getPageCount. getPageCount returns 11. How do I get images of the other pages? -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, January 27, 2011 3:35 AM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP output On 24.01.2011 17:30:43 Eric Douglas wrote: I generated a one page document as a PNG but 1) The image looks fine at 100% which is small on my screen. If I zoom in it gets blurry. Sure, it's a bitmap. Some viewers apply some kind of interpolation when zooming in which causes the blur. If they don't the image becomes blocky. 2) I need to figure out how to generate a multipage document as an image with a separate image for each page so I can use them to build a print preview screen. Looking at the code for the renderers it appears able to do this. I just can't quite figure out how to put it together. Just set the resolution high enough so you get a good quality for the size you need in the preview screen. You may have to re-render the documents at different resolutions when the user zooms in or out in order not to have to render at 600dpi every time and thus making the downloads very large. You can set the (target) resolution using the config file or the FOUserAgent (i.e. for each document separately). Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: align columns last line
Sure there are ways. It doesn't really do anything automatic like fit-text-to-block, but if you're passing your text through a program to generate input like I do you can determine how much space that text is going to need. You can either alter the text itself or the size of the text to fit in any given area. It's relatively simple for a fixed width font. With a variable width font you just have to allow for the largest character or go through the text character by character. If you dig deep enough with embedded code it does tell you the size of each character in a font set. -Original Message- From: Rob Sargent [mailto:robjsarg...@gmail.com] Sent: Wednesday, January 26, 2011 1:43 PM To: Rob Sargent Cc: fop-users@xmlgraphics.apache.org Subject: Re: align columns last line Is there really no fop way to get consistently placed top and bottom lines, such as one expects in a multi-column page of a magazine? I can see that this would mean reverse-leading(?) after the contents of the page had been established, but it seems a fundamental formatting requirement. Ever hopeful, rjs - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: AW: AW: [FOP 1.0] Worse performance than with 0.20.5 !?
If you're just printing a book as a bunch of text which does not already fit to page and throwing it into a document letting line wraps and breaks fall where they may it might look a bit funny. If you're using variable width fonts you can read the font to get character width and calculate the font size and how many rows will fit on a page based on the widest character in the set if you don't mind a bunch of whitespace. Oddly from reading what others have tried to do with FOP it seems no one else has thought to use it like I do though I think my program is the best way to use it. I use it as a report writer. I don't use fo:table. I don't let it calculate where to place anything on the page. I only use one standard fixed width font set. I place all text on the document with absolute positioning. I use embedded code to load the custom font files (one for standard, one for bold, one for unicode) and programmatically generate the xml. If I want a table I can create empty blocks with borders or use svg line drawing to draw my own table lines around the text. Everything fits on a page. If anything wraps to the next page the report generating program creates a new page tag. Since it's all in a program it's optional if it wants to write an xml, fo, or pdf file. They can all be passed through as bytes. The direct print option passes the pdf through to pfdbox which generates a Pageable object for a standard java PrinterJob. It's extremely useful if you can accept that all reports should be printed in Lucida Typewriter. If you want a different fixed width fonts you just have to figure out the different font size calculation. If you want a variable width font, absolute positioning becomes a lot more difficult. I love that it's so dynamic and that it doesn't generate any output until it's done. I wrote a report with a heading block using a font size larger than the details, which adds detail amounts which could take several pages to get total amounts which print in the heading block on the first page. This also allows validation before print. If there's a problem with the report program on printing page 5 it doesn't have to print anything. -Original Message- From: Andreas Delmelle [mailto:andreas.delme...@telenet.be] Sent: Saturday, January 22, 2011 1:50 PM To: fop-users@xmlgraphics.apache.org Subject: Re: AW: AW: [FOP 1.0] Worse performance than with 0.20.5 !? On 21 Jan 2011, at 08:31, Matthias Müller wrote: Hi Mathias I temporarily disabled all images and special fonts in my fo file and still have the issue with the heap space. So i assume that i only have a chance to improve the rendering by splitting the document in multiple page-sequences. The thing is now, that the size of the single tables may vary extremely. There's also a case that i produce a table over 400+ pages !!! What about splitting the tables after each, let's say, 20 pages? Where's the best performance, less than 20? That could be a good start, but --it depends. It's really very difficult to say how many pages is ideal. It is possible to let FOP run out of heap space with a document containing only a single fo:block with a dump of a chapter generating about 40 pages (or even only 1 page --at font-size 1pt). That is, purely the layout engine's linebreaking algorithm. No fancy fonts or tons of images. Not even a fo:table. On the one hand, that admittedly points to a lack of scalability. On the other, the fact remains: divide and conquer. Breaking up that same fo:block into multiple blocks can make a world of difference. For the end-result, it is obviously best to break the content at a boundary that makes sense logically. You can try to approximate how many rows you can fit into one page, and try to insert breaks from there, but that will likely lead to results that make little sense to the ultimate consumer/reader of the document... I almost forgot the most important point: If I split the table after the 20th page (or rather: after each 200th table rows (assuming ~10 rows per page)), how do I ensure that the page-sequence ends at the page bottom. The size of the rows also may vary. Short answer: you can't. Splitting into multiple fo:page-sequences is always a trade-off, since it introduces a forced break that is basically arbitrary, unless you can /make/ it so that the break makes sense there. Longer anwser is that one might be able to pull it off, but that would require a two-pass approach. In your case, that seems non-applicable, since the first pass will cause the out-of-memory condition. Regards Andreas - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org PDFTest.pdf Description: PDFTest.pdf - To unsubscribe, e-mail:
RE: FOP output
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. 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. -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Thursday, January 20, 2011 3:02 PM To: fop-users@xmlgraphics.apache.org Subject: 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 - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
FOP Memory
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?
FOP output
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).
RE: Embedding SVG dynamically into fo file
What does your stylesheet statement look like? I start my xsl like this. xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:svg=http://www.w3.org/2000/svg; xmlns:math=http://exslt.org/math; extension-element-prefixes=math I have svg creating dynamic images from xsl tags within instream-foreign-object blocks. -Original Message- From: Cristi Cioriia [mailto:cristian-andrei.cior...@1and1.ro] Sent: Monday, January 17, 2011 10:11 AM To: fop-users@xmlgraphics.apache.org Subject: Embedding SVG dynamically into fo file Hi guys, I have ran into a dead end trying to generate a PDF report which should contain SVG files generated on the fly, and I was hoping that I can find some help here on how to proceed next. At first, I embedded a svg file into a fo file using the fo:instream-foreign-object and everything worked as expected, generating the PDF report that I needed from the fo file by following the examples from the FO website. But then the pdf report that I have to generate uses as source data a java object which contains a string property which provides the svg file and looking at the example from the FOP website http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/ja va/embedding/ExampleObj2PDF.java I created an xslt file like this: xsl:template match=reportEntry fo:block fo:block xsl:value-of select=title/ /fo:block fo:block xsl:value-of select=description/ /fo:block fo:instream-foreign-object xsl:value-of select=svg/ /fo:instream-foreign-object /fo:block /xsl:template But now, when I run the code I get the following exception: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Error(Unknown location): fo:instream-foreign-object is missing child elements. Required Content Model: one (1) non-XSL namespace child I have tried to find any help with google on how I can approach this, but the only resources that I found use static resources as I did in the first scenario, which is not enough for my use case. Can you point me into the right direction on how to approach this? Thanks for your help, Cristi -- Cristian-Andrei Cioriia Programator Java 11 Internet Development S.R.L. - Bucharest/Romania - Web Applications Hosting Romania 18 Mircea Eliade St Sect 1, Bucharest RO Bucharest, 012015 Num#259;r de telefon: +40 751 812 984 cristian-andrei.cior...@1and1.ro - 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: SVG in FOP 1.0
I think we'd have to see some sample code to tell if jai is required or if you're missing something else. I know the FOP ant build has some optional tests based on whether jai is available, and I do create SVG graphics in my normal processing where jai is not in the classpath. -Original Message- From: Jayant Ghagre [mailto:jayant.gha...@ambest.com] Sent: Tuesday, January 11, 2011 11:41 AM To: fop-users@xmlgraphics.apache.org Subject: SVG in FOP 1.0 I am developing two web based prototypes for rendering PDF using XSL-FO. First prototype is a Java Servlet deployed in Tomcat container in windows environment. The servlet renders PDFs to web as well as windows based clients. Everything works well, till I decided to add SVG elements to generate 3D charts. I am using pre-compiled version of FOP 1.0. Looking at the manifest file for FOP.jar, I noticed that jai_*.jar files have not been referenced. If I include following jar files, I am able to generate 3D graphs using SVG. jai_codec.jar jai_core.jar jai_imageio.jar Are these jar files sufficient for FOP to process SVG elements? I thought that batik-all-1.7.jar should be sufficient to process SVG elements. I guess I was wrong. Second prototype is .NET based solution, where I have converted FOP 1.0 to a single .NET DLL using IKVM. Same issue here with SVG elements but even if I include the jai_*.jar files in my .NET dll, still the SVG elements are ignored. There are issues mentioned with class loader functionality in the following article. But this article was published in 2004, I bet there have been considerable improvements in IKVM since then. http://onjava.com/pub/a/onjava/2004/08/18/ikvm.html == Begin - Excerpt from the article Second is the ikvmc command, which can be used to convert Java bytecodes into .NET IL. Thus, you can convert a set of Java class files into a .NET assembly. Since this manner of use statically compiles the Java bytecodes, it's known as the static mode. Note that while the dynamic mode fully supports the Java classloader semantics, in the static mode, there are necessarily some limitations. Among the issues to watch out for is the fact that all classes are loaded by the bootstrap classloader. See the threads for the gory details. In brief, many Java programs assume this.class.getClassLoader() will return non-null. That, however, is not a valid assumption for classes loaded by the bootstrap loader. Also, while classloader functionality (such as Class.forName(..)) is available to use, and indeed can be used to load either statically compiled classes or Java bytecode, remember that loading classes out of .NET assemblies that are not referenced directly or indirectly from your application may not work without manual intervention. See the documentation for more detail on this and other hairy issues that arise when two different worlds collide! == End - Excerpt from the article I do understand that this is FOP user's email group, so IKVM related issue may not be answered, but if anyone has experience using SVG elements in .XSLT file, can point me to the right jar files (other than mentioned above). Thanks in advance for your help. Regards, Jayant - 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 1.0 line feed not visible
Building is easy lol. I downloaded the FOP 1.0 source. Then I extracted the source to a folder. Then I selected the New Project option in Eclipse from existing Ant build file and named the project fop-1.0 to match the folder. Then I had to run ant on the build.xml to create java files in the gensrc folder. Then I configured the build path to add ant and jai_core. Then it compiled. Then I had to put a copy of the Junit, Jai, and Xmlunit jars in the fop lib folder to run the full ant build. I actually downloaded ant as source to link to the fop build path so that's also full of fun dependancies. To get the ant project to compile I had to link jars for jai_codec, jai_core, mail, and NetRexxC, and I added it's other project dependancies as source also which include log4j, bcel, bsf, commons-logging, commons-net, jakarta-oro, jakarta-regexp, jdepend, jsch, junit, xalan, xml-commons-resolver. Of course importing dependancies as source is the hard way. It may give you the ability to do some more things most people likely don't need to do? You could just copy in the ant.jar to build. -Original Message- From: Andreas Delmelle [mailto:andreas.delme...@telenet.be] Sent: Monday, January 10, 2011 2:04 PM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP 1.0 line feed not visible On 10 Jan 2011, at 16:22, Philippe Pithon wrote: Hi Philippe Thanks ! good news ! I'll try...FOP Trunk Just FYI: if it is for testing purposes, and you cannot permit yourself to spend time on building FOP yourself, we have nightly snapshot binaries available. In case you're interested, see: http://ci.apache.org/projects/xmlgraphics/fop/snapshots/ Regards Andreas - 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: Re: how to extend the rendering part of fop
I was going to suggest SVG, the simplest way to produce a chart, but the OP asked about extensions like they already had something more complicated in mind with their mind made up about how they want to do it. http://blog.trivadis.com/blogs/andreasmengel/archive/2008/03/14/generating-svg-pie-charts-in-pdf-documents.aspx -Original Message- From: Stepan RYBAR [mailto:xryb...@seznam.cz] Sent: Monday, January 03, 2011 4:19 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Re: how to extend the rendering part of fop Hi, Eugen, try to look for a minute on the XSL-T 2.0 library graph2svg, could be found on http://graph2svg.jinak.cz/examples_en.html;. It is pure XSL-T 2.0 from XML to SVG (when using two-phase transformation even inline SVG). The source XML code of graph2svg looks very similar to Your example code. Cheers, Stepan Původní zpráva Od: gen1986 cepoi.eu...@gmail.com Předmět: Re: how to extend the rendering part of fop Datum: 03.1.2011 20:34:39 Hi Jeremias, Thanks for your quick response. However I'll give some more informations about what I'm trying to achieve. A sketch of the template : ... XSL-FO tags ... fo:instream-foreign-object... chart:chart xmlns:c=www...charts.. c:pie width=.. height=.. c:title value=Hello Piechart/ ... some custom tags to retrieve data ... /c:pie /chart:chart ... XSL-FO tags ... My elementMapping extension handles those tags and creates my objects describing the chart. 1) Actually I'm extending FONode, should I rather extend InstreamForeignObject? At some point (when the pdf is rendered) I'll use my objects to draw the chart to Graphics2D. But I will not create an Image. As you mentioned, it looks a lot like what you are doing here : [3] http://barcode4j.cvs.sourceforge.net/viewvc/barcode4j/barcode4j/src/xm lgraphics-commons/java/org/krysalis/barcode4j/image/loader/ImageConver terBarcode2G2D.java?revision=1.1view=markup So tell me if I'm wrong : I must implement Graphics2DImagePainter and AbstractImageConverter, I'll draw there my chart to the given Graphics2D. XMLGraphics will take care of integrating it into the doc (being created by fop). 2) I must also extend AbstractImage, but for the moment I don't really understand what code to write there. To register the converter programatically : FopFactory factory = FopFactory.newInstance(); factory.getImageManager().getRegistry().registerConverter(myG2DConvert er); That sounds ok. 3) But I don't understand how to make the link between my objects and the registred converter. 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/xm lgraphics-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/xm lgraphics-commons/java/org/krysalis/barcode4j/image/loader/ImageConver terBarcodeXML2Barcode.java?view=markup [2] http://barcode4j.cvs.sourceforge.net/viewvc/barcode4j/barcode4j/src/xm lgraphics-commons/java/org/krysalis/barcode4j/image/loader/ImageBarcod e.java?view=markup [3] http://barcode4j.cvs.sourceforge.net/viewvc/barcode4j/barcode4j/src/xm lgraphics-commons/java/org/krysalis/barcode4j/image/loader/ImageConver terBarcode2G2D.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
RE: 3D charts and FOP 1.0
I use SVG for 2D charts. There is also a free Java library called JFreeChart which also claims to do 3D charts. -Original Message- From: Jayant Ghagre [mailto:jayant.gha...@ambest.com] Sent: Friday, December 24, 2010 12:43 PM To: fop-users@xmlgraphics.apache.org Subject: 3D charts and FOP 1.0 We are generating PDF reports by retrieving data in XML format from Oracle (11gR2) database. Java Servlet generates the PDF using the XML data and XSLT. I would like to know fop-user's experience in generating 3D charts with XSL-FO. Did you use SVG to generate 3D charts? Any other option? What were the technical issues related to generating 3D charts and including them in PDF report? Thanks for your help. Jayant - 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: ValidationException: Document is empty
That would be because your document is empty. Am I missing something here? This is the entire text of the xml you attached: ROOT/ROOT -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 9:30 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi everybody, Since nobody yet provided an answer, let's make it easier to debug. Here are a really short xml and a really short and simple transformation. The call to fop is org.apache.fop.cli.Main -d -xml test/xml/billing.xml -xsl test/xsl/billing.xslt -pdf c:\temp\test2.pdf Fop version is the latest trunk. Error message is: org.apache.fop.fo.ValidationException: Document is empty (something might be wrong with your XSLT stylesheet). Confused is: me. What could be wrong with my stylesheet? (Yes, I know we don't like xml and xslts here, but obviously I can't provide anything else) 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: Georg Datterl Gesendet: Freitag, 3. Dezember 2010 18:22 An: 'fop-users@xmlgraphics.apache.org' Betreff: ValidationException: Document is empty Hi folks, Another funny question from yours truly. It's been some time since our last quiz show and maybe this time we get a new winner. Anyway, here's todays problem: Given: * FOP 1.0, Batik 1.7, xmlgraphics-commons 1.4, xalan 2.7.1, xerxes 2.6.2, through maven, but I get the same results with a shortly-before-1.0-release version of trunk and XmlSpy * * A simple xml file * An equally simple transformation file, one page layout, a few blocks, two tables with blocks, two borders. Wanted: * A simple PDF, one page, no images. Problem: * When applying the transformation, I get a fo file which I can transform into a pdf. Everything works fine. * When running the xml and the xslt through fop (following ExampleXML2FO), I get the fo file which I can transform into PDF. Looks ok. * When running the xml and the xslt through fop (following ExampleXML2PDF) with MimeConstants.MIME_FOP_AREA_TREE, I get the area tree. Looks ok. * When running the xml and the xslt through fop (following ExampleXML2PDF) with MimeConstants.MIME_PDF, I get [org.apache.fop.fo.FOTreeBuilder] - org.apache.fop.fo.ValidationException: Document is empty (something might be wrong with your XSLT stylesheet). * When combining ExampleXML2FO and ExampleXML2PDF and using two transformations (XML-FO, FO-Area tree), I get a correct Area tree. * When combining ExampleXML2FO and ExampleXML2PDF and using two transformations (XML-FO, FO-PDF), I get a pdf, which should have one PageSequence with one page, according to fop.getResults(). I can't open the PDF in Acrobat (pdf corrupt and can't be repaired) That's it. No error messages, no hints. Area tree works, generating a pdf does not. Generating a fo and then a pdf works in XmlSpy. Does anybody see any reasoning behind that? 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 - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: ValidationException: Document is empty
That seems a strange thing to do but yes that works fine. FOP just doesn't like html in the xslt. Replace all lt; with and you get an empty document. -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 10:08 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, Indeed, the xml is nearly empty, but I'd expect a one-page document with one flow and one block inside. 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: Eric Douglas [mailto:edoug...@blockhouse.com] Gesendet: Dienstag, 7. Dezember 2010 16:05 An: fop-users@xmlgraphics.apache.org Betreff: RE: ValidationException: Document is empty That would be because your document is empty. Am I missing something here? This is the entire text of the xml you attached: ROOT/ROOT -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 9:30 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi everybody, Since nobody yet provided an answer, let's make it easier to debug. Here are a really short xml and a really short and simple transformation. The call to fop is org.apache.fop.cli.Main -d -xml test/xml/billing.xml -xsl test/xsl/billing.xslt -pdf c:\temp\test2.pdf Fop version is the latest trunk. Error message is: org.apache.fop.fo.ValidationException: Document is empty (something might be wrong with your XSLT stylesheet). Confused is: me. What could be wrong with my stylesheet? (Yes, I know we don't like xml and xslts here, but obviously I can't provide anything else) 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: Georg Datterl Gesendet: Freitag, 3. Dezember 2010 18:22 An: 'fop-users@xmlgraphics.apache.org' Betreff: ValidationException: Document is empty Hi folks, Another funny question from yours truly. It's been some time since our last quiz show and maybe this time we get a new winner. Anyway, here's todays problem: Given: * FOP 1.0, Batik 1.7, xmlgraphics-commons 1.4, xalan 2.7.1, xerxes 2.6.2, through maven, but I get the same results with a shortly-before-1.0-release version of trunk and XmlSpy * * A simple xml file * An equally simple transformation file, one page layout, a few blocks, two tables with blocks, two borders. Wanted: * A simple PDF, one page, no images. Problem: * When applying the transformation, I get a fo file which I can transform into a pdf. Everything works fine. * When running the xml and the xslt through fop (following ExampleXML2FO), I get the fo file which I can transform into PDF. Looks ok. * When running the xml and the xslt through fop (following ExampleXML2PDF) with MimeConstants.MIME_FOP_AREA_TREE, I get the area tree. Looks ok. * When running the xml and the xslt through fop (following ExampleXML2PDF) with MimeConstants.MIME_PDF, I get [org.apache.fop.fo.FOTreeBuilder] - org.apache.fop.fo.ValidationException: Document is empty (something might be wrong with your XSLT stylesheet). * When combining ExampleXML2FO and ExampleXML2PDF and using two transformations (XML-FO, FO-Area tree), I get a correct Area tree. * When combining ExampleXML2FO and ExampleXML2PDF and using two transformations (XML-FO, FO-PDF), I get a pdf, which should have one PageSequence with one page, according to fop.getResults(). I can't open the PDF in Acrobat (pdf corrupt and can't be repaired) That's it. No error messages, no hints. Area tree works, generating a pdf does not. Generating a fo and then a pdf works in XmlSpy. Does anybody see any reasoning behind that? 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
RE: ValidationException: Document is empty
I think you're a bit confused. 1) FOP doesn't complain about anything. My response included the corrected xslt along with a PDF I got from FOP with it. 2) I'm not sure what you mean by valid xml. Your xml file is a valid xml. Your xslt file is not xslt if it contains any fo. If you fix the tags it's valid xslfo. 3) Converting to lt; wouldn't make it work any better as anything else since you didn't convert to gt; Xslt: http://www.w3schools.com/xsl/default.asp Xslfo: http://www.w3schools.com/xslfo/default.asp Xslt was designed to format xml data for a web page. Xslfo expands on xslt to add the pageable tags required for a PDF which a web page wouldn't understand. -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 10:40 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, You are right. But. Of course there's a but... Let me expand my transformation a little bit: ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:variable name=A4_HEIGHT select='297mm'/ xsl:template match=ROOT fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=simple page-height=/xsl:text xsl:value-of select=$A4_HEIGHT/ xsl:text disable-output-escaping=yes fo:region-body / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=simple fo:flow flow-name=xsl-region-body fo:block/fo:block /fo:flow /fo:page-sequence /fo:root /xsl:template /xsl:stylesheet Now fop (actually: the sax parser) complains about the in page-height. Quite understandable, I think. And the whole transformation is no longer valid xml, since the fo tags are mixed into the xsl tags. 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: Eric Douglas [mailto:edoug...@blockhouse.com] Gesendet: Dienstag, 7. Dezember 2010 16:21 An: fop-users@xmlgraphics.apache.org Betreff: RE: ValidationException: Document is empty That seems a strange thing to do but yes that works fine. FOP just doesn't like html in the xslt. Replace all lt; with and you get an empty document. -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 10:08 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, Indeed, the xml is nearly empty, but I'd expect a one-page document with one flow and one block inside. 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: Eric Douglas [mailto:edoug...@blockhouse.com] Gesendet: Dienstag, 7. Dezember 2010 16:05 An: fop-users@xmlgraphics.apache.org Betreff: RE: ValidationException: Document is empty That would be because your document is empty. Am I missing something here? This is the entire text of the xml you attached: ROOT/ROOT -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 9:30 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi everybody, Since nobody yet provided an answer, let's make it easier to debug. Here are a really short xml and a really short and simple transformation. The call to fop is org.apache.fop.cli.Main -d -xml test/xml/billing.xml -xsl test/xsl/billing.xslt -pdf c:\temp\test2.pdf Fop version is the latest trunk. Error message is: org.apache.fop.fo.ValidationException: Document is empty (something might be wrong with your XSLT stylesheet). Confused is: me. What could be wrong with my stylesheet? (Yes, I know we don't like xml and xslts here, but obviously I can't provide anything else) Regards, Georg
RE: AW: ValidationException: Document is empty
If you can write your own code you could do the 2 step transformation to avoid the issue without writing the FO file to disk. FOP allows you to receive the results as streaming bytes which you can send right back in as an FO SAXSource. -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 12:17 PM To: fop-users@xmlgraphics.apache.org Subject: AW: AW: ValidationException: Document is empty Hi Chris, I think that's the important point. I'll rewrite my transformation tomorrow and have a look. Thanks a lot. Oh, and 20 points for the plausible explanation. 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: Christopher R. Maden [mailto:cr...@maden.org] Gesendet: Dienstag, 7. Dezember 2010 17:48 An: fop-users@xmlgraphics.apache.org Betreff: Re: AW: ValidationException: Document is empty On 12/07/2010 11:43 AM, Georg Datterl wrote: I'm not quite sure WHO exactly complains. The original xslt (with lt;) works fine if I use it to transform the xml file. It generates a fo-file which I can then transform into a pdf. The corrected xslt works fine, if I don't use more complex transformations. It stops working when I use variables. Ah... I've got it now. This is why use of disable-output-escaping is so strongly discouraged... When you use XSLT to transform your XML and serialize it to disk, the d-o-e is applied and you get a valid FO. However, when you feed XML and XSLT to FOP, your transformation result is never serialized. The d-o-e directive is never applied, and a poorly-formed XML data structure is passed to FOP, resulting in your error. You will need to rewrite your transformation to avoid use of d-o-e. It is an unfortunate hack that really shouldn't have been included in XSLT; it is never necessary, and while it enables some quick hacks that would be more complicated otherwise, it also is prone to mysterious breakage like your case. ~Chris -- Chris Maden, text nerd URL: http://crism.maden.org/ MISSING: land of free, home of brave. Last seen 10 September 2001. Reward offered. GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319 - 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: ValidationException: Document is empty
Did you read the links I included? Xslt does not contain fo. Xslt can include fo tags which would make it xslfo which can be transformed with an xml to generate fo. Xslt can be used without any fo tags to generate web content. FOP requires either xslfo + xml or fo which is that intermediate result of xslfo + xml you're seeing in the 2 step transformation. The difference between the xslt and xslfo is the fo tags which tell it how to generate a document, which provides information such as page breaks which you wouldn't have on the web. While your xslt file with the lt; tags in it did pass an xsl validation with one free program I found to verify syntax, it's not standard code to start a tag with lt; and end with . If you can break the code with variables I'd like to see a sample. I use plenty of variables in my xsl. If you cannot transform your xml+xslt-pdf with fop 1.0 with the lt; references converted to please send what error message you're seeing. That works fine here. -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 11:44 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, I think you're a bit confused. Oh yes. 1) FOP doesn't complain about anything. My response included the corrected xslt along with a PDF I got from FOP with it. I'm not quite sure WHO exactly complains. The original xslt (with lt;) works fine if I use it to transform the xml file. It generates a fo-file which I can then transform into a pdf. The corrected xslt works fine, if I don't use more complex transformations. It stops working when I use variables. 2) I'm not sure what you mean by valid xml. Your xml file is a valid xml. Your xslt file is not xslt if it contains any fo. If you fix the tags it's valid xslfo. My xslt should not contain valid fo, it should create valid fo. If I fix the tags, it's (IMHO) no longer a valid xslt-file. 3) Converting to lt; wouldn't make it work any better as anything else since you didn't convert to gt; Converting to lt; would make it a valid xslt-file, IMHO, since the fo-tags are no longer found. The transformation originally worked fine with fop 0.20, so it is possible that something changed, but that would still not explain why I can transform xml+xslt-fo and fo-pdf, but not xml+xslt-pdf directly. 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: Eric Douglas [mailto:edoug...@blockhouse.com] Gesendet: Dienstag, 7. Dezember 2010 17:25 An: fop-users@xmlgraphics.apache.org Betreff: RE: ValidationException: Document is empty I think you're a bit confused. 1) FOP doesn't complain about anything. My response included the corrected xslt along with a PDF I got from FOP with it. 2) I'm not sure what you mean by valid xml. Your xml file is a valid xml. Your xslt file is not xslt if it contains any fo. If you fix the tags it's valid xslfo. 3) Converting to lt; wouldn't make it work any better as anything else since you didn't convert to gt; Xslt: http://www.w3schools.com/xsl/default.asp Xslfo: http://www.w3schools.com/xslfo/default.asp Xslt was designed to format xml data for a web page. Xslfo expands on xslt to add the pageable tags required for a PDF which a web page wouldn't understand. -Original Message- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 10:40 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, You are right. But. Of course there's a but... Let me expand my transformation a little bit: ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:variable name=A4_HEIGHT select='297mm'/ xsl:template match=ROOT fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=simple page-height=/xsl:text xsl:value-of select=$A4_HEIGHT/ xsl:text disable-output-escaping=yes fo:region-body / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=simple fo:flow flow-name=xsl-region-body fo:block/fo:block /fo:flow /fo:page-sequence
RE: Antwort: Re: EPSTranscoder Fonts
FOP supports TrueType fonts just fine, apparently just not in PostScript. What could you possibly require PostScript for? From: heiko.emm...@continental-corporation.com [mailto:heiko.emm...@continental-corporation.com] Sent: Friday, December 03, 2010 5:31 AM To: fop-users@xmlgraphics.apache.org Subject: Antwort: Re: EPSTranscoder Fonts Hello Jeremias, thanks for your answer. Unfortunatally it is still not working for me. I guess I need to search for an other solution till fop is supporting TrueType fonts. But thank you for your help. Best regards Heiko Von:Jeremias Maerki d...@jeremias-maerki.ch An:fop-users@xmlgraphics.apache.org Datum:01.12.2010 08:41 Betreff:Re: EPSTranscoder Fonts I don't have a solution that works out of the box for you right now, but... 1. FOP 1.0 doesn't require the use of the metrics-url attribute anymore. Just skip the TTFReader part. 2. PostScript output in FOP 1.0 doesn't support TrueType fonts. That is currently being developed in a development branch. You'll need to use Type 1 fonts instead, for now anway. 3. I'd remove the intermediary fonts element in the configuration for the EPSTranscoder. If my recollection is right, the configurator looks for the font elements in the root element. HTH On 26.11.2010 08:59:24 Heiko.Emmert wrote: Hello together, hope this is the correct mail-address to ask my question. I'm trying to convert some svg-files to eps using fop 1.0. My Problem is, that I always get the messages about mising glyphes and/or fonts. I know there are a lot of descriptions available in how to make such configurations. But none of them helped me. Currently my Config-File looks like this: renderer mime=PSRenderer fonts auto-detect/ auto-rotate-landscape0/auto-rotate-landscape font metrics-url= D:/develop/04_components/fop-1.0/Font_Metrics/Arial.xml kerning=yes embed-url=D:/develop/04_components/fop-1.0/Font_Metrics/arial.ttf font-triplet name=ArialMT style=normal weight =normal/ font-triplet name=ArialMT style=normal weight =400/ font-triplet name=Arial style=normal weight= normal/ font-triplet name=Arial style=normal weight= 400/ /font And in my code I try to attach the conifguration using this lines of code: DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File( D:/develop/04_components/fop-1.0/conf/epsconf.xml)); ContainerUtil.configure(transcoder, cfg); What I've figured out is, that if I use the PDFTranscoder the attribute 'cfg' of transcoder is not empty, but is 'null' if I use the EPSTranscoder. But unfortunatally I need EPS Does anybody has an idea?? Why is the PDFTranscoder automatically using the correct Fonts and the EPSTranscoder not?? Thank you for your help. Heiko Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Antwort: RE: Antwort: Re: EPSTranscoder Fonts
Again, what are you doing which requires PostScript? Are you running it from a command line? Are you using embedded code? I am using embedded code and I am using SVG and I am printing to a dot matrix printer and I am using TrueType fonts and I am not using PostScript. For sending output directly to the printer I just give Fop a ByteArrayOutputStream to receive the data then pass it into a PDFBox object and use the print methods that come with Java. From: heiko.emm...@continental-corporation.com [mailto:heiko.emm...@continental-corporation.com] Sent: Friday, December 03, 2010 8:01 AM To: fop-users@xmlgraphics.apache.org Subject: Antwort: RE: Antwort: Re: EPSTranscoder Fonts OK... sorry... wrong wording... ... till FOP's EPSTranscoder is supporting TrueType fonts So what I need is simply a transformation from svg to eps. Von:Eric Douglas edoug...@blockhouse.com An:fop-users@xmlgraphics.apache.org Datum:03.12.2010 13:51 Betreff:RE: Antwort: Re: EPSTranscoder Fonts FOP supports TrueType fonts just fine, apparently just not in PostScript. What could you possibly require PostScript for? From: heiko.emm...@continental-corporation.com [mailto:heiko.emm...@continental-corporation.com mailto:heiko.emm...@continental-corporation.com ] Sent: Friday, December 03, 2010 5:31 AM To: fop-users@xmlgraphics.apache.org Subject: Antwort: Re: EPSTranscoder Fonts Hello Jeremias, thanks for your answer. Unfortunatally it is still not working for me. I guess I need to search for an other solution till fop is supporting TrueType fonts. But thank you for your help. Best regards Heiko Von:Jeremias Maerki d...@jeremias-maerki.ch An:fop-users@xmlgraphics.apache.org Datum:01.12.2010 08:41 Betreff:Re: EPSTranscoder Fonts I don't have a solution that works out of the box for you right now, but... 1. FOP 1.0 doesn't require the use of the metrics-url attribute anymore. Just skip the TTFReader part. 2. PostScript output in FOP 1.0 doesn't support TrueType fonts. That is currently being developed in a development branch. You'll need to use Type 1 fonts instead, for now anway. 3. I'd remove the intermediary fonts element in the configuration for the EPSTranscoder. If my recollection is right, the configurator looks for the font elements in the root element. HTH On 26.11.2010 08:59:24 Heiko.Emmert wrote: Hello together, hope this is the correct mail-address to ask my question. I'm trying to convert some svg-files to eps using fop 1.0. My Problem is, that I always get the messages about mising glyphes and/or fonts. I know there are a lot of descriptions available in how to make such configurations. But none of them helped me. Currently my Config-File looks like this: renderer mime=PSRenderer fonts auto-detect/ auto-rotate-landscape0/auto-rotate-landscape font metrics-url= D:/develop/04_components/fop-1.0/Font_Metrics/Arial.xml kerning=yes embed-url=D:/develop/04_components/fop-1.0/Font_Metrics/arial.ttf font-triplet name=ArialMT style=normal weight =normal/ font-triplet name=ArialMT style=normal weight =400/ font-triplet name=Arial style=normal weight= normal/ font-triplet name=Arial style=normal weight= 400/ /font And in my code I try to attach the conifguration using this lines of code: DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File( D:/develop/04_components/fop-1.0/conf/epsconf.xml)); ContainerUtil.configure(transcoder, cfg); What I've figured out is, that if I use the PDFTranscoder the attribute 'cfg' of transcoder is not empty, but is 'null' if I use the EPSTranscoder. But unfortunatally I need EPS Does anybody has an idea?? Why is the PDFTranscoder automatically using the correct Fonts and the EPSTranscoder not?? Thank you for your help. Heiko Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Antwort: RE: Antwort: RE: Antwort: Re: EPSTranscoder Fonts
If you could provide any details on what you're trying to do perhaps we could help you find a workaround. What is this tool? # should indicate that your data contains references to glyphs which are not in the font. If you need to use TrueType fonts and PS doesn't support it, the obvious answer is don't use PS, but no one can tell you how to do that if we don't know why you're using PS in the first place. From: heiko.emm...@continental-corporation.com [mailto:heiko.emm...@continental-corporation.com] Sent: Friday, December 03, 2010 8:29 AM To: fop-users@xmlgraphics.apache.org Subject: Antwort: RE: Antwort: RE: Antwort: Re: EPSTranscoder Fonts I have some svg-file which I need to convert to eps for further proceeding with a tool which does not support svg. Therefore I tried to make a converter using EPSTranscoder to output the eps-file. But whatever I've tried, I did not get all fonts, which are used in my svg-files, visible in the eps. Instead there are always # and/or other font-types. Von:Eric Douglas edoug...@blockhouse.com An:fop-users@xmlgraphics.apache.org Datum:03.12.2010 14:16 Betreff:RE: Antwort: RE: Antwort: Re: EPSTranscoder Fonts Again, what are you doing which requires PostScript? Are you running it from a command line? Are you using embedded code? I am using embedded code and I am using SVG and I am printing to a dot matrix printer and I am using TrueType fonts and I am not using PostScript. For sending output directly to the printer I just give Fop a ByteArrayOutputStream to receive the data then pass it into a PDFBox object and use the print methods that come with Java. From: heiko.emm...@continental-corporation.com [mailto:heiko.emm...@continental-corporation.com mailto:heiko.emm...@continental-corporation.com ] Sent: Friday, December 03, 2010 8:01 AM To: fop-users@xmlgraphics.apache.org Subject: Antwort: RE: Antwort: Re: EPSTranscoder Fonts OK... sorry... wrong wording... ... till FOP's EPSTranscoder is supporting TrueType fonts So what I need is simply a transformation from svg to eps. Von:Eric Douglas edoug...@blockhouse.com An:fop-users@xmlgraphics.apache.org Datum:03.12.2010 13:51 Betreff:RE: Antwort: Re: EPSTranscoder Fonts FOP supports TrueType fonts just fine, apparently just not in PostScript. What could you possibly require PostScript for? From: heiko.emm...@continental-corporation.com [mailto:heiko.emm...@continental-corporation.com mailto:heiko.emm...@continental-corporation.com ] Sent: Friday, December 03, 2010 5:31 AM To: fop-users@xmlgraphics.apache.org Subject: Antwort: Re: EPSTranscoder Fonts Hello Jeremias, thanks for your answer. Unfortunatally it is still not working for me. I guess I need to search for an other solution till fop is supporting TrueType fonts. But thank you for your help. Best regards Heiko Von:Jeremias Maerki d...@jeremias-maerki.ch An:fop-users@xmlgraphics.apache.org Datum:01.12.2010 08:41 Betreff:Re: EPSTranscoder Fonts I don't have a solution that works out of the box for you right now, but... 1. FOP 1.0 doesn't require the use of the metrics-url attribute anymore. Just skip the TTFReader part. 2. PostScript output in FOP 1.0 doesn't support TrueType fonts. That is currently being developed in a development branch. You'll need to use Type 1 fonts instead, for now anway. 3. I'd remove the intermediary fonts element in the configuration for the EPSTranscoder. If my recollection is right, the configurator looks for the font elements in the root element. HTH On 26.11.2010 08:59:24 Heiko.Emmert wrote: Hello together, hope this is the correct mail-address to ask my question. I'm trying to convert some svg-files to eps using fop 1.0. My Problem is, that I always get the messages about mising glyphes and/or fonts. I know there are a lot of descriptions available in how to make such configurations. But none of them helped me. Currently my Config-File looks like this: renderer mime=PSRenderer fonts auto-detect/ auto-rotate-landscape0/auto-rotate-landscape font metrics-url= D:/develop/04_components/fop-1.0/Font_Metrics/Arial.xml kerning=yes embed-url=D:/develop/04_components/fop-1.0/Font_Metrics/arial.ttf font-triplet name=ArialMT style=normal weight =normal/ font-triplet name=ArialMT style=normal weight =400/ font-triplet name=Arial style=normal weight= normal/ font-triplet name=Arial style=normal weight= 400/ /font And in my code I try to attach the conifguration