re: Page Numbers
> Thank you, this will help me a lot. > > > > The only other problem that I might still have is putting the barcode on > each page, is there a way that I can find out when a new page is > created? As I have to put a barcode on each page and I am creating > tables in my document, which overflows onto the next page, so I won't > know when a new page is created > I don't fully understand that. If you have to put a barcode on every page then I assume it would need to go into some static content area (for example the footer). In that case wouldn't the barcode4j extension pick up the current page number automatically as described by Jeremias? > > > Thanks for all your help. > > > > Andre groeneveld > > IS Services > > Tel: (011) 489 - 4117 > > Fax: (011) 489 - 4128 > Manuel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: Page Numbers
Thank you, this will help me a lot. The only other problem that I might still have is putting the barcode on each page, is there a way that I can find out when a new page is created? As I have to put a barcode on each page and I am creating tables in my document, which overflows onto the next page, so I won’t know when a new page is created Thanks for all your help. Andre groeneveld IS Services Tel: (011) 489 - 4117 Fax: (011) 489 - 4128 Confidentiality Caution and Disclaimer This message and/or any attachment thereto ("the message")contains privileged and confidential information intendedonly for the recipient. If you are not the intended recipient of this message,please erase it permanently once you have notified thesender, per return e-mail, that you have received themessage in error.Unless the sender is duly authorised by either the TelesureGroup, or any of its subsidiary or affiliated companies or I.S Services("the Group") to send this message and unless the contentof this message is also duly authorised by the Group, anyviews expressed in this message are those of the individualsender and the Group will not accept liability therefore,nor for any consequential damage arising there from.Any recipient of an unacceptable communication, a chainletter or offensive material of any nature is requestedto be reported to [EMAIL PROTECTED].
Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta version
> > > > > > Hi , > > I tried some combinations as > > ExampleXML2FO.java + MY_XML => OUT_FO > The fop file which is generated put the image tag as > > content-width="scale-to-fit"/> > > Now when I pass this fop to > ExampleXML2PDF.java + MY_XML + OUT_FO => MY_PDF > > or > > ExampleFO2PDF.java + OUT_FO => My_PDF > In both the case the image size is not taken as aboslute size of image > instead it shrinks since the tag don't mention the height and width. > I also went through examples/fo/basic/images.fo but result was same.. > Also the Leading spaces are neglected/deleted in both the cases. > > Can you please let me know when can Leading spaces getting > deleted/neglected bug in fop-0.91 beta can be fixed. as the Leading spaces > works fine in fop 0.20.5 > There are typically no timeframes for these types of problems as we are all volunteers using our spare time to work on FOP. If it is a serious and urgent problem for you your best option is to get in and fix it yourself. Having said that the current version of FOP in the Subversion repository has a fix which allows it to deal with non breaking spaces correctly. As a work around you could download and build the current development version of FOP and convert in your data, where you want to preserve white space and linefeeds, any spaces to non breaking spaces ( ) Manuel > > Regards, > Nitin Shrivastava > POLARIS SOFTWARE LAB Ltd. > Indiana Business Center > +91-22-56482255 > > > > > > Jeremias Maerki > <[EMAIL PROTECTED] To: > fop-users@xmlgraphics.apache.org > erki.ch> cc: > [EMAIL PROTECTED], > [EMAIL PROTECTED] >Subject: Re: Help needed > for allowing spaces in PDF > O/P using fop-0.91beta > 02/21/2006 02:38 version > PM > > > > > > > > On 21.02.2006 09:35:22 nitin.shrivastava wrote: >> content-width="scale-to-fit" content-height="scale-to-fit" >> for fo:external-graphic does not allow be to put the absolute size of > image >> ... > > Why do you think so? Have a look at the specification at > http://www.w3.org/TR/xsl/slice6.html#fo_external-graphic > and you'll see that this works. There are examples in > examples/fo/basic/images.fo which demonstrate all the different property > combinations. scale-to-fit causes the image to be scaled so it fits into > the viewport box defined by the width and height properties. > >> Can you suggest any workaround to allow Leading spaces in my case ??? > > If there was one, we would have given it. The only solution is to fix > the problem in the source code. Sorry. You can try to work with > start-indent or margin-left. It's not the same but maybe it helps in > your case. > >> >> >> >> Thanks & Regards, >> Nitin Shrivastava >> POLARIS SOFTWARE LAB Ltd. >> Indiana Business Center >> +91-22-56482255 >> >> >> >> >> >> > >> Jeremias Maerki > >> <[EMAIL PROTECTED] To: > fop-users@xmlgraphics.apache.org > >> erki.ch> cc: > [EMAIL PROTECTED] > >>Subject: Re: Help needed > for allowing spaces in PDF O/P using fop-0.91beta >> 02/21/2006 01:15 version > >> PM > >> > >> > >> >> >> >> >> Nitin Shrivastava does not appear to be on the list so I put the mail >> address in the CC. >> >> In addition to Manuel's reply I want to add something to the question >> further down: >> >> If you want to have an image appear in a box of a certain size, use this >> pattern: >> >> > content-width="scale-to-fit" content-height="scale-to-fit" src=""/> >> >> On 20.02.2006 12:54:30 Manuel Mall wrote: >> > The white space handling for linefeed-treatment="preserve" is >> currently >> > not correct for fop trunk. Leading spaces are incorrectly deleted. >> > >> > Manuel >> > >> > On Monday 20 February 2006 19:17, [EMAIL PROTECTED] > wrote: >> > > Regards, >> > > Nitin Shrivastava >> > > POLARIS SOFTWARE LAB Ltd. >> > > Indiana Business Center >> > > +91-22-56482255 >> > > - >> > > >> > > >> > > "LUCK is what happens when PREPARATION meets OPPORTUNITY" >> > > >> > > >> > > - Forwarded by nitin.shrivastava/Polaris on 02/20/2006 04:45 PM >> > > - >> > > >> > > nitin.shrivastava >> > >To: Jeremias >> > > Maerki <[EMAIL PROTECTED]> 02/20/2006 03:31 cc: >> > > [EMAIL PROTECTED], [EMAIL PROTECTED] PM >> > >Subject: Help needed for allowing spaces in PDF O/P >> > > using fop-0.91beta version(Document link: nitin.shrivastava) >> > > >> > > >> > > >> > > >> > > Hi, >> > > >> > > With FOP 0.91 beta version I was able to overlapp the data over >> > > image. Now the problem I am f
Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta version
Hi , I tried some combinations as ExampleXML2FO.java + MY_XML => OUT_FO The fop file which is generated put the image tag as Now when I pass this fop to ExampleXML2PDF.java + MY_XML + OUT_FO => MY_PDF or ExampleFO2PDF.java + OUT_FO => My_PDF In both the case the image size is not taken as aboslute size of image instead it shrinks since the tag don't mention the height and width. I also went through examples/fo/basic/images.fo but result was same.. Also the Leading spaces are neglected/deleted in both the cases. Can you please let me know when can Leading spaces getting deleted/neglected bug in fop-0.91 beta can be fixed. as the Leading spaces works fine in fop 0.20.5 Regards, Nitin Shrivastava POLARIS SOFTWARE LAB Ltd. Indiana Business Center +91-22-56482255 Jeremias Maerki <[EMAIL PROTECTED] To: fop-users@xmlgraphics.apache.org erki.ch> cc: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta 02/21/2006 02:38 version PM On 21.02.2006 09:35:22 nitin.shrivastava wrote: > content-width="scale-to-fit" content-height="scale-to-fit" > for fo:external-graphic does not allow be to put the absolute size of image > ... Why do you think so? Have a look at the specification at http://www.w3.org/TR/xsl/slice6.html#fo_external-graphic and you'll see that this works. There are examples in examples/fo/basic/images.fo which demonstrate all the different property combinations. scale-to-fit causes the image to be scaled so it fits into the viewport box defined by the width and height properties. > Can you suggest any workaround to allow Leading spaces in my case ??? If there was one, we would have given it. The only solution is to fix the problem in the source code. Sorry. You can try to work with start-indent or margin-left. It's not the same but maybe it helps in your case. > > > > Thanks & Regards, > Nitin Shrivastava > POLARIS SOFTWARE LAB Ltd. > Indiana Business Center > +91-22-56482255 > > > > > > > Jeremias Maerki > <[EMAIL PROTECTED] To: fop-users@xmlgraphics.apache.org > erki.ch> cc: [EMAIL PROTECTED] >Subject: Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta > 02/21/2006 01:15 version > PM > > > > > > > Nitin Shrivastava does not appear to be on the list so I put the mail > address in the CC. > > In addition to Manuel's reply I want to add something to the question > further down: > > If you want to have an image appear in a box of a certain size, use this > pattern: > > content-width="scale-to-fit" content-height="scale-to-fit" src=""/> > > On 20.02.2006 12:54:30 Manuel Mall wrote: > > The white space handling for linefeed-treatment="preserve" is currently > > not correct for fop trunk. Leading spaces are incorrectly deleted. > > > > Manuel > > > > On Monday 20 February 2006 19:17, [EMAIL PROTECTED] wrote: > > > Regards, > > > Nitin Shrivastava > > > POLARIS SOFTWARE LAB Ltd. > > > Indiana Business Center > > > +91-22-56482255 > > > - > > > > > > > > > "LUCK is what happens when PREPARATION meets OPPORTUNITY" > > > > > > > > > - Forwarded by nitin.shrivastava/Polaris on 02/20/2006 04:45 PM > > > - > > > > > > nitin.shrivastava > > >To: Jeremias > > > Maerki <[EMAIL PROTECTED]> 02/20/2006 03:31 cc: > > > [EMAIL PROTECTED], [EMAIL PROTECTED] PM > > >Subject: Help needed for allowing spaces in PDF O/P > > > using fop-0.91beta version(Document link: nitin.shrivastava) > > > > > > > > > > > > > > > Hi, > > > > > > With FOP 0.91 beta version I was able to overlapp the data over > > > image. Now the problem I am facing is w.r.t the space in
RE: Re how to embed a font programatically
Hi I built a URIResolver that reads URL's like: servlet-context:/WEB-INF/metric.xml And it works fine, however when it encounters a URL that doesn't match the servlet-context scheme I return null. However I then get an NullPointerException Caused by: javax.xml.transform.TransformerException: java.lang.NullPointerException at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(T ransformerImpl.java:647) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(T ransformerImpl.java:279) I do return null from my URIResolver in the cases where the scheme doesn't match the one I'm after, and FOURIResolver kicks in, but it never seems to come back to my URIResolver. Should I instead delegate to FOURIResolver rather than return null? Cheers Karl -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Tuesday, 21 February 2006 8:17 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Re how to embed a font programatically I haven't done this from outside FOP, yet, but I can give you a suggestion that I'd prefer in your case: Write a URIResolver implementation that returns StreamSource instances for specific URIs. You can take FOURIResolver as an example for how to do that. You can then set the URIResolver instance on the FOUserAgent using setURIResolver(). This allows you to specify the font URLs like this: servlet-context:/WEB-INF/metric.xml In your URIResolver you simply check if the URI starts with "servlet-context:" and extract the path. You then simply construct a StreamSource giving it the InputStream returned by getResourceAsStream (). If a URI doesn't start with the above prefix just return null and the default URIResolver will kick in. The clue about all this is that you have to do less "FOP-hacking" and instead use the normal configuration mechanism. It should only take 30 minutes to hack. I hope that helps. On 21.02.2006 03:41:01 Karl Roberts wrote: > Hi, > Did you ever manage to do this? > > I need to do something similar because my embedded FOP is running in a > Webapp and the font metric file and the TTF file are hidden inside the > WEB-INF directory and so the metric-url and embed-url in my fop-config > is no good (even if they were accessible via a URL I don't know the > hostname or context path until runtime) > > What would be really nice is someway to pass the fontMetric and TTF > file to the Renderer as InputSource (or InputStream). This way I can > get the font files from the hidden WEB-INF dir using > > InputStream fontmetric = > serve.servlet.getServletContext().getResourceAsStream("/WEB-INF/metric > .x > ml"); > InputStream embed = > serve.servlet.getServletContext().getResourceAsStream("/WEB-INF/font.T > TF > "); > Renderer myRenderer = new PDFRenderer(); FontInfo myFontInfo = new > FontInfo(); > > // method needed ...(ahem) > myFontInfo.addFont("FontName", "FontStyle", "FontWeight", fontmetric, > embed); > > myRenderer.setupFontInfo(myFontInfo); > userAgent.setRendererOverride(myRenderer); > > Am I on the right track? Has anyone done this (or better) and mind > sharing the code? > > Cheers > > Karl > > On 2006-01-26 16:22:42 Jeremias Maerki wrote: > > Looking at the source code, you'd need to do the following: > > - Subclass the Renderer implementation (ex. PDFRenderer) so you gain > > access to the protected fontList member variable. > > - Fill the fontList variable much like > > FontSetup.buildFontListFromConfiguration() does. This code will need > to > > run before you start the rendering run or at least before > > PrintRenderer.setupFontInfo() is called. > > - Instantiate your subclassed Renderer yourself and set it on the > > FOUserAgent using setRendererOverride(). > > > > Have fun! > > > On 26.01.2006 16:59:17 Stefan Burkard wrote: > >> hi fop-users > >> > >> i know i can use a custom font by building an xml-file with it's > >> kerning-values and configuring a font definition in the > user-config-file. > >> > >> but how can i include the font programatically? i don't like to > >> have > a > >> user-config-file at all. i found examples to set the font-directory > or > >> base-directory programatically, but i didn't found an example for > >> configuring fonts directly in java. > >> > >> can anybody help me? > >> thanks > >> stefan Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTICE This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are th
Re: Re: fop beta performance
- original Nachricht Betreff: Re: fop beta performance Gesendet: Mi 22 Feb 2006 21:47:29 CET Von: "J.Pietschmann"<[EMAIL PROTECTED]> > [EMAIL PROTECTED] wrote: > >I've created larger Document (39 pages PDF result)... > > The XSL list owner recently posted this link > http://www.idealliance.org/proceedings/xml03/slides/xslfoshowcase/index.html Pathetic, after 78 pages fop0.20.5 quits with OutOfMemoryException (without vm tuning), I could create Sample[1456] out of the box, the others raise errors. With 0.91 none converts properly, there're a lot of "missing child elements". I'll try to fix it somehow, at least the large one. Has lowest priority for me. First of all I need to sleep, do that RTF-investigation and then there'll be benchmarking. THX > > to a page with several FO samples which could probably be used for > benchmarking. It includes a very big file. > > J.Pietschmann > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --- original Nachricht Ende Noch allein? 1 Million Singles warten auf ein Date! Schnell Kontakt aufnehmen bei Deutschlands beliebtester Partnerboerse http://singles.freenet.de/index.html?pid=11512 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: break-after page
- original Nachricht Betreff: break-after page Gesendet: Mi 22 Feb 2006 22:31:41 CET Von: "Will Peterson"<[EMAIL PROTECTED]> >I'm using the FOP 0.91beta. Whenever I use the break-after="page" in a block, >any document after that point does NOT get >rendered after that point. It >inserts the page break and then the rest is gone. If I render to RTF, the >page break is not a problem >(but does not appear to be inserted) For example >the following line would cause any XSL below it to be ignored. >xmlns:fo="http://www.w3.org/1999/XSL/Format"; break-after="page"/> >Any ideas on what is going on here? Thanks. I confirm, this happens with every block until the next fo:page-sequence. See: http://krachlattenpaul.homelinux.org/fop/simple90_break.fo.xml (line 1192) and the resulting PDF: http://krachlattenpaul.homelinux.org/fop/simple90_break.pdf (on page 4 the code sample is missing) http://krachlattenpaul.homelinux.org/fop/simple90.pdf (here the code sample is present) Maybe opening a fo:page-sequence instead of breaking with the block works around this (the chapters in the sample documents start on new pages). --- original Nachricht Ende 1 Million Singles in Ihrer Nahe. Finden Sie Ihren Traumpartner bei Deutschlands beliebtester Partnerboerse: http://singles.freenet.de/index.html?pid=11512 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: break-after page
It rings a bell. I already have a test case sent to me by Dominic Brügger, which it seems I have managed to misplace. Sorry, guys! I've only just found it again after searching my archive. I'll look into it on Friday. In the meantime, the work-around is to replace break-after with break-before (if that's possible). On 22.02.2006 22:30:59 Will Peterson wrote: > I'm using the FOP 0.91beta. Whenever I use the break-after="page" in a > block, any document after that point does NOT get rendered after that > point. It inserts the page break and then the rest is gone. If I > render to RTF, the page break is not a problem (but does not appear to > be inserted) > > For example the following line would cause any XSL below it to be > ignored. > > http://www.w3.org/1999/XSL/Format"; > break-after="page"/> > > Any ideas on what is going on here? > > Thanks. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
break-after page
I'm using the FOP 0.91beta. Whenever I use the break-after="page" in a block, any document after that point does NOT get rendered after that point. It inserts the page break and then the rest is gone. If I render to RTF, the page break is not a problem (but does not appear to be inserted) For example the following line would cause any XSL below it to be ignored. http://www.w3.org/1999/XSL/Format" break-after="page"/> Any ideas on what is going on here? Thanks.
Re: fop beta performance
[EMAIL PROTECTED] wrote: I've created larger Document (39 pages PDF result)... The XSL list owner recently posted this link http://www.idealliance.org/proceedings/xml03/slides/xslfoshowcase/index.html to a page with several FO samples which could probably be used for benchmarking. It includes a very big file. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: RTF and table/column widths
- original Nachricht Betreff: Re: RTF and table/column widths Gesendet: Mi 22 Feb 2006 08:27:18 CET Von: "Jeremias Maerki"<[EMAIL PROTECTED]> > I hate CVS, too, but in case you haven't noticed, we're on Subversion > for almost a year now. CVS services have been shut down within the ASF > last month. > > http://xmlgraphics.apache.org/fop/download.html#source Mkay, that's pretty cool but for the first shot I'll prefer the pure preview-technique *g*. In addition to that I already hat a closer look to the rtf results, which are heavily under construction. For all my tests I use docbook sources and 1.68.1 xml-stylesheets, create FOs from and run fop 0.91beta. Tables got a serious problem with the block structure. Above the table there are indents (il960) to move all paragraphs a bit to the right, makes space for headings. Before opening a table, these indents won't be reset, so all table columns are indented like paragraphs. 960 in RTF-terms (A4 page, 217mm, 1in margin left&right) means about 20mm, a table with columns less than 2.5times the indent looks very strange, the letters stick to the right border of their column. And I couldn't transform a FO with images, everytime there was a RuntimeException with this PercentageContext-message (even after removing all the % and proportional settings as well as auto-sizing). Tomorrow I'll have some further investigations, determining which part of the FO causes which RTF-block (there are some twice and even three times, absolutely identical AND empty!). When I know this, I'll have a look at the sources. If others work on that code: I wrote two perl scripts transforming fox:outlines and proportional values (faster than applying a stylesheet with xalan, even on HP-UX) - I could share them. To draw a conclusion: maybe on tuesday there'll be the first enhanced RTF classes (monday's holiday 'round here) but surely I'll write 1-2pages about RTF flaws until then. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: fop beta performance
Yes, if there's a lot of logging it slows FOP down tremendously. Also, I think you're measuring from the command-line which lets your measurements include VM startup and class-loading time. At some point, we will need to do more accurate measurements. Of course, it can well be that the new FOP is slower in certain constellations. We'll have to find out. On 22.02.2006 18:42:38 b.ohnsorg wrote: > Me again with the promised stats. I've created larger Document (39 pages > PDF result) with hardcore referencing (index terms, toc for headings, > tables, lists and images) and 0.91 is twice as slow as 0.20. But the > major resource consumption may be caused by heavy logging activity > (debuggin, IO on stdout). So it's not time for any measurement. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database
Added a Wiki page, in case anybody needs that in the future: http://wiki.apache.org/xmlgraphics-fop/HowTo/BasicHttpAuthentication On 22.02.2006 18:33:16 Jeremias Maerki wrote: > I think there's an even easier way to do this, and it's probably the > better one. I've attached a simple class (MyAuthenticator.java) which > you can adjust to your purposes. You can inspect the parameters for the > password authentication and return a username and password depending on > those values. FOP (or rather Java's java.net.URL subsystem) will > use your MyAuthenticator class as soon as you call it's "install()" > method somewhere in the initialization code of your > application/servlet/whatever. > > Here's where I got the idea from: > http://www.javaworld.com/javaworld/javatips/jw-javatip46.html > > No need for a complicated URIResolver using Jakarta Commons HttpClient > or something like that. :-) Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: fop beta performance
Me again with the promised stats. I've created larger Document (39 pages PDF result) with hardcore referencing (index terms, toc for headings, tables, lists and images) and 0.91 is twice as slow as 0.20. But the major resource consumption may be caused by heavy logging activity (debuggin, IO on stdout). So it's not time for any measurement. "Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier klicken" www.klarmobil.de/index.html?pid=73025
Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database
I think there's an even easier way to do this, and it's probably the better one. I've attached a simple class (MyAuthenticator.java) which you can adjust to your purposes. You can inspect the parameters for the password authentication and return a username and password depending on those values. FOP (or rather Java's java.net.URL subsystem) will use your MyAuthenticator class as soon as you call it's "install()" method somewhere in the initialization code of your application/servlet/whatever. Here's where I got the idea from: http://www.javaworld.com/javaworld/javatips/jw-javatip46.html No need for a complicated URIResolver using Jakarta Commons HttpClient or something like that. :-) On 22.02.2006 14:04:39 Jeremias Maerki wrote: > I'll see if I have a little time later to set up a Wiki page describing > this. If anyone beats me to it, all the better. :-) It's really no > witchcraft. > > On 22.02.2006 11:44:40 jelka.kosir wrote: > > I have the FopTrunk version on my computer (JDK 1.3) and testing it for > > issues I had in previous version FOP, so I can decide if we change fop > > version. > > > > This (see history of this mail) was one of the issues I had (how to pass > > to fop basic authentication for retrieving resources from application > > server). > > I solved this with workaround that David suggested (created a Servlet that > > adds authentication and fetches image). > > > > Now I was wondering if this basic authentication can be done more elegant > > in new version and how to do it. > > Currently I'm testing from FOP command line and when I'm done testing I > > will use FOP embedded in application. > > > > Jeremias wrote: > > > you will have > > > the ability to plug in a URIResolver to manually fetch an InputStream to > > > a resource based on a URI.) > > > > I'm quite week at Java programming and am not sure how to "plug a > > URIResolver". > > I would need a few instructions how to do this. > > I guess I have to implement an URIResolver for the resources that need > > authentication and use the default one for resources that don't need > > authentication. > > Where do I create my class? Do I create it in my Java application that I > > call FOP from and how do I convince FOP to use my implementation when > > needed? > > > > I will be glad for any instructions/useful tips on my URIResolver. > > > > Thank you! > > > > Jelka > > > > In addition I add some responses to Jeremias: > > > > -- > > Jeremias wrote: > > > On the other side it's strange that wget is able to get the image with > > > the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does > > > something bad with the URL. It would be great if someone could check > > > this case with FOP Trunk so we can fix any problems like that for the > > > next release. > > > > I did try the "http://username:[EMAIL PROTECTED]/resource.gif" notation > > with the new FOP Trunk and I'm getting error 401 code (Unauthorized). > > This url works in wget. Should a bug report be submitted ? > > This is the error message that displays when I run Fop Trunk from command > > line: > > > > Error with opening URL '//user:[EMAIL PROTECTED]/image.gif': Server > > retu > > rned HTTP response code: 401 for URL: > > http://user:[EMAIL PROTECTED]/image.gif > > java.io.IOException: Server returned HTTP response code: 401 for URL: > > http://user:[EMAIL PROTECTED]/image.gif > > -- > > > > I also tried this notation in my custom config file (I use custom fonts > > because character set we use is Latin 2) I set > > http://user:[EMAIL PROTECTED]/ > > and this produces Error 401 when I run FOP Trunk from command line (wget > > is able to retrieve with this url). > > > > Error with opening URL 'arial.xml': Server returned HTTP response code: > > 401 for > > URL: http://user:[EMAIL PROTECTED]/arial.xml > > java.io.IOException: Server returned HTTP response code: 401 for URL: > > http://user:[EMAIL PROTECTED]/arial.xml > > > > Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root > > (http://www > > .w3.org/1999/XSL/Format) > > Error with opening URL 'arial.xml': Server returned HTTP response code: > > 401 for > > URL: http://user:[EMAIL PROTECTED]/arial.xml > > java.io.IOException: Server returned HTTP response code: 401 for URL: > > http://user:[EMAIL PROTECTED]/arial.xml > > > > javax.xml.transform.TransformerException: java.lang.RuntimeException: > > Cannot loa > > d font: failed to create Source from metrics file arial.xml > > Exception > > javax.xml.transform.TransformerException: java.lang.RuntimeException: > > Cannot loa > > d font: failed to create Source from metrics file arial.xml > > -- > > > > > > > > > > > > > > Jeremias Maerki <[EMAIL PROTECTED]> > > 13.10.2005 16:49 > > Please respond to > > fop-users@xmlgraphics.apache.org > > > > > > To > > fop-users@xmlgraphics.apache.org > > cc > > > > Subject > > Re: how to pass to fop user and password needed for basic authenticati
Re: Re how to embed a font programatically
Since I'm looking into URIResolvers anyway at the moment, I went ahead and implemented that URIResolver I suggested. It's now available in FOP Trunk: http://svn.apache.org/viewcvs?rev=379810&view=rev Just in case you haven't got around to do it, yet. :-) On 21.02.2006 22:29:11 Karl Roberts wrote: > Hi Jeremias, > > Cheers for that. My main issue is that I wanted to as little hacking of > the underlying FOP as possible so that I can keep all my stuff in > separate extended classes (less source control issues) and do it as fast > as possible ;-) > > Being quite new to FOP I am unaware of some of the design philosopies. > Injecting my own URIResolver is a much nicer solution than what I was > going to do. > > So thanks again > > Karl > > -Original Message- > From: Jeremias Maerki [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 21 February 2006 8:17 PM > To: fop-users@xmlgraphics.apache.org > Subject: Re: Re how to embed a font programatically > > I haven't done this from outside FOP, yet, but I can give you a > suggestion that I'd prefer in your case: Write a URIResolver > implementation that returns StreamSource instances for specific URIs. > You can take FOURIResolver as an example for how to do that. You can > then set the URIResolver instance on the FOUserAgent using > setURIResolver(). > > This allows you to specify the font URLs like this: > servlet-context:/WEB-INF/metric.xml > > In your URIResolver you simply check if the URI starts with > "servlet-context:" and extract the path. You then simply construct a > StreamSource giving it the InputStream returned by getResourceAsStream > (). If a URI doesn't start with the above prefix just return null and > the default URIResolver will kick in. > > The clue about all this is that you have to do less "FOP-hacking" and > instead use the normal configuration mechanism. It should only take 30 > minutes to hack. > > I hope that helps. > > On 21.02.2006 03:41:01 Karl Roberts wrote: > > Hi, > > Did you ever manage to do this? > > > > I need to do something similar because my embedded FOP is running in a > > > Webapp and the font metric file and the TTF file are hidden inside the > > > WEB-INF directory and so the metric-url and embed-url in my fop-config > > > is no good (even if they were accessible via a URL I don't know the > > hostname or context path until runtime) > > > > What would be really nice is someway to pass the fontMetric and TTF > > file to the Renderer as InputSource (or InputStream). This way I can > > get the font files from the hidden WEB-INF dir using > > > > InputStream fontmetric = > > serve.servlet.getServletContext().getResourceAsStream("/WEB-INF/metric > > .x > > ml"); > > InputStream embed = > > serve.servlet.getServletContext().getResourceAsStream("/WEB-INF/font.T > > TF > > "); > > Renderer myRenderer = new PDFRenderer(); FontInfo myFontInfo = new > > FontInfo(); > > > > // method needed ...(ahem) > > myFontInfo.addFont("FontName", "FontStyle", "FontWeight", fontmetric, > > embed); > > > > myRenderer.setupFontInfo(myFontInfo); > > userAgent.setRendererOverride(myRenderer); > > > > Am I on the right track? Has anyone done this (or better) and mind > > sharing the code? > > > > Cheers > > > > Karl > > > > On 2006-01-26 16:22:42 Jeremias Maerki wrote: > > > Looking at the source code, you'd need to do the following: > > > - Subclass the Renderer implementation (ex. PDFRenderer) so you gain > > > > access to the protected fontList member variable. > > > - Fill the fontList variable much like > > > FontSetup.buildFontListFromConfiguration() does. This code will need > > to > > > run before you start the rendering run or at least before > > > PrintRenderer.setupFontInfo() is called. > > > - Instantiate your subclassed Renderer yourself and set it on the > > > FOUserAgent using setRendererOverride(). > > > > > > Have fun! > > > > > On 26.01.2006 16:59:17 Stefan Burkard wrote: > > >> hi fop-users > > >> > > >> i know i can use a custom font by building an xml-file with it's > > >> kerning-values and configuring a font definition in the > > user-config-file. > > >> > > >> but how can i include the font programatically? i don't like to > > >> have > > a > > >> user-config-file at all. i found examples to set the font-directory > > or > > >> base-directory programatically, but i didn't found an example for > > >> configuring fonts directly in java. > > >> > > >> can anybody help me? > > >> thanks > > >> stefan Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Flow Area with explizit height inside an "normal" flow area?
Not sure if I understand you but I guess you'd insert the fixed content into a (relatively positioned) block-container (works only with FOP 0.90 and later) where you set the height or block-progression-dimension property and a break-after="page". On 22.02.2006 12:01:56 news wrote: > Hello List, > > I ve a project where I ve got flow content going up to several pages. Inside > this flow content I want to insert another flow content whose measures where > set up by a user previously. The user controlled content should be outputted > as is. Means that if the flow content to be inserted has a height of 10cm a > page break should be performed after 10cm. The to be entered content comes > at once, without any other content in between. After it was inserted the > "normal" content is supposed to be outputted in the flow area using the > region-body scale definitions. > Hm, I hope I could make myself clear :) > > Does anybody have a idea how this could work? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database
I'll see if I have a little time later to set up a Wiki page describing this. If anyone beats me to it, all the better. :-) It's really no witchcraft. On 22.02.2006 11:44:40 jelka.kosir wrote: > I have the FopTrunk version on my computer (JDK 1.3) and testing it for > issues I had in previous version FOP, so I can decide if we change fop > version. > > This (see history of this mail) was one of the issues I had (how to pass > to fop basic authentication for retrieving resources from application > server). > I solved this with workaround that David suggested (created a Servlet that > adds authentication and fetches image). > > Now I was wondering if this basic authentication can be done more elegant > in new version and how to do it. > Currently I'm testing from FOP command line and when I'm done testing I > will use FOP embedded in application. > > Jeremias wrote: > > you will have > > the ability to plug in a URIResolver to manually fetch an InputStream to > > a resource based on a URI.) > > I'm quite week at Java programming and am not sure how to "plug a > URIResolver". > I would need a few instructions how to do this. > I guess I have to implement an URIResolver for the resources that need > authentication and use the default one for resources that don't need > authentication. > Where do I create my class? Do I create it in my Java application that I > call FOP from and how do I convince FOP to use my implementation when > needed? > > I will be glad for any instructions/useful tips on my URIResolver. > > Thank you! > > Jelka > > In addition I add some responses to Jeremias: > > -- > Jeremias wrote: > > On the other side it's strange that wget is able to get the image with > > the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does > > something bad with the URL. It would be great if someone could check > > this case with FOP Trunk so we can fix any problems like that for the > > next release. > > I did try the "http://username:[EMAIL PROTECTED]/resource.gif" notation > with the new FOP Trunk and I'm getting error 401 code (Unauthorized). > This url works in wget. Should a bug report be submitted ? > This is the error message that displays when I run Fop Trunk from command > line: > > Error with opening URL '//user:[EMAIL PROTECTED]/image.gif': Server > retu > rned HTTP response code: 401 for URL: > http://user:[EMAIL PROTECTED]/image.gif > java.io.IOException: Server returned HTTP response code: 401 for URL: > http://user:[EMAIL PROTECTED]/image.gif > -- > > I also tried this notation in my custom config file (I use custom fonts > because character set we use is Latin 2) I set > http://user:[EMAIL PROTECTED]/ > and this produces Error 401 when I run FOP Trunk from command line (wget > is able to retrieve with this url). > > Error with opening URL 'arial.xml': Server returned HTTP response code: > 401 for > URL: http://user:[EMAIL PROTECTED]/arial.xml > java.io.IOException: Server returned HTTP response code: 401 for URL: > http://user:[EMAIL PROTECTED]/arial.xml > > Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root > (http://www > .w3.org/1999/XSL/Format) > Error with opening URL 'arial.xml': Server returned HTTP response code: > 401 for > URL: http://user:[EMAIL PROTECTED]/arial.xml > java.io.IOException: Server returned HTTP response code: 401 for URL: > http://user:[EMAIL PROTECTED]/arial.xml > > javax.xml.transform.TransformerException: java.lang.RuntimeException: > Cannot loa > d font: failed to create Source from metrics file arial.xml > Exception > javax.xml.transform.TransformerException: java.lang.RuntimeException: > Cannot loa > d font: failed to create Source from metrics file arial.xml > -- > > > > > > > Jeremias Maerki <[EMAIL PROTECTED]> > 13.10.2005 16:49 > Please respond to > fop-users@xmlgraphics.apache.org > > > To > fop-users@xmlgraphics.apache.org > cc > > Subject > Re: how to pass to fop user and password needed for basic authentication > to get image resource from Notes database > > > > > > > BTW, the redesigned FOP will make things like that easier. You will have > the ability to plug in a URIResolver to manually fetch an InputStream to > a resource based on a URI. This will make work-arounds like David's > servlet unnecessary. > > On the other side it's strange that wget is able to get the image with > the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does > something bad with the URL. It would be great if someone could check > this case with FOP Trunk so we can fix any problems like that for the > next release. > > On 13.10.2005 16:26:33 David Delbecq wrote: > > Then i guess your solution is to write a servlet which access files > > using the api and get credits token lik this: > > > > > http://domino.example.com/myServlet?doc=/0/A3402F5B583F538AC1257093004C41C8/$File/image.gif&user=someUser&pass=somePass > > > > > If image tag of .fo were to use the
Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta version
Absolutely, yes. In FOP it's even the same code for both external-graphic and instream-foreign-object that figures out the image sizes. Just leave away the height property. On 22.02.2006 13:59:57 Tracey Zellmann wrote: > Thanks for the pattern, Jeremias. > > Would the same apply to instream-foreign-object? What I really want is to > specify the width, and let the system determine the height, sufficient to > preserve the aspect ratio of the original. > > - Original Message - > From: "Jeremias Maerki" <[EMAIL PROTECTED]> > To: > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, February 21, 2006 2:45 AM > Subject: Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta > version > > > > Nitin Shrivastava does not appear to be on the list so I put the mail > > address in the CC. > > > > In addition to Manuel's reply I want to add something to the question > > further down: > > > > If you want to have an image appear in a box of a certain size, use this > > pattern: > > > > > content-width="scale-to-fit" content-height="scale-to-fit" src=""/> Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Numbers
No, at least it's not possible in XSLT since FOP runs after the XSLT stage and you stylesheet cannot know about page-numbers. The FOP extension for Barcode4J, however, contains a special feature that allows you to use the page number in a barcode. That works because Barcode4J runs during FOP's layout process. See the documentation here: http://barcode4j.krysalis.org/fop-ext.html On 22.02.2006 11:45:18 Andre Groeneveld wrote: > Hi can anyone help me please. > > > > Is there any way of storing the current page number in a variable? > > The reason why I need to store the page number is that I need to make a > calculation with the page number and use the result for a barcode. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta version
Thanks for the pattern, Jeremias. Would the same apply to instream-foreign-object? What I really want is to specify the width, and let the system determine the height, sufficient to preserve the aspect ratio of the original. - Original Message - From: "Jeremias Maerki" <[EMAIL PROTECTED]> To: Cc: <[EMAIL PROTECTED]> Sent: Tuesday, February 21, 2006 2:45 AM Subject: Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta version Nitin Shrivastava does not appear to be on the list so I put the mail address in the CC. In addition to Manuel's reply I want to add something to the question further down: If you want to have an image appear in a box of a certain size, use this pattern: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Page Numbers
Hi can anyone help me please. Is there any way of storing the current page number in a variable? The reason why I need to store the page number is that I need to make a calculation with the page number and use the result for a barcode. Please help. Thanks, Confidentiality Caution and Disclaimer This message and/or any attachment thereto ("the message")contains privileged and confidential information intendedonly for the recipient. If you are not the intended recipient of this message,please erase it permanently once you have notified thesender, per return e-mail, that you have received themessage in error.Unless the sender is duly authorised by either the TelesureGroup, or any of its subsidiary or affiliated companies or I.S Services("the Group") to send this message and unless the contentof this message is also duly authorised by the Group, anyviews expressed in this message are those of the individualsender and the Group will not accept liability therefore,nor for any consequential damage arising there from.Any recipient of an unacceptable communication, a chainletter or offensive material of any nature is requestedto be reported to [EMAIL PROTECTED].
Flow Area with explizit height inside an "normal" flow area?
Hello List, I ve a project where I ve got flow content going up to several pages. Inside this flow content I want to insert another flow content whose measures where set up by a user previously. The user controlled content should be outputted as is. Means that if the flow content to be inserted has a height of 10cm a page break should be performed after 10cm. The to be entered content comes at once, without any other content in between. After it was inserted the "normal" content is supposed to be outputted in the flow area using the region-body scale definitions. Hm, I hope I could make myself clear :) Does anybody have a idea how this could work? Thanks, Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database
I have the FopTrunk version on my computer (JDK 1.3) and testing it for issues I had in previous version FOP, so I can decide if we change fop version. This (see history of this mail) was one of the issues I had (how to pass to fop basic authentication for retrieving resources from application server). I solved this with workaround that David suggested (created a Servlet that adds authentication and fetches image). Now I was wondering if this basic authentication can be done more elegant in new version and how to do it. Currently I'm testing from FOP command line and when I'm done testing I will use FOP embedded in application. Jeremias wrote: > you will have > the ability to plug in a URIResolver to manually fetch an InputStream to > a resource based on a URI.) I'm quite week at Java programming and am not sure how to "plug a URIResolver". I would need a few instructions how to do this. I guess I have to implement an URIResolver for the resources that need authentication and use the default one for resources that don't need authentication. Where do I create my class? Do I create it in my Java application that I call FOP from and how do I convince FOP to use my implementation when needed? I will be glad for any instructions/useful tips on my URIResolver. Thank you! Jelka In addition I add some responses to Jeremias: -- Jeremias wrote: > On the other side it's strange that wget is able to get the image with > the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does > something bad with the URL. It would be great if someone could check > this case with FOP Trunk so we can fix any problems like that for the > next release. I did try the "http://username:[EMAIL PROTECTED]/resource.gif" notation with the new FOP Trunk and I'm getting error 401 code (Unauthorized). This url works in wget. Should a bug report be submitted ? This is the error message that displays when I run Fop Trunk from command line: Error with opening URL '//user:[EMAIL PROTECTED]/image.gif': Server retu rned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/image.gif java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/image.gif -- I also tried this notation in my custom config file (I use custom fonts because character set we use is Latin 2) I set http://user:[EMAIL PROTECTED]/ and this produces Error 401 when I run FOP Trunk from command line (wget is able to retrieve with this url). Error with opening URL 'arial.xml': Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (http://www .w3.org/1999/XSL/Format) Error with opening URL 'arial.xml': Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml javax.xml.transform.TransformerException: java.lang.RuntimeException: Cannot loa d font: failed to create Source from metrics file arial.xml Exception javax.xml.transform.TransformerException: java.lang.RuntimeException: Cannot loa d font: failed to create Source from metrics file arial.xml -- Jeremias Maerki <[EMAIL PROTECTED]> 13.10.2005 16:49 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database BTW, the redesigned FOP will make things like that easier. You will have the ability to plug in a URIResolver to manually fetch an InputStream to a resource based on a URI. This will make work-arounds like David's servlet unnecessary. On the other side it's strange that wget is able to get the image with the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does something bad with the URL. It would be great if someone could check this case with FOP Trunk so we can fix any problems like that for the next release. On 13.10.2005 16:26:33 David Delbecq wrote: > Then i guess your solution is to write a servlet which access files > using the api and get credits token lik this: > > http://domino.example.com/myServlet?doc=/0/A3402F5B583F538AC1257093004C41C8/$File/image.gif&user=someUser&pass=somePass > > If image tag of .fo were to use the InputSource schem of xml document, > you could have created an Inputsource which > manage the authentification. Unfortunately, as i discovered some time > before, fop does not use inputsource to load pictures. > (really, it uses a simple URL()) > I think this will be handled in next version, but if you followed this > maling list, lots of things will change in next version, > so it might not be availbe for a few time :) > Ha yeah, you can also try to add your custom protoc