RE: Help required for Japanese FOP
I agree the same, Sankat!.. Try to follow this link http://xml.apache.org/fop/fonts.html , you don't have to build FOP for msgothic font. --- [EMAIL PROTECTED] wrote: I agree with Rob. As I mentioned in my barcode thread, once you have the metrics file generated, embed the font and then reference it in your stylesheet. For example, I did some work with embedding Chinese characters in a document: Vector allFonts = new Vector(); Vector allTrips = new Vector(); allTrips.add(new FontTriplet(MS Song,normal,normal)); FontInfo fontInfo = new FontInfo(MS SONG,/fonts/mssong.xml,true,allTrips,/fonts/mssong.ttf); allFonts.add(fontInfo); Configuration.put(fonts, allFonts); Referenced in XSL: fo:block font-family=MS Song padding-bottom=1mm oûúú /fo:block Does this help? -Lou Rob Stote [EMAIL PROTECTED] To: [EMAIL PROTECTED] ltech.com cc: Subject: RE: Help required for Japanese FOP 10/26/2004 11:33 Please respond to fop-user I'm jumping in here last minute but... I am a little confused as to why you are building FOP. We currently are dealing with Japanese customers, and have had no issues. Here is What I did: Generate the appropriate font metrics file Configure FOP via the fop-config.xml file to use and embed the font Reference the font-family in your stylesheet I might be missing something... Why are you trying to build FOP. I can't speck for the developers, but I am assuming FOP was designed in such a way that you use fonts regardless of language, country etc... And you don't have to rebuild FOP to do so. Rob -Original Message- From: Sanket Desai [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 26, 2004 10:45 AM To: [EMAIL PROTECTED] Subject: Re: Help required for Japanese FOP Hi Balaji, Your artical is very informative. Thanks for it. I referred to your artical. But, I am still facing problems. Bascially, my problem is related to building FOP with Japanese support (MSGothic) fonts. As per my previous mail, I generated font metrics file. But in that so many parameters are missing. For example class-name, embedFileName, embedResourceFile etc.. This thing I came to know when I looked into the MSGothic.java file. Apart from this, there are other parameters (actually variables in MSGothic.java file) like lastChar, firstChar are also not initialized. So, it is basically problem of generated wrong .java file (i.e. MSGothic.java). I don't know from where will I get resource file and values for these parameters. So, if you can guide me then I will be very thankful to you. I hope you can understand my problem. thanks, Sanket. On Tue, 26 Oct 2004 06:26:53 +1000 (EST), Balaji Loganathan [EMAIL PROTECTED] wrote: Hi Sanket, See whether this article helps you ?? http://www.javaranch.com/journal/200409/Journal200409.jsp#a9 --- John Mok [EMAIL PROTECTED] wrote: Sanket Desai wrote: Hi John Mok, Thanks for your reply. I tried to make font metrics for MSGothic fonts. I used msgothic.ttf (It is TTF and not TTC). That generated msgothic.xml also. But when I tried to build the whole FOP, I came to know that class for MSGothic doesn't have any name. If you succeeded to generated the font metrics file, e.g. msgothic.xml or any name you like, then you have to register the font metrics file in a config. file referenced by your application or servlet, e.g. the a config file at /usr/local/fop-0.20.5/userconfig.xml, in which you build
Rodolfo: FOP With Hebrew
Hi Rodolfo, I read your thread http://marc.theaimsgroup.com/?l=fop-userm=106547256430537w=2 , Will it be possible for you tell us what chanages you did on the Custom FOP. I am using Naqsh.ttf for arabic but characters appear reversed, so i used xsl to reverse the character and generate the PDF. I stated it here http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topicf=31t=004373 Thank you. Regards Balaji Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help required for Japanese FOP
Hi Sanket, See whether this article helps you ?? http://www.javaranch.com/journal/200409/Journal200409.jsp#a9 --- John Mok [EMAIL PROTECTED] wrote: Sanket Desai wrote: Hi John Mok, Thanks for your reply. I tried to make font metrics for MSGothic fonts. I used msgothic.ttf (It is TTF and not TTC). That generated msgothic.xml also. But when I tried to build the whole FOP, I came to know that class for MSGothic doesn't have any name. If you succeeded to generated the font metrics file, e.g. msgothic.xml or any name you like, then you have to register the font metrics file in a config. file referenced by your application or servlet, e.g. the a config file at /usr/local/fop-0.20.5/userconfig.xml, in which you build the mappings for font MSGothic in reference to the font metrics file. Please refer to the section Register Fonts with FOP at :- http://xml.apache.org/fop/fonts.html For further details, please find the program examples in the FOP package. John Mok - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSLT transformation to PDF, Chinese characters lost
Mike, This article would help you. http://www.javaranch.com/journal/200409/Journal200409.jsp#a9 = Creating Multiple Language PDF using Apache FOP. Regards Balaji --- Jeremias Maerki [EMAIL PROTECTED] wrote: On 23.09.2004 20:58:08 Mike J Boyersmith wrote: On 23.09.2004 20:24:22 Mike J Boyersmith wrote: Problem: generated PDF file shows '#' characters instead of Chinese characters. As you probably found out yourself, this here applies: http://xml.apache.org/fop/faq.html#pdf-characters yup saw that, I found the FOP examples to... but not One of them shows how to do a end to end walk through of dealing with language/i18n type issues :(. That would be a great addition to the examples collection. You could write that for us when you've got it working. It's the cool thing about Open Source: Everybody can help. :-) snip/ This all works great BUT!! The problem is that on Chinese if I have text that has Chinese characters they are replaced with '#' characters, and I can figure no way around this…. So. Digging around I see that I need to embed fonts, but How do I do this programmatically? Create the font metrics XML for your TrueType fonts as described here: http://xml.apache.org/fop/fonts.html Then use the userconfig.xml as described here: http://xml.apache.org/fop/embedding.html#config-external It's probably best to try on the command-line first and then port the whole thing into Java How do I do this so it works on Windows and Linux? Don't worry about that. It works the same way on both platforms. That's because FOP uses its own font subsystem for PDF and PS output. Would be nice if I could just specify font-family, and it would all work, but guess I'm dreaming. will try walking through the problem from the command line as you suggested. No dreaming, that's the plan. It just didn't happen, yet. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bug ?
Just accidently, if i have a fo:block before fo:table-cell, then I'm getting the error java.lang.ClassCastException org.apache.fop.apps.FOPException: java.lang.ClassCastException at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:111) The sample code is here.. fo:table table-layout=fixed inline-progression-dimension=auto border=0.015mm solid black fo:table-column column-width=87mm/ fo:table-column column-width=87mm/ fo:table-body fo:table-row height=10mm fo:table-cell border-right-style=solid border-right-width=0.015mm fo:blockRow1 column1/fo:block /fo:table-cell fo:blockRow1 column2/fo:block fo:table-cell /fo:table-cell /fo:table-row /fo:table-body /fo:table http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bug ?
Yes!.. I very well know the below xsl:fo is wrong. But was just wondering why its throwing Classcast exception and thats the reason i posted it. --- Chris Bowditch [EMAIL PROTECTED] wrote: Balaji Loganathan wrote: Just accidently, if i have a fo:block before fo:table-cell, then I'm getting the error Your XSL-FO is not valid. fo:block is not allowed in the middle of a table. FOP should exit more gracefully with a message saying that the block is in the wrong place. This is the sort of thing that will be addressed in the redesign effort. fo:table-cell border-right-style=solid border-right-width=0.015mm fo:blockRow1 column1/fo:block /fo:table-cell fo:blockRow1 column2/fo:block fo:table-cell /fo:table-cell Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
: fo:table
Hi, Let me try to put my question again clearly!. Please see the attached image, thats the layout I'm trying to create in FOP. Now this can be done in two ways 1.By creating a single table with 5 rows, then each ROW will a contain a table of 3 to 5 columns in its own. 2.By creating 5 seperate tables. Each table will have 1 row with 3 to 5 columns in its own. Which is best option in terms of speed, because I'm using the first option and its very slow. I'm asking this question , because in a HTML browsers, a HTML table will be displayed only if the complete table is loaded into the browser buffer. I would like to how this is done in FOP ? Please help me. Regards Balaji http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile.inline: table1.gif- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: table
Hi Rob, Thanks for taking time to reply me.My question was bit different than to your specific reply, and I re-posted it again. Thanks again. Regards Balaji --- Rob Stote [EMAIL PROTECTED] wrote: Balaji I did a quick test, I never nest tables, as a personal preference, easy to debug, read etc. FOP does say that the numbers produced from their debug statements should not be used comparatively. Hope this helps: File attached RESULTS FOR CALLED TABLES: 703 [main] DEBUG RenderPDF - Avg render time: 328ms/page 640 [main] DEBUG RenderPDF - Avg render time: 289ms/page 703 [main] DEBUG RenderPDF - Avg render time: 320ms/page 656 [main] DEBUG RenderPDF - Avg render time: 312ms/page 625 [main] DEBUG RenderPDF - Avg render time: 297ms/page AVRG: 309.2ms/page RESULTS FOR NESTED TABLES: 766 [main] DEBUG RenderPDF - Avg render time: 312ms/page 609 [main] DEBUG RenderPDF - Avg render time: 281ms/page 688 [main] DEBUG RenderPDF - Avg render time: 312ms/page 609 [main] DEBUG RenderPDF - Avg render time: 281ms/page 641 [main] DEBUG RenderPDF - Avg render time: 305ms/page AVRG: 298.2ms/page I hope this is what you are looking for. Rob -Original Message- From: Balaji Loganathan [mailto:[EMAIL PROTECTED] Sent: Monday, March 17, 2003 10:33 AM To: fop Subject: fo:table Hi, which option is better and fast for building a table? 1.Construct one table with 8 rows, 2 columns.(most of the rows have table inside table). 2.Construct 8 individual tables.(then insert table inside table). I hope my question is clear ?? Regards Balaji http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ATTACHMENT part 2 application/octet-stream name=hockeycalledtable.xsl ATTACHMENT part 3 application/octet-stream name=hockey2nested.xsl ATTACHMENT part 4 application/octet-stream name=hockey2nested.xml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
fo:table
Hi, which option is better and fast for building a table? 1.Construct one table with 8 rows, 2 columns.(most of the rows have table inside table). 2.Construct 8 individual tables.(then insert table inside table). I hope my question is clear ?? Regards Balaji http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSL_FO generator
Did you tried driver.setLogger(log); ? --- Gian Piero Bottini [EMAIL PROTECTED] wrote: Hi all Do somebody know how to integrate log4j and fop?? In my project I have 2 log files created with log4j and I would put the fop output in them. The code should be like this.. Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); PatternFormatter formatter = new PatternFormatter( [%{priority}]: %{message}\n%{throwable} ); LogTarget target = null; target = new StreamTarget(System.out, formatter); hierarchy.setDefaultLogTarget(target); log = hierarchy.getLoggerFor(fop); log.setPriority(Priority.INFO); driver.setLogger(?? ) but what do I have to put instead of '??' ? Thanks a lot and sorry for my poor english and my ignorance Gian Piero - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's Day. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: arial font
Its depends on what sort of characters you want to display, for example for french, russian characters needs a different font than the default one. Regards Balaji --- MARTIN Franck [EMAIL PROTECTED] wrote: What font can be used with fop? Does the arial font work fine with FOP? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://movies.yahoo.com.au - Yahoo! Movies - What's on at your local cinema? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating own font file
Hi, I'm involved in displaying some mathematical/scientific characters like reciprocal per meter, square per meter etc., in PDF and HTML format I can able to display most of them without problem in the browser window with the help of unicode, but some characters were not appearing correctly. So I would like know how to create my own unicode font file For example: # x207b; == superscript minus symbol # x2126; == Ohm symbol Can anyone tell me how to create my own unicode font file, any reference or links could be really appreciated. Regards Balaji http://movies.yahoo.com.au - Yahoo! Movies - What's on at your local cinema? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: arial font
To my knowledge you don't need any special font for the french character, just try to find the equivalent unicode for the french characters like é à .. from the http://www.unicode.org and the replace these character with their unicode. The another trick is using Editor which supports unicode(XMLSPY does) as your XML editor, in this can you don't need to replace the french characters with unicode representation. XMLSPY will take care of this. Regards Balaji --- MARTIN Franck [EMAIL PROTECTED] wrote: I want to use french characters. what is the default font? - Original Message - From: Balaji Loganathan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 21, 2003 5:08 PM Subject: Re: arial font Its depends on what sort of characters you want to display, for example for french, russian characters needs a different font than the default one. Regards Balaji --- MARTIN Franck [EMAIL PROTECTED] wrote: What font can be used with fop? Does the arial font work fine with FOP? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://movies.yahoo.com.au - Yahoo! Movies - What's on at your local cinema? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://movies.yahoo.com.au - Yahoo! Movies - What's on at your local cinema? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using FOP on a ASP.NET server to convert FO to PDF
Hi, Did u able to install Tomcat with IIS.if so then integrating FOP with .NET server is easy. My suggestion is , 1.Try to install Tomcat and run some sample servlet examples. 2.Try to configure FOP with Tomcat so that u can run the FopServlet(a sample servlet which convert FO/XSL to pdf)from the browser. 3.Try to configure Tomcat with IIS 4.Then u can do the same with .NET server. Documentation/steps/guidelines are available from Tomcat,FOP packages. Just give another try.It will work. Rgds Balaji http://www.sold.com.au - SOLD.com.au - Find yourself a bargain!
Re: Again out of Memory Error -2
My xsl snippet. xsl:template match=/ fo:root fo:layout-master-set ... /fo:layout-master-set fo:page-sequence master-reference=... fo:static-content ... fo:static-content fo:flow !-- Table start -- !-- Table header -- xsl:for-each select=codetest/detail !-- Table rows -- xsl:value-of select=group/ ... .. /xsl:for-each !-- Table end -- /fo:flow /fo:page-sequence /fo:root /xsl:template my Xml snippet: codetest detail group/ id/ sector/ quantity/ level/ . . ANSI/ /detail /codetest Please give me some tips on going for multiple page sequence.I'm having 1488 rows. --- Cyril Rognon [EMAIL PROTECTED] wrote: I suppose you are using FOP 0.20.3... Do you use as many page sequences as you can ? Long tables and long page sequences are known to increase the memory requierments of FOP. error has nothing to do with xml. Xsl could be used to create additionnal page sequences. List Archive shows you how. http://www.sold.com.au - The Sold.com.au Big Brand Sale - New PCs, notebooks, digital cameras, phones and more ... Sale ends June 12
Re: Again out of Memory Error -2
Hi Cyril, Thanks a lot for replying. I'm using Tomcat 3.2,so I think there shd be someway to imporve JVM heap size. Now I understood the multiple page sequence advantage.I tried to change my to have XSLT to print 20 rows at a time,still coding/re-coding my XSLT to get a good result and not yet completed. Since this is a one-off job,I converted my large XML data to HTML,then I converted HTML to PDF using Adobe distiller.So the task is done,but I'm half baked now with my XSLT code. Thanks a lot for replying me at right time. Regards Balaji --- Cyril Rognon [EMAIL PROTECTED] wrote: Ok I'll try to answer both part 1 and 2 here : as for the JVM memory parameter with servlet engines : Your servlet engine is executed in a JVM that must allow you to set memory parameters. I don't know about every ServletEngine or ApplicationServers but you can do this with Tomcat or Websphere so I guess it exists everywhere. As for multiple page sequences, it is simply a fact that the current FOP implementation seems to keep a whole page sequence in memory before it writes it down. So the biggest bage sequence you have, the more heap size you need. Therefore it can be helpfull to create separate page sequence anytime you can. In your case, it is the worst situation : one long table. You have to start and stop the table each time you want to change page-sequence. Some guy on the list had the same situation to deal with. He manage to have an average number of x row per pages. Then he twisted his XSLT stylesheet to take x rowData (detail element in your case) to build one page sequence containing one table with the x rows and so on. He has ended with a 97 page-sequence document. This may be a little extreme but it works. The archive pointer I gave you does this trick. In many case, you have to deal with many tables wich are not always 100 pages long then you can place page-sequences every time you know you can have a page break. I hope this helps. Cyril http://www.sold.com.au - The Sold.com.au Big Brand Sale - New PCs, notebooks, digital cameras, phones and more ... Sale ends June 12
Again out of Memory Error
Hi, Recently many people were discussing abt avoiding out of memory error,I read previous threads but couldn't able to find solution for me. Is this error related to Number of pages or input xml size.Because i have a xml with 1588 group of element,which i have to render into PDF in table format.I can minimize the page size by reducing the font size.At present its generating upto 51 pages then it throwing out of memory error. Some constraints.. 1.I have to embedd a new font called Arial UniCode MS(the ttf file size is 23mb) for Unicodes. 2.in xsl:for loop,i have used xsl:choose with 15 xsl:when's. So is the error is related to XML file size or number of pdfpages or xsl coding style. ?? I can send xslxml personally if needed to avoid unnecessary bulking. Please suggests. Regards Balaji http://www.sold.com.au - The Sold.com.au Big Brand Sale - New PCs, notebooks, digital cameras, phones and more ... Sale ends June 12
RE: Rookie Question
Hi, You can visit this link,where I have asked the similiar question.http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topicf=31t=002274 I hope I'm not redirecting you to another forum. Regards Balaji --- Roland Neilands [EMAIL PROTECTED] wrote: My web application needs to generate a variety of client forms. These are typical boilerplate forms, but are customized by having the client information printed in it. From what I gather from reading the various literature it sounds like the following steps need to be performed: 1. create a boilerplate XML file (non-FO) that has all of the static text. 2. at runtime modify this XML file to insert the custom text (e.g., client name) 3. transform the XML file to XSL-FO 4. send the resultant XSL-FO file to FOP Is this correct, or am I taking the scenic route here? Pointers to examples would be most appreciated. Everything I've seen so far has been purely static text. That's the basic idea. The static text can go into the form stylesheet (.xsl file) or the xml depending how often you will update it. Dynamic stuff should all be put into the xml. FOP can transform directly from xml/xsl if you like, skipping the FO step. Look in: docs\examples\markers for a basic xml/xsl example, but in the .xsl you may need to change: fo:page-sequence-master master-name ... to fo:page-sequence-master master-reference ... for it to work. Regards, Roland http://briefcase.yahoo.com.au - Yahoo! Briefcase - Save your important files online for easy access!
Another step-by-step Multiple Language/font support.
Hi, This thread may be reduntant,but I felt may be useful for newbies.. This thread will give you some tips on supporting multiple language/fonts. 1.Create a Language resource XML. Lang.xml example ?xml version=1.0 encoding=UTF-8? Lang en textHello World! Cooperate/text fontnameCourier/fontname /en fr textHallo Welt!coopére/text fontnameFrenchTTF/fontname /fr jp/ ch/ /Lang 2.Locate font. For english u don't need to find extra fonts unless u need more style. For other languages,u need to find either a truetype or type1 font For example for Arabic u can use the truetype (Iqraa.ttf)font downloadble at http://www7.bev.net/civic/icb/ICB_Arabic.html Store this in your system say at C:\myfonts\ or somewhere. Note:You have to explicitly tell to FOP to use particular font for rendering other language datas,otherwise a ? mark appear. 3.Now read the document at docs\html-docs\fonts.html in your FOP installation carefully. This document will tell how to add,embedd a new true type font. For example: a.java org.apache.fop.fonts.apps.TTFReader C:\myfonts\Iqraa.ttf Iqraa.xml b.Change your userconfig.xml file font metrics-file=Iqraa.xml kerning=yes embed-file=C:\myfonts\Iqraa.ttf font-triplet name=Iqraa style=normal weight=normal /font c.run fop with option -c 4.Now In ur XSL file,try to import particular language data and store it in a XSL variable For example the below code will store the fr\text data in a variable called message. xsl:variable name=message select=document('Lang.xml')/Lang/fr/text/ xsl:variable name=font select=document('Lang.xml')/Lang/fr/fontname/ 5.Now use this in fo:block like this fo:block font-family={$font}xsl:value-of select=$message//fo:block Thats it. 1.With some xsl tricks u can make everything dynamic without hardcoding any part. for example arabic font starts at rightend can be made dynamic by supplying some tags in Lang.xml Now the question is UNICODE.Use XMLSPY to edit ur Lang.xml,for example for japanese version of Hello world go to http://www.babylon.com/ copy and paste the japanese word into ur Lang.xml, XMLSPY will take care of encoding.Sorry for this temp solution,just to avoid finding each and every unicode eqvt of other language literals.Any drawbacks? Please comment if i have made some mistake or hard code. Regards balaji http://briefcase.yahoo.com.au - Yahoo! Briefcase - Save your important files online for easy access!
Supplying options in servlet
Hi, I'm trying to supply the option file userconfig.xml to the servlet.In command line we give it as fop -c userconfig.xml -xsl -xml -pdf But how we can supply this servlet.?This i'm trying for adding addtional font. I tried to use the Options class but didn't succeeded.Below is FopServlet snippet,. - File userConfigFile = new File(userconfig.xml); options = new Options(userConfigFile); Driver driver = new Driver(foFile, out); driver.setLogger(log); driver.setRenderer(Driver.RENDER_PDF); driver.getRenderer().setOptions(options); ?? -- Please correct me. Regards Balaji. http://briefcase.yahoo.com.au - Yahoo! Briefcase - Save your important files online for easy access!
Re: Supplying options in servlet
Hi Tkachenko, Thanks and thanks a lot,it works for me. I just added the line Options options = new Options(new File(userconfig.xml)); before initializing Driver object in my servlet.Now I can easily support multiple languages without worrying abt Unicode.Arabic and Japenese worked for.Of course I'm NOT hard coding.I'm supplying the app language in a seperate XML file. Actually I placed all my fo,xsl,xml,userconfig.xml,.ttf etc in Tomcat/bin folder as it was the default folder that Servlet/Jsp is looking for reading and writing file,Is there is anyway to configure my Web.xml so that i make my servlet/JSP to read/write at different location. Thanks again. Regards Balaji --- Oleg Tkachenko [EMAIL PROTECTED] wrote: Balaji Loganathan wrote: I'm trying to supply the option file userconfig.xml to the servlet.In command line we give it as fop -c userconfig.xml -xsl -xml -pdf But how we can supply this servlet.?This i'm trying for adding addtional font. I tried to use the Options class but didn't succeeded.Below is FopServlet snippet,. - File userConfigFile = new File(userconfig.xml); You probably have to provide full path to the file. In a servlet you can parametrize it as follows: Options options = new Options( new File(getServletConfig().getInitParameter(fop-config))); having in web.xml init-param param-namefop-config/param-name param-valued:/fop/fop-0.20.3/conf/userconfig.xml/param-value /init-param options = new Options(userConfigFile); That's it. You have added options this way. See http://marc.theaimsgroup.com/?l=fop-userm=101481390006348w=2 -- Oleg Tkachenko Multiconn International, Israel http://briefcase.yahoo.com.au - Yahoo! Briefcase - Save your important files online for easy access!
Re: Passing XSLT parameters to FOP (old topic I know)
Thanks for reply again,Yes it working now!I think i might have slept before. Regards Balaji --- Oleg Tkachenko [EMAIL PROTECTED] wrote: Balaji Loganathan wrote: Sorry Dutta, Its not working its giving error Element type fo:block must be followed by either attribute specifications, or /. Check syntax again. You probably omitted some or . -- Oleg Tkachenko Multiconn International, Israel http://briefcase.yahoo.com.au - Yahoo! Briefcase - Save your important files online for easy access!
Re: XSL-FO for HTML and PDF
I think you can do that by using a decalring global varibale set to HTML or PDF,then you can write some thing like if variable is HTML .. Write HTML XSL else Write PDF XSL Bad idea !! ?? Its better to go for two xsl than doing this. --- Mark Jiang [EMAIL PROTECTED] wrote: Hi All, We have a xml file and a xsl style sheet to render HTML. We would like to take the same xml file to render PS file. Is it possible to use one XSL-FO style sheet to render HTML and PS file? If the style sheet needs to be changed, can we only change one style sheet to output HTML and PS file? Thanks, Mark http://briefcase.yahoo.com.au - Yahoo! Briefcase - Save your important files online for easy access!
Re: AW: Open and print pdf files
Apart From Chaumette Patrick idea,have you tried the FOPPrintServlet.java example from FOP,it works good for me.I tested only in Windows Envt.Of course it depends whether u use Servlet/JSP. Regards Balaji --- Chaumette, Patrick [EMAIL PROTECTED] wrote: Hello Franck, on WinNT you can directly send PostScript to a printer with something like this: byte[] psByteArray = ... produced from FOP, a PostScript byte Array File printerFile = new File(ntservername\\printername); FileOutputStream os = new FileOutputStream(file); os.write(psByteArray); os.close(); Actually we are currently exactly doing this. Your printer has to be PostScript capable. On Unix maybe one has just to open the printer queue, don't know. PDF Printing directly to a printer works only if the printer knows how to interpret pdf (sure an expensive printer, don't know which supports this currently) or you will have to convert PDF to PostScript with some tool. Hope this helps, greetings, Patrick Dipl. Inform. Patrick Chaumette T-Systems ITS GmbH Service Prozesse Retail Hausanschrift: Fasanenweg 9, 70771 Leinfelden-Echterdingen Postanschrift: Postfach 100258, 70746 Leinfelden-Echterdingen Telefon: (0711)972-2437 Telefax: (0711)972-1949 E-Mail: [EMAIL PROTECTED] Internet: http://www.t-systems.de -Ursprüngliche Nachricht- Von: MARTIN Franck [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 16. Mai 2002 09:50 An: [EMAIL PROTECTED] Betreff: Open and print pdf files Hi all, Fop is cool but once i have successfully created my pdf file it would be nice to open and print it. Does anyone know of a platform independent way to open a pdf file. So far the only way i have found is platform dependent ( for NT : Runtime.getRuntime().exec(cmd /c start +txtPdf.getText()); ). I was thinking that if java provided a way to display an active http link it would be easy to open a pdf file via the default web browser. What do you think? Does anyone know how to send either ps or pdf directly to the printer (or via a print dialog)? Thank you for your help Franck http://briefcase.yahoo.com.au - Yahoo! Briefcase - Save your important files online for easy access!
HTM Sevlet
Hi, I tried FopServlet example and its works fine for PDF. Is it possible to do the same for HTML that is http://servername/servlet/FopServlet?xml=data.xmlxsl=format.xsldummy=test.html ,I tried to change the code of FopServlet like .. response.setContentType(text/html); Driver driver = new Driver(foFile, out); driver.setLogger(log); driver.setRenderer(Driver.RENDER_TXT); ... But I'm getting unknown formaating object HTML as error. Have any one tried it? Basically I want to convert XML to PDF or HTML using servlets.Do I have to write my own code,or is there out something. Please comments. Regards Balaji http://messenger.yahoo.com.au - Yahoo! Messenger - A great way to communicate long-distance for FREE!
Re: HTM Sevlet
Thanks for your reply,I never tried Cocoon,will try it. Regards Balaji. --- Alex McLintock [EMAIL PROTECTED] wrote: Hello, I'm not sure what you are asking but I think you ought to investigate Cocoon. Cocoon is a general purpose web application (ie servlet :-) which uses Apache XML and XSL technology including FOP to generate html or PDF on demand from XML source. Alex At 11:31 10/05/2002, Balaji Loganathan wrote: Hi, I tried FopServlet example and its works fine for PDF. Is it possible to do the same for HTML that is http://servername/servlet/FopServlet?xml=data.xmlxsl=format.xsldummy=test.html ,I tried to change the code of FopServlet like .. response.setContentType(text/html); Driver driver = new Driver(foFile, out); driver.setLogger(log); driver.setRenderer(Driver.RENDER_TXT); ... But I'm getting unknown formaating object HTML as error. Have any one tried it? Basically I want to convert XML to PDF or HTML using servlets.Do I have to write my own code,or is there out something. Please comments. Regards Balaji http://messenger.yahoo.com.au - Yahoo! Messenger - A great way to communicate long-distance for FREE! Openweb Analysts Ltd, London: Software For Complex Websites http://www.OWAL.co.uk/ Free Consultancy for London Companies thinking of Open Source Software. http://messenger.yahoo.com.au - Yahoo! Messenger - A great way to communicate long-distance for FREE!
Re: step-by-step instructions how to print Chinese in PDF?
Nice reply :) --- J.Pietschmann [EMAIL PROTECTED] wrote: Argyn Kuketayev wrote: I don't see anything about Chinese letters in font metrics xml files. Btw, I don't speak Chinese :) I can't change locale or regional settings on the PC due to deployment restrictions. What glyphs are for Chinese? I'm using UTF-8 encoding. You are supposed to try a *bit* harder. The Unicode consortium http://www.unicode.org is responsible for allocating character codes. The have a sort of character names index online http://www.unicode.org/charts/charindex.html You'll have to search this, or by The Unicode Book http://www.amazon.com/exec/obidos/ASIN/0201616335/ and look up character codes which you need. I don't speak chinese, nor do I have any chinese fonts on my computer, I can't help you any further on this particular problem. Once you know which Unicode codepoints you are going to use, locate a font. Look into you Windows Font directory, or, better, use the character table utility. The character table utility will tell you for the selected fonts whether it is a unicode font, and if so, you can pick a character and get the Unicode code point. After you've located a font, check with the font directory to get the windows file name. It should be a TrueType font file ending in .ttf. Follow the instructions in docs/html-docs/fonts.html to generate a font metrics file and register the font with FOP. You'll have to do this yourself. Prepare a FO document with some characters you think should be chinese script, and run it through FOP. It is possible that you are required to explicitely select the font with the proper glyphs. If you see sharp signs ('#') where you expect the chinese script to be this means you've screwed up somewhere. J.Pietschmann http://messenger.yahoo.com.au - Yahoo! Messenger - A great way to communicate long-distance for FREE!
import/include
Hi, Ofcourse this is a XSL question.Does using import/include increases the processing speed. I'm using Xalan and Fop. I tried importing a xsl with 43 variables instead of declaring them inside the main xsl.I didn't see any processing speed difference,I used my stop watch :-) to chk it. Regards Balaji. http://messenger.yahoo.com.au - Yahoo! Messenger - A great way to communicate long-distance for FREE!
Best coding practice.
Hi, Is there is any best practice for coding the XSL:FO, that is always 1. use xsl:template 2. check whether the element exist or not even for mandatory elements. My xsl is of 578 lines,Suddenly i felt that my code is not object oriented beacuse no where i have used xsl:template. I construct the PDF line after line.Does this affect the processing speed. Does using xsl:template increases the processing speed. Please comment. Regards Balaji http://messenger.yahoo.com.au - Yahoo! Messenger - A great way to communicate long-distance for FREE!
Re: How to draw a border
Hi Marthin, There are some examples available from www.xrenderer.com tutorial for this.but i'm using fop to run that examples. Regards Balaji --- MARTIN Franck [EMAIL PROTECTED] wrote: I can't figure how to draw a border around a word that is embedded in a sentence. Does anyone have an idea? That would help me very much indeed! Thank you Franck MARTIN http://movies.yahoo.com.au - Yahoo! Movies - Vote for your nominees in our online Oscars pool.
Printing Problem,
Hi, Please look at the below program and especially margin settings of body and table. If I print this out in HP printer,Lexmark printer and if I measure the paper output with a Millimeter scale or ruler.The margins all sides seems to vary by plus or minus 2-6 mm with HP printer and Lexmark.Even if I compare my printer output with the original paper document in SUNLIGHT,its varying. If this is the case how can we assure that we can produce the exact Paper document with PDF using XSL:fo which is printer portable. ?? Is PDF is printer portable ? Please advice me where i'm going wrong. Regards Balaji Code start: fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=currency-page page-width=210mm page-height=297mm fo:region-body margin-top=10mm margin-bottom=7mm margin-left=20mm margin-right=7mm / fo:region-start/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=currency-page fo:static-content flow-name=xsl-region-start fo:block font-size=3mmtext-align=startSome text will go here later /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:table border=0.015mm solid black fo:table-column column-width=183mm/ fo:table-body fo:table-row height=280mm fo:table-cellfo:blockA border with,10,7,20,7mm/fo:block /fo:table-cell /fo:table-row /fo:table-body /fo:table /fo:flow /fo:page-sequence /fo:root Code end: http://movies.yahoo.com.au - Yahoo! Movies - Vote for your nominees in our online Oscars pool.