RE: Relative font path in config file
OK, that might work. -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: February 19, 2008 12:21 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Relative font path in config file Either you have to make sure FOP can find the fonts relative to your input file (the XML), or you can try using . as the value for the font-base setting. That doesn't make it relative to the FOP installation (because we don't have a reliable way of determining that) but relative to the current directory of the current process. On 18.02.2008 19:08:07 Glenn Brand wrote: Thanks, We are calling fop from the command line. Is there any way to make it work that way? c:\cachesys\csp\nea\Plugins\fop-0.94\fop.bat -log c:\cachesys\csp\nea\ExamLabel.log -c c:\cachesys\csp\nea\Plugins\fop-0.94\conf\fop.xml -xml c:\cachesys\csp\nea\ExamLabel.xml -xsl c:\cachesys\csp\nea\ExamLabel.xslt -pdf c:\cachesys\csp\nea\ExamLabel.pdf -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: February 18, 2008 12:21 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Relative font path in config file Patience, please. Posting your question once is usually sufficient. It was just the weekend in between. ;-) You can simply use relative filenames, i.e.: font metrics-url=arial.xml kerning=yes embed-url=arial.ttf font-triplet name=Arial weight=normal style=normal/ /font For this to work, you need to set the font base URI/URL. This can be done in the configuration file using the font-base element. See here: http://xmlgraphics.apache.org/fop/stable/configuration.html But that leaves you with the same problem, so you should probably rather use the FopFactory.setFontBaseURL(String) method in your code instead of using the font-base setting in the config file. http://xmlgraphics.apache.org/fop/0.94/embedding.html#fop-factory On 15.02.2008 20:23:43 Glenn Brand wrote: How do I make the path in the config file relative to where fop is installed. I want to put our fonts in a directory with fop. We are doing this right now but the target directory changes at times and we want the installer to be able to install without writing the path into the config file. font metrics-url=file:///c:/ODProfessional/Fonts/arial.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arial.ttf font-triplet name=Arial weight=normal style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/arialbd.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arialbd.ttf font-triplet name=Arial weight=bold style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/ariali.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/ariali.ttf font-triplet name=Arial weight=normal style=italic/ /font Jeremias Maerki Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Relative font path in config file
Thanks, We are calling fop from the command line. Is there any way to make it work that way? c:\cachesys\csp\nea\Plugins\fop-0.94\fop.bat -log c:\cachesys\csp\nea\ExamLabel.log -c c:\cachesys\csp\nea\Plugins\fop-0.94\conf\fop.xml -xml c:\cachesys\csp\nea\ExamLabel.xml -xsl c:\cachesys\csp\nea\ExamLabel.xslt -pdf c:\cachesys\csp\nea\ExamLabel.pdf -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: February 18, 2008 12:21 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Relative font path in config file Patience, please. Posting your question once is usually sufficient. It was just the weekend in between. ;-) You can simply use relative filenames, i.e.: font metrics-url=arial.xml kerning=yes embed-url=arial.ttf font-triplet name=Arial weight=normal style=normal/ /font For this to work, you need to set the font base URI/URL. This can be done in the configuration file using the font-base element. See here: http://xmlgraphics.apache.org/fop/stable/configuration.html But that leaves you with the same problem, so you should probably rather use the FopFactory.setFontBaseURL(String) method in your code instead of using the font-base setting in the config file. http://xmlgraphics.apache.org/fop/0.94/embedding.html#fop-factory On 15.02.2008 20:23:43 Glenn Brand wrote: How do I make the path in the config file relative to where fop is installed. I want to put our fonts in a directory with fop. We are doing this right now but the target directory changes at times and we want the installer to be able to install without writing the path into the config file. font metrics-url=file:///c:/ODProfessional/Fonts/arial.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arial.ttf font-triplet name=Arial weight=normal style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/arialbd.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arialbd.ttf font-triplet name=Arial weight=bold style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/ariali.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/ariali.ttf font-triplet name=Arial weight=normal style=italic/ /font Jeremias Maerki - 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]
Need to set a Relative font path in config file
How do I make the path in the config file relative to where fop is installed. I want to put our fonts in a directory with fop. We are doing this right now but the target directory changes at times and we want the installer to be able to install without writing the path into the config file. font metrics-url=file:///c:/ODProfessional/Fonts/arial.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arial.ttf font-triplet name=Arial weight=normal style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/arialbd.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arialbd.ttf font-triplet name=Arial weight=bold style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/ariali.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/ariali.ttf font-triplet name=Arial weight=normal style=italic/ /font
Need to set a Relative font path in config file
How do I make the path in the config file relative to where fop is installed. I want to put our fonts in a directory with fop. We are doing this right now but the target directory changes at times and we want the installer to be able to install without writing the path into the config file. font metrics-url=file:///c:/ODProfessional/Fonts/arial.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arial.ttf font-triplet name=Arial weight=normal style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/arialbd.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arialbd.ttf font-triplet name=Arial weight=bold style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/ariali.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/ariali.ttf font-triplet name=Arial weight=normal style=italic/ /font
Relative font path in config file
How do I make the path in the config file relative to where fop is installed. I want to put our fonts in a directory with fop. We are doing this right now but the target directory changes at times and we want the installer to be able to install without writing the path into the config file. font metrics-url=file:///c:/ODProfessional/Fonts/arial.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arial.ttf font-triplet name=Arial weight=normal style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/arialbd.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/arialbd.ttf font-triplet name=Arial weight=bold style=normal/ /font font metrics-url=file:///c:/ODProfessional/Fonts/ariali.xml kerning=yes embed-url=file:///c:/ODProfessional/Fonts/ariali.ttf font-triplet name=Arial weight=normal style=italic/ /font
RE: Padding between rows
Yes that worked great. Thank you for the timely response. From: Manuel Mall [mailto:[EMAIL PROTECTED] Sent: February 6, 2008 6:05 PM To: 'fop-users@xmlgraphics.apache.org' Subject: RE: Padding between rows Glenn, You are setting the font-size on an fo:inline element. This means the enclosing fo:block still has the default font-size of 12pt (unless you have set a different font-size on a enclosing element not shown in your snippet). This in turn determines the line height used for the lines in the block. Set the font-size on the enclosing block and it will most likely be fine. Manuel From: Glenn Brand [mailto:[EMAIL PROTECTED] Sent: Thursday, 7 February 2008 10:42 AM To: fop-users@xmlgraphics.apache.org Subject: Padding between rows I have padding set to padding=0pt but I still get a lot of space between rows. See attached PDF. The top of the PDF where it reads: EyeCare Associates, Inc. 3165 Green Valley Road Birmingham, AL 35243 www.webeca.com Phone (205) 967-2103 Fax (205) 967-2119 Should look like the area that reads this: Glenn Brand 6555 Nelson Avenue West Vancouver, AL Primary Insurance Medicare Secondary Insurance I have this for the first area: fo:table-row fo:table-cell border-style=none border-width=0pt padding=0pt background-repeat=no-repeat display-align=center fo:block fo:block fo:inline font-family=Arial font-size=9pt font-weight=bold xsl:value-of select=/Recordset[1]/spPatientStatement[1]/Location_BusinessName[1]/ /fo:inline /fo:block /fo:block /fo:table-cell And this for the next area that I would like the top to be the same. fo:table-row fo:table-cell border-style=none border-width=0pt border-color=transparent background-repeat=repeat display-align=center fo:block font-size=9pt fo:block fo:inline font-family=Arial xsl:value-of select=concat(/Recordset[1]/spPatientStatement[1]/PrimaryFirstname[1],' ',/Recordset[1]/spPatientStatement[1]/PrimaryLastname[1])/ /fo:inline /fo:block fo:block fo:inline font-family=Arial xsl:value-of select=/Recordset[1]/spPatientStatement[1]/PrimaryAddress1[1]/ /fo:inline /fo:block fo:block fo:inline font-family=Arial xsl:value-of select=/Recordset[1]/spPatientStatement[1]/PrimaryAddress2[1]/ /fo:inline /fo:block fo:block fo:inline font-family=Arial xsl:value-of select=concat(/Recordset[1]/spPatientStatement[1]/PrimaryCity[1],', ',/Recordset[1]/spPatientStatement[1]/PrimaryState[1],' ')/ /fo:inline /fo:block fo:block fo:inline font-family=ArialPrimary Insurance xsl:value-of select=/Recordset[1]/spPatientStatement[1]/PrimaryPlanName[1]/ /fo:inline /fo:block fo:block fo:inline font-family=ArialSecondary Insurance xsl:value-of select=/Recordset[1]/spPatientStatement[1]/SecondaryPlanName[1]/ /fo:inline /fo:block /fo:block /fo:table-cell
Need conversion from .20 to .94 for HTML to PDF conversion
I am converting from HTML to XSL-FO and then to fop. If anybody has a good way to do this I would like to know. How do I convert the following fo2PDF method .20 fop calls to .94 fop calls? private static byte[] fo2PDF(Document foDocument) { DocumentInputSource fopInputSource = new DocumentInputSource( foDocument); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); Logger log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN); Driver driver = new Driver(fopInputSource, out); driver.setLogger(log); driver.setRenderer(Driver.RENDER_PDF); driver.run(); return out.toByteArray(); } catch (Exception ex) { return null; } } public static void main(String[] args) { // open file if (args.length != 2) { System.out.println(Usage: Html2Pdf htmlFile styleSheet); System.exit(1); } FileInputStream input = null; String htmlFileName = args[0]; try { input = new FileInputStream(htmlFileName); } catch (java.io.FileNotFoundException e) { System.out.println(File not found: + htmlFileName); } Tidy tidy = new Tidy(); Document xmlDoc = tidy.parseDOM(input, null); Document foDoc = xml2FO(xmlDoc, args[1]); String pdfFileName = htmlFileName.substring(0, htmlFileName.indexOf(.)) + .pdf; String xslFileName = htmlFileName.substring(0, htmlFileName.indexOf(.)) + .fo; writeXmlFile(foDoc,xslFileName); try { OutputStream pdf = new FileOutputStream(new File(pdfFileName)); OutputStream xsl = new FileOutputStream(new File(xslFileName)); pdf.write(fo2PDF(foDoc)); } catch (java.io.FileNotFoundException e) { System.out.println(Error creating PDF: + pdfFileName); } catch (java.io.IOException e) { System.out.println(Error writing PDF: + pdfFileName); } } /* * Applies stylesheet to input. * * @param xml The xml input Document * * @param stylesheet Name of the stylesheet * * @return Document Result of the transform */ private static Document xml2FO(Document xml, String styleSheet) { DOMSource xmlDomSource = new DOMSource(xml); DOMResult domResult = new DOMResult(); Transformer transformer = getTransformer(styleSheet); if (transformer == null) { System.out.println(Error creating transformer for + styleSheet); System.exit(1); } try { transformer.transform(xmlDomSource, domResult); } catch (javax.xml.transform.TransformerException e) { return null; } return (Document) domResult.getNode(); }
RE: Need conversion from .20 to .94 for HTML to PDF conversion
Thanks Andreas, I will take a look. -Original Message- From: Andreas Delmelle [mailto:[EMAIL PROTECTED] Sent: January 24, 2008 11:05 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Need conversion from .20 to .94 for HTML to PDF conversion On Jan 24, 2008, at 10:40, Glenn Brand wrote: Hi I am converting from HTML to XSL-FO and then to fop. If anybody has a good way to do this I would like to know. How do I convert the following fo2PDF method .20 fop calls to .94 fop calls? Maybe I've missed someone's reply on this, but on my side this post still appeared unanswered. This may have its reasons, mind you... ;-) Seriously, browse around some on the FOP website, until you end up on: http://xmlgraphics.apache.org/fop/0.94/embedding.html This should get you started with the conversion. If you run into any particular issues, just yell. HTH! Cheers Andreas - 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]
Changing the top margin
How do we set the top margin to .25 inches or .635 cm. See below. From: Brian Dong Sent: January 7, 2008 4:55 PM To: Glenn Brand; Dennis Ball Subject: RE: Address on new statement Hi Glenn, The problem isn't with the report but with the margins. The top margin needs to be reduced and I can't see where in Stylus Studio this is set or if the PDF driver is setting it. The top margin should be set to .25 inches or .635 cm. Thanks, The Donger From: Glenn Brand Sent: Monday, January 07, 2008 2:10 PM To: Dennis Ball Cc: Brian Dong Subject: RE: Address on new statement Brian can you format the statement so that it will come up in a window envelope? Be careful to keep the existing data access methods intact. I did a lot to solve the problems you and I first saw. From: Dennis Ball Sent: January 7, 2008 8:38 AM To: Glenn Brand Cc: Brian Dong Subject: Address on new statement Hi Glenn, The address needs to be moved up a bit so it will fit correctly for an envelope window as it did previously. NEA mentioned it does not align correctly as it did before. Dennis Ball CHIEF TECHNOLOGY OFFICER OD PROFESSIONAL(tm) 866-367-2899 x 21 604-628-1666 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date: 01/06/2008 10:55 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date: 01/06/2008 10:55 PM
RE: Changing the top margin
Thank you. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: January 7, 2008 5:46 PM To: fop-users@xmlgraphics.apache.org Cc: Brian Dong; Dennis Ball; fop-users@xmlgraphics.apache.org Subject: Re: Changing the top margin Use the margin-top attribute on the page master. For example: fo:simple-page-master master-name=main page-height=278mm page-width=215mm margin-top=0.635cm margin-bottom=5mm margin-left=5mm margin-right=5mm ~~ LOG-NET, Inc. The Logistics Network Management System ~~ 230 Half Mile Road Third Floor Red Bank, NJ 07701 PH: 732-758-6800 FAX: 732-747-7497 http://www.LOG-NET.com ~~ CONFIDENTIAL PRIVILEGED Unless otherwise indicated or if obvious from the nature of the content, the information contained herein is privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. If the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by telephone (732-758-6800) or by electronic mail ([EMAIL PROTECTED]), and destroy any copies, electronic, paper or otherwise, which you may have of this communication. Thank you. ~~ Glenn Brand [EMAIL PROTECTED] 01/07/2008 08:02 PM Please respond to fop-users@xmlgraphics.apache.org To Brian Dong [EMAIL PROTECTED], Dennis Ball [EMAIL PROTECTED], fop-users@xmlgraphics.apache.org cc Subject Changing the top margin How do we set the top margin to .25 inches or .635 cm. See below. From: Brian Dong Sent: January 7, 2008 4:55 PM To: Glenn Brand; Dennis Ball Subject: RE: Address on new statement Hi Glenn, The problem isn’t with the report but with the margins. The top margin needs to be reduced and I can’t see where in Stylus Studio this is set or if the PDF driver is setting it. The top margin should be set to .25 inches or .635 cm. Thanks, The Donger From: Glenn Brand Sent: Monday, January 07, 2008 2:10 PM To: Dennis Ball Cc: Brian Dong Subject: RE: Address on new statement Brian can you format the statement so that it will come up in a window envelope? Be careful to keep the existing data access methods intact. I did a lot to solve the problems you and I first saw. From: Dennis Ball Sent: January 7, 2008 8:38 AM To: Glenn Brand Cc: Brian Dong Subject: Address on new statement Hi Glenn, The address needs to be moved up a bit so it will fit correctly for an envelope window as it did previously. NEA mentioned it does not align correctly as it did before. Dennis Ball CHIEF TECHNOLOGY OFFICER OD PROFESSIONAL™ 866-367-2899 x 21 604-628-1666 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date: 01/06/2008 10:55 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date: 01/06/2008 10:55 PM
RE: Need image to render at higher DPI
Thanks Chris, I am getting better results but the image still comes in bigger than what I specifiy and at the lower DPI. Can you spot the problem from the XSL-FO? fo:table-cell border-style=none border-width=0pt background-repeat=no-repeat display-align=center fo:block fo:block fo:external-graphic background=transparent width=50pt height=50pt src=url(file:///c:/CacheSys/CSP/qacahaba/ODprofessional_logo.gif)/ /fo:block /fo:block /fo:table-cell -Original Message- From: Chris Bowditch [mailto:[EMAIL PROTECTED] Sent: January 4, 2008 2:10 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Need image to render at higher DPI Glenn Brand wrote: I have a graphic that is rendering at a low resolution. See below in the last several lines. How do I get the image to render at a higher resolution? When including an image via fo:external-graphic tag the resolution can be controlled by making the content-width/height smaller so that the pixels are packed more densely. However, you can't set the size of a image included via background-image attribute. In this case I think FOP just assumes a default DPI of 72 DPI. Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Image rendering at higher DPI
That worked great. The next problem is that the resolution is quite low both colors and DPI. What do you suggest? -Original Message- From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] Sent: January 2, 2008 10:54 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Image rendering at position problem On Jan 2, 2008, at 18:58, Glenn Brand wrote: Hi, I am trying to place a graphic (customer logo) to the right of a table at the top of a patient walk out statement of account. When I put the graphic on the style sheet editor (stylus studio2008) it looks correct but when it gets published as XSL-FO and then rendered it is placed underneath the table. How can I get it to go to the right of the table? fo:table width=225pt border-style=none border-width=0pt background-repeat=repeat snip / /fo:table fo:external-graphic background=transparent width=200pt height=200ptsrc=url(file:///c:/CacheSys/CSP/qacahaba/ ODprofessional_logo.gif)/ Correct: a fo:table is a block-level formatting object, and as such triggers implicit line-breaks before and after. To do what you have in mind --keep a table on the same line as a following sibling inline-level FO, like external-graphic-- I think you would need support for either fo:float or fo:inline-container. Neither of these are implemented in FOP at the moment. As a workaround, you could try nesting tables (or put the external- graphic in its own last column in a cell that spans all rows). HTH! Cheers Andreas - 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]