apache-fop

How to repeat same template in table-row using XSL-FO/Apache FOP

空扰寡人 提交于 2019-12-11 07:34:21
问题 I'm trying to create a PDF from an XML file I've got and it's working fairly well so far using XSL-FO/Apache FOP. The XML file basically contains barcode information: the barcode itself and the barcode type (I'll add the barcode image at some point as well). Now what I'd like to see as the output is this: ----------------------- | barcode1 | barcode2 | | codetype1 | codetype2 | ----------------------- | barcode3 | barcode4 | | codetype3 | codetype4 | ----------------------- And so on. I've

How to add newline after an xml node so that FOP will recognize whitespace?

家住魔仙堡 提交于 2019-12-11 06:56:32
问题 We're using Apache FOP 1.1 with XSLT to generate a PDF for printing. Our software is creating the XML correctly, and passing this directly to the FOP transformer. We are not saving anything to file so the use of transformer properties to indent the XML is not going to help here. Basically our XML generator creates an XML document that looks like this: <document><list><item>1</item><item>2</item><item>3</item></list></document> and our XSLT has a bit that takes each item child of the list node

<fo:external-graphic src=… > throws error

倾然丶 夕夏残阳落幕 提交于 2019-12-11 05:14:56
问题 I use fop 2.1 and I need to load an external graphic with an absolute path. I tried this: <fo:root xsl:use-attribute-sets="text-attributes"> <fo:layout-master-set> ... <fo:page-sequence master-reference="master"> <xsl:call-template name="pageHeader"/> <xsl:call-template name="pageFooter"/> <fo:flow flow-name="xsl-region-body"> ... </fo:flow> </fo:page-sequence> ... <xsl:template name="pageHeader"> <fo:static-content flow-name="region-before-first"> <fo:block> <fo:external-graphic src="url(

reduce size of PDF generated with FOP

佐手、 提交于 2019-12-10 11:44:50
问题 I have unsuccessfully browsed this site (that has so often saved my life in the past) and the web for an answer to this question: I use Java, XSL-FO and FOP to generate PDFs that consist in one or more pages of data and images, each page having a header and a footer containing images themselves. These header and footer are repeated on each and every page of the PDF documents. The images are responsible for a large part of the size of the resulting PDF (about 50 %). I noticed that, by

How can I prevent my footer from getting overflowed in xsl-fo?

别说谁变了你拦得住时间么 提交于 2019-12-10 10:20:03
问题 I'm generating a pdf from my xsl and xml files wherein I need to display a table at the end of the first page. But since there are some tables above this table also, displaying it as static text pushes it down to the 2nd page (or 3rd and so on). So i thought to make this table as a footer (just on the first page). So I have this table defined as a footer in my xsl file. My table is under the following code <fo:static-content flow-name="xsl-region-after" font-size="10pt"> When I try to

Apache FOP and Arial font

此生再无相见时 提交于 2019-12-10 10:05:49
问题 My XSL style uses Arial font <fo:block font-family="Arial" font-size="8pt" font-weight="normal"> Configuration file fonts.xml: <?xml version="1.0"?> <fop> <renderers> <renderer mime="application/pdf"> <fonts> <base>file:///C:/windows/fonts</base> </fonts> </renderer> </renderers> </fop> also tried using this: <auto-detect/> and <directory>C:\windows\fonts</directory> I am always getting: WARNING: Font "Arial,normal,400" not found. Substituting with "any,normal,400". What should I fix in order

Apache FOP 1.1 QRCodes with zxing

*爱你&永不变心* 提交于 2019-12-10 09:43:59
问题 OK I am having an issue producing QR Codes in FOP 1.1 using barcode4j-2.1 and zxing-0.1.2. I currently have a FOP 1.0 implementation working correctly, by adding <prefer-renderer>true</prefer-renderer> to the fop configuration file. barcode4j barcodes are working regardless if prefer renderer is set or not, fixed in barcode4j-2.1. I have all necessary dependancies: fop-zxing-0.1.2-jar-with-dependencies.jar barcode4j-fop-ext-complete.jar saxon9he.jar - using for xslt 2.0 ... here is the

how to keep table with header but allow page breaks inside table body in XSL-FO using FOP

一世执手 提交于 2019-12-10 01:36:40
问题 I'm generating a PDF using Apache FOP and a XSL-FO stylesheet. In the PDF, I output headings (html equiv h1) which belong to a table, so should be kept together always. However, my tables may also contain so much data that they don't necessarily fit on one page. The desired result is a rule set that allows a heading to be kept with the table and fit both on one page if possible, but if the table data is so long that it does not fit on one page, then page breaks would be inserted in the table

How to set the default language in Apache FOP

匆匆过客 提交于 2019-12-08 17:43:29
问题 I'm generating PDF files using Apache FOP 2.1. For this I am trying to set the default language to be English. This is supposed to be verified after the creation of the PDF via Adobe Reader's option File/Properties/Advanced/Reading Options. This value currently is empty. I have tried setting xml:lang="en" in fo:root element, in first page-sequence or in the very first element of the .xsl file... Nothing seams to do the trick. Any Advice? Thanks Dimitris. Update: I have tried 2 more options as

How to display one or the other information depending on the page number in XSL-FO?

◇◆丶佛笑我妖孽 提交于 2019-12-08 10:52:11
问题 I'm using XSL-FO to create PDF's. Now I have a label that I want to display only on the first page, and another label that I want to display on all other pages, e.g. Page 1 Last month's balance Page 2 - n Previous page's balance The whole PDF is actually just a simple table, so this isn't about a cover page that stands outside of the data. How can I do it? See also this related question: How can I sum up some values per page in a table in XSL-FO? 回答1: This one can either be achieved using fo