apache-fop

Remove whitespace/blank spaces in table columns XSL-FO

♀尐吖头ヾ 提交于 2019-12-02 07:34:15
The link has a table in a PDF generated using Apache-FOP. I am unable to remove the blank spaces/empty spaces in the table column headers and column values. The PDF has limitation of 120 characters and thus unable to display all the text. The application does supply the column width. But unsure how to use it in the xsl-fo file Please suggest how to define widths of the table columns to hold only the text and without any blank/unused spaces. Use fo:table-column (see https://www.w3.org/TR/xsl11/#fo_table-column ) and the column-width property to specify the width of each column. For example: <fo

“Content is not allowed in prolog” error yet nothing before XML declaration

本小妞迷上赌 提交于 2019-12-02 01:58:35
First of all I have already exhaustively checked the following questions and this issue does not seem to be the same thing: SAXParseException: Content is not allowed in prolog org.xml.sax.SAXParseException: Content is not allowed in prolog “Content is not allowed in prolog” when parsing perfectly valid XML on GAE Content is not allowed in Prolog SAXParserException These all seem to boil down to 2 things: There is one or more (possibly invisible) chars before the opening <?xml?> tag. There is some byte sequence in the body that does not fit the encoding defined in the <?xml?> tag. Well as for

“Content is not allowed in prolog” error yet nothing before XML declaration

霸气de小男生 提交于 2019-12-02 01:54:13
问题 First of all I have already exhaustively checked the following questions and this issue does not seem to be the same thing: SAXParseException: Content is not allowed in prolog org.xml.sax.SAXParseException: Content is not allowed in prolog “Content is not allowed in prolog” when parsing perfectly valid XML on GAE Content is not allowed in Prolog SAXParserException These all seem to boil down to 2 things: There is one or more (possibly invisible) chars before the opening <?xml?> tag. There is

fo: entity referenced but not declared

我的梦境 提交于 2019-12-02 01:28:22
问题 I am getting the error "entity 0slash was referenced but not declared" whenever I try to convert .fo file to .pdf with apache fop 1.0 I found out you can declare entities in DTD, however, my .fo file has no DTD. Is it supposed to have one? If not, how can I solve this problem? Prefereably without using additional .xsl or whatever files? 回答1: (NOTE: In my answer I'm using the "Oslash" (oh slash) instead of the "0slash" (zero slash) you have in your question. Since you can't begin an entity

Embedding Apache fop 2.1 in java servlet

吃可爱长大的小学妹 提交于 2019-12-01 22:52:38
问题 I have an application that uses Apache FOP to generate PDF files. Everything works great, except Cyrillic letters in the generated PDF. As far as I understand, I am supposed to bundle font that has Cyrillic letters with the application. So, I set the application as follows: I have config file in ../src/main/resources/conf/fop.xml (pretty much default one for PDF renderer) and initialise FOP like this: FopFactoryBuilder fopBuilder = new FopFactoryBuilder(fileLoader.getFile("conf/fop.xml")

Embedding Apache fop 2.1 in java servlet

拟墨画扇 提交于 2019-12-01 19:42:51
I have an application that uses Apache FOP to generate PDF files. Everything works great, except Cyrillic letters in the generated PDF. As far as I understand, I am supposed to bundle font that has Cyrillic letters with the application. So, I set the application as follows: I have config file in ../src/main/resources/conf/fop.xml (pretty much default one for PDF renderer) and initialise FOP like this: FopFactoryBuilder fopBuilder = new FopFactoryBuilder(fileLoader.getFile("conf/fop.xml").toURI(), new ClasspathResolverURIAdapter()); fopFactory = fopBuilder.build(); fileLoader is my own utility

How to dynamically change xslt page-sequence based on node attributes?

﹥>﹥吖頭↗ 提交于 2019-12-01 18:17:12
问题 The watered-down version of the problem I'm having is this. For an XML file like: <?xml version="1.0" encoding="UTF-8"?> <items> <item cols="1">Item 1</item> <item cols="1">Item 2</item> <item cols="1">Item 3</item> <item cols="1">Item 4</item> <item cols="1">Item 5</item> <item cols="1">Item 6</item> <item cols="1">Item 7</item> <item cols="1">Item 8</item> <item cols="1">Item 9</item> <item cols="2">Item 10</item> <item cols="1">Item 11</item> <item cols="1">Item 12</item> <item cols="1"

How to dynamically change xslt page-sequence based on node attributes?

大兔子大兔子 提交于 2019-12-01 18:02:31
The watered-down version of the problem I'm having is this. For an XML file like: <?xml version="1.0" encoding="UTF-8"?> <items> <item cols="1">Item 1</item> <item cols="1">Item 2</item> <item cols="1">Item 3</item> <item cols="1">Item 4</item> <item cols="1">Item 5</item> <item cols="1">Item 6</item> <item cols="1">Item 7</item> <item cols="1">Item 8</item> <item cols="1">Item 9</item> <item cols="2">Item 10</item> <item cols="1">Item 11</item> <item cols="1">Item 12</item> <item cols="1">Item 13</item> <item cols="1">Item 14</item> <item cols="1">Item 15</item> <item cols="1">Item 16</item>

PDF report with embedded HTML

江枫思渺然 提交于 2019-11-30 18:40:31
We have a Java-based system that reads data from a database, merges individual data fields with preset XSL-FO tags and converts the result to PDF with Apache FOP . In XSL-FO format it looks like this: <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE Html [ <!ENTITY nbsp " "> <!-- all other entities --> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" font

Set FopFactoryBuilder baseURI to jar classpath

僤鯓⒐⒋嵵緔 提交于 2019-11-30 09:02:49
问题 I'm upgrading an Apache FOP 1.0 project to Apache FOP 2.1. In this project, all necessary files are packaged within the jar file. I've added the new FopFactoryBuilder to generate a FopFactory FopFactoryBuilder builder = new FopFactoryBuilder(new File(".").toURI()); builder = builder.setConfiguration(config); fopFactory = builder.build(); but all my resouces are loaded from the relative path on my file system, not from the jar. How can I set the baseURI to the jar's classpath? Thanks 回答1: We