RE: size of images placed using fo:external-graphic
There's only one pointer (i thing). Try to specify width and/or height of fo:external-graphic search list archive http://marc.theaimsgroup.com/?l=fop-devr=1w=2 I look to source code, and IMHO you must modify src/org/apache/fop/images and src/org/apache/fop/images/analyzer classes to suport DPI (extract dpi from file and compute right width/height) Michal -Original Message- From: Ambar Roy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: size of images placed using fo:external-graphic Hi, When I place a image using external-graphic without specifying the size of the image, the image is rendered at a fixed dpi (72 dpi perhaps). This happens even if the file has a method of specifying dpi, like JPG files. Why does this happen? According to the XSL spec, the image should be placed as per the size of the image if content-width and content-height is set to auto. I suppose this is a known bug/feature of fop, or I am misinterpreting the XSL spec. Is it a difficult thing to modify the FOP source to achieve this result. I am using FOP-20.4. Can I expect to do this in a reasonable amount of time? I have experience with java and c++ programming, but I haven't really tried to hack the FOP source. Any pointers? Ambar Roy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: newbie needs help with relative address for image.
Set the BaseDir in userconfig.xml Michal -Original Message- From: Troy Bottger [mailto:[EMAIL PROTECTED]] Sent: Monday, January 28, 2002 2:27 PM To: '[EMAIL PROTECTED]' Subject: newbie needs help with relative address for image. Everything in my XSL/FO is working perfectly except my images. The address I am supplying is a relative address (that works if I use HTML), but does not work if I use XSL/FO to PDF. I have read the archives, and I am not finding any solutions to this problem. Can anyone tell me what I am doing wrong? fo:external-graphic height=24mm width=66mm src={../companylogo/url}/ /companylogo/url gets translated into: abc\images\merchant_logo.gif If I use a full path, ie. (c:\xyz\htdocs\abc\images\mechant_logo.gif) it is fine. It is just when I specify the relative address when I get: Error while creating area : Invalid Image URL - error on relative URL : no protocol: null/abc/images/merchant_logo.gif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Running fop from Java
You MUST use XSL-FO stylesheet to convert XML to PDF with FOP. CSS stylesheet is used to display XML in browser Michal -Original Message- From: Mitchell, Scott(LIT) [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 11:49 AM To: [EMAIL PROTECTED] Subject: RE: Running fop from Java I do not have an xsl file. I am using a .css file. It does not do anything at the minute, I am just trying to get it runnning initially. -Original Message- From: Claus Nielsen [SMTP:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 10:58 AM To: [EMAIL PROTECTED] Subject: RE: Running fop from Java And your xsl ? Claus Nielsen Mitchell, Scott(LIT) To: [EMAIL PROTECTED] S.Mitchell@Liberty cc: -IT.co.ukSubject: RE: Running fop from Java 03-01-2002 11:42 Please respond to fop-dev bean.xml Any help is greatly appreciated, I have only been working on this technology for a few days now. -Original Message- From: Claus Nielsen [SMTP:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 10:45 AM To: [EMAIL PROTECTED] Subject: Re: Running fop from Java How does your XML file look ? Claus Nielsen Mitchell, Scott(LIT) To: [EMAIL PROTECTED] S.Mitchell@Liberty cc: -IT.co.ukSubject: Running fop from Java 03-01-2002 11:32 Please respond to fop-dev Hi, I am trying to use jox to take a java bean and create an xml file. With this file, I use fop to convert to a pdf. I get the following error when running the code. Input XSL; Line 1; Column 1 XSL Error: Could not parse Input XML document! XSL Error: SAX Exception org.apache.xalan.xslt.XSLProcessorException: The markup in the document preceding the root element must be well-formed. at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1630) at org.apache.xalan.xslt.XSLTEngineImpl.getSourceTreeFromInput(XSLTEngineImpl .j ava:852) at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:552) at com.wutka.jox.test.TestSer.main(TestSer.java:82) This is the code, the red line is where the error occurs. public class TestSer { public static void main(String[] args) { try { TestBean b = new TestBean(); b.setFoo(5); b.setBar(This is the bar value); b.setThingies(new String[] { Moe, Larry, Curly, Shemp, Curly Joe }); TestSubbean sub = new TestSubbean(); sub.setName(Mark); sub.setAge(35); b.setSub(sub); FileOutputStream fileOut = new FileOutputStream (f:/ProgramFiles/jox/source/com/wutka/jox/test/bean.xml) ; JOXBeanOutputStream joxOut = new JOXBeanOutputStream(fileOut); joxOut.writeObject(MarkTest, b); joxOut.close(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); Reader stylesheet = null; // Get the XSLT processor XSLTProcessor processor = XSLTProcessorFactory.getProcessor (); // Create the input source Reader responseReader = new StringReader(f:/ProgramFiles/jox/source/com/wutka/jox/test/bean.xml); XSLTInputSource responseSource = new XSLTInputSource(responseReader); // Get the stylesheet String stylesheetPath = ; try { stylesheet = new FileReader(c:/stylesheet.css); } catch (FileNotFoundException fnfe) {} if (stylesheet == null) { stylesheet = new FileReader(c:/stylesheet.css); } XSLTInputSource stylesheetSource = new XSLTInputSource(stylesheet); // Get a target to contain the output Writer formWriter = new StringWriter(); XSLTResultTarget target = new XSLTResultTarget(formWriter); // Transform the XML response to fo format processor.process(responseSource, stylesheetSource, target); // Redirect the fo file from a Writer to a Reader Reader formReader = new StringReader(formWriter.toString()); // Transform from fop to pdf XMLReader xmlReader = new SAXParser(); Driver driver = new Driver();
RE: Fonts
Ok, I use this and it works. I use Tomcat 4.0.1, JDK 1.3.1, Fop 0.20.2 Do you try to use it from command line? It works? And when you run servlet it don't works? In this case, I think, there is an error in servlet when you specify the userconfig.xml file. Good luck :-) --- xsl file xsl:template name=caption fo:block font-size=18pt line-height=20pt font-family=Verdana space-after.optimum=1pt color=black border-bottom=solid 2pt black text-align=start padding-top=0pt font-weight=bold xsl:value-of select=caption/ /fo:block /xsl:template result fo:block font-size=18pt line-height=20pt font-family=Verdana space-after.optimum=1pt color=black border-bottom=solid 2pt black text-align=start padding-top=0pt font-weight=bold SOME TEXT IN VERDANA FONT HERE /fo:block -- this is from userconfig.xml fonts !-- VERDANA -- font metrics-file=c:\xmllib\fonts\verdana.ttf.xml kerning=yes embed-file=c:\xmllib\fonts\verdana.ttf font-triplet name=Verdana style=normal weight=normal/ /font font metrics-file=c:\xmllib\fonts\verdanab.ttf.xml kerning=yes embed-file=c:\xmllib\fonts\verdanab.ttf font-triplet name=Verdana style=normal weight=bold/ /font font metrics-file=c:\xmllib\fonts\verdanai.ttf.xml kerning=yes embed-file=c:\xmllib\fonts\verdanai.ttf font-triplet name=Verdana style=italic weight=normal/ /font font metrics-file=c:\xmllib\fonts\verdanaz.ttf.xml kerning=yes embed-file=c:\xmllib\fonts\verdanaz.ttf font-triplet name=Verdana style=italic weight=bold/ /font /fonts -Original Message- From: Raúl Carazo [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 27, 2001 6:24 PM To: [EMAIL PROTECTED] Subject: RE: Fonts Thanks to all of you, really!! But I'm not using the example. In fact, if I try to use it, everything works, but when I move it to my servlet... It's really strange, because if I set any font, it appears with Times New Roman (the default one), but if I don't set it, it appears with Arial!!! Anyway, thank you! Salve P.S. I send you the right xsl: xsl:attribute-set name=style xsl:attribute name=font-size10pt/xsl:attribute /xsl:attribute-set With this style, the font is Arial If I set this one: xsl:attribute-set name=style xsl:attribute name=font-size10pt/xsl:attribute xsl:attribute name=font-familyVerdana/xsl:attribute xsl:attribute name=font-style/ /xsl:attribute-set (with Verdana or any other font), the font is Times New Roman. And if I set: xsl:attribute-set name=style xsl:attribute name=font-size10pt/xsl:attribute xsl:attribute name=font-familyVerdana/xsl:attribute /xsl:attribute-set there is an exception. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Fonts
You must run Fop -c conf/userconfig.xml in userconfig.xml you must define Verdana font see http://xml.apache.org/fop/fonts.html -Original Message- From: Raúl Carazo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 26, 2001 4:47 PM To: FOP Subject: Fonts Hi everyone upthere I'm trying to change the fonts in a pdf report. I have made the xml-report and I have its xsl file for formatting it on this way: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:attribute-set name=styleParam xsl:attribute name=font-size10pt/xsl:attribute xsl:attribute name=font-familyVerdana/xsl:attribute xsl:attribute name=font-style/ /xsl:attribute-set /xsl:stylesheet But I can't change the font (it appears as TimesNewRoman!!). Where is my mistake (obviously, it HAS to be a mistake... I hope!) Thx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Fonts
font metrics-file=complete Path for the verdana.xml file kerning=yes embed-file=HERE MUST BE COMPLETE PATH TO verdana.ttf i use this font metrics-file=c:\fonts\verdana.ttf.xml kerning=yes embed-file=c:\fonts\verdana.ttf font-triplet name=Verdana style=normal weight=normal/ /font -Original Message- From: Raúl Carazo [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 27, 2001 10:22 AM To: [EMAIL PROTECTED] Subject: RE: Fonts But I'm using it from a servlet. And I do call to the userconfig file. This file contains a line like this: font metrics-file=complete Path for the verdana.xml file kerning=yes embed-file= font-triplet name=Verdana style=normal weight=normal/ /font - Original Message - From: Buchtík, Michal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 27, 2001 10:26 AM Subject: RE: Fonts You must run Fop -c conf/userconfig.xml in userconfig.xml you must define Verdana font see http://xml.apache.org/fop/fonts.html -Original Message- From: Raúl Carazo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 26, 2001 4:47 PM To: FOP Subject: Fonts Hi everyone upthere I'm trying to change the fonts in a pdf report. I have made the xml-report and I have its xsl file for formatting it on this way: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:attribute-set name=styleParam xsl:attribute name=font-size10pt/xsl:attribute xsl:attribute name=font-familyVerdana/xsl:attribute xsl:attribute name=font-style/ /xsl:attribute-set /xsl:stylesheet But I can't change the font (it appears as TimesNewRoman!!). Where is my mistake (obviously, it HAS to be a mistake... I hope!) Thx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Fonts
I update the FopServlet from examples dir. like this . response.setContentType(application/pdf); File userConfigFile = new File(C:/xmllib/conf/userconfig.xml); Options options = new Options(userConfigFile); Driver driver = new Driver(foFile, out); driver.setLogger(log); driver.setRenderer(Driver.RENDER_PDF); driver.run(); ... this works ok. -Original Message- From: Raúl Carazo [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 27, 2001 10:22 AM To: [EMAIL PROTECTED] Subject: RE: Fonts But I'm using it from a servlet. And I do call to the userconfig file. This file contains a line like this: font metrics-file=complete Path for the verdana.xml file kerning=yes embed-file= font-triplet name=Verdana style=normal weight=normal/ /font - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Automatic generation of cell size !
We solve this problem by computing cell-widths in XSLT style sheet. Michal -Original Message- From: Kai Ulrich [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 11:09 AM To: [EMAIL PROTECTED] Subject: Automatic generation of cell size ! My problem ! How can I build a table in a pdf-document whose cell-widths and hights are generated dynamicly depending on the text of the cell ! kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Automatic generation of cell size
It's not universal for all fonts, but we know font which is used and the font-size so we find a longest string in collumn column-width = longest_string_length * avg(charsizes_of_font); -Original Message- From: Matthias Fischer [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 11:56 AM To: [EMAIL PROTECTED] Subject: RE: Automatic generation of cell size What do you mean, you do the computing in XSLT? How do you know how much space a text in a certain font/character size takes, where it breaks etc? Matthias -Original Message- From: Buchtík, Michal [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 11:27 AM To: '[EMAIL PROTECTED]' Subject: RE: Automatic generation of cell size ! We solve this problem by computing cell-widths in XSLT style sheet. Michal -Original Message- From: Kai Ulrich [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 11:09 AM To: [EMAIL PROTECTED] Subject: Automatic generation of cell size ! My problem ! How can I build a table in a pdf-document whose cell-widths and hights are generated dynamicly depending on the text of the cell ! kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]