xsl-fo

How can I make text automatically scale down in an SVG?

三世轮回 提交于 2019-12-06 19:41:25
I've got an SVG element that I've created with Inkscape. I then take that SVG and put in as part of an XSL-FO stylesheet that is used to transform XML data and then passed through the IBEX renderer to create a pdf (which is usually then printed). As an example, I have elements in the svg/stylesheet that look like this (extra noise due to the Inkscape export): <text x="114" x="278.36218" id="id1" xml:space="preserve" style="big-long-style-string-from-inkscape"> <tspan x="114" y="278.36218" id="id2" style="style-string"> <xsl:value-of select="Alias1"/> </tspan> </text> My problem lies in the

Scale down to fit an image in FOP

余生长醉 提交于 2019-12-06 18:11:18
问题 I am using FOP version 1.0 to create PDFs. In one of the pages I'd like to display an image (2552 x 4200 pixel) and scale it down if it doesn't fully fit on the page. As far as I could see on the mailing list the recommended way of doing this would be following: <fo:external-graphic inline-progression-dimension.maximum="100%" content-height="scale-down-to-fit" content-width="scale-down-to-fit" src="..."/> Unfortunately, that still doesn't display the whole image. The lower part of the image

reduce size of PDF generated with FOP

有些话、适合烂在心里 提交于 2019-12-06 15:55:10
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 converting them from JPEG to TIFF, and by reducing their resolution, I was able to reduce considerably the size

Processing FOP with parameters

泪湿孤枕 提交于 2019-12-06 14:12:11
HI, I want to use FOP to prepare a XML document for printing (ps/pdf). Is it possible to send parameters to FOP to do conditional formating as exist in xsl processors XSL: <xsl:param name="isDuplicate">no</xsl:param> .... <xsl:if test="$isDuplicate='yes'"> <h2 align="center">Copy</h2> </xsl:if> .... If you're using the fop batch/shell file that comes with the distribution, you can use the --param argument to fop, as d ocumented on the Fop page -param name value <value> to use for parameter <name> in xslt stylesheet (repeat '-param name value' for each parameter) 来源: https://stackoverflow.com

xsl cals tables: span cells, using colspec, namest and nameend

自古美人都是妖i 提交于 2019-12-06 12:32:54
I'm getting crazy with spanning cells of a table. My table is of 3 columns. Below you see one row (only fragment): <tgroup> <colspec name="x"> <colspec name="y"> <colspec name="z"> <tbody> <row> <entry>abc <entry namest="y" nameend="z">blabla The second entry (blabla) should span two entry (=table cells). The information is in the attributes "nameend" and "namest". My way is: xsl:template match="entry" ... get the position number of <colspec name=z> (here 3) and of <colspec name="y"> (here 2) <??????> substract z and y (=1) add 1: result=3 <xsl:param name="colspan"> <xsl:value-of select="(

How to convert xsl-fo to docx (Office Open XML) in Java?

大城市里の小女人 提交于 2019-12-06 12:29:48
问题 I'm looking for an open-source or commercial friendly library in Java to convert xsl-fo to docx (Office Open XML) format. I'm planing to use xsl-fo to produce pdf documents (with Apache FOP), so I thought generating Word documents ( docx ) out of the same source XML could be a good idea. UPDATE : I forgot to mention that I'm using Java. 回答1: Alternatively, you could do: your source xml -> docx -> xsl-fo -> pdf. or easier perhaps: source xml -> Flat OPC XML -> xsl-fo -> pdf. Once you have a

Creating a PDF from XML using XSL FO w/ Python

那年仲夏 提交于 2019-12-06 11:58:37
Could someone point me in the right direction of hopefully a library or code examples, any resources on how to take XML and create a PDF using XSL-FO in Python? If I should have to use an XML renderer, then which XML renderer is recommended? If you want to run XSLT programmatically with Python, you want lxml . However, if you just need to create a .fo file from a defined XSL/XML pair, you might as well just use xsltproc , which is available on any Unix-y system on the command line, including OS X. Once you have the .fo file, use Fop to transform that to PDF. You may want to try XHTML2PDF . It

Validate FO file

☆樱花仙子☆ 提交于 2019-12-06 11:02:02
问题 I generated a FO file from given xsl file and given xml file. I want to validate the FO file using a java code. When generating the fo file from xml and xsl, is it automatically checked? 回答1: I don't think so. The first indication I get that anyting's wrong with the FO is when the FO processor gives an error during PDF generation. One of the developers of Oxygen has this to say about the matter on the Oxygen forum: The problem with XSL-FO is that there is no tool which can fully and properly

Use XSL:FO to add attachments to PDF

冷暖自知 提交于 2019-12-06 08:58:44
After resolving inline images with help from SO, I need to sort out inline attachments. PDF can contain attachments and I found: fo:declarations - pdf:embedded-file but again it pointed to an external file. How can I attach a file that is part of a MIME message (most likely BASe64)? In the latest FOP builds, you can use the same syntax for pdf:embedded-file as for fo:external-graphic and directly append the base64 data: <fo:declarations> <pdf:embedded-file filename="myfile.pdf" src="data:application/pdf;base64,<DATA>"/> </fo:declarations> ... <fo:basic-link external-destination="url(embedded

XSL-FO Different header/footer depending on page-position

最后都变了- 提交于 2019-12-06 08:51:20
This might be a quite common problem with XSL-FO: I try to build a billing which has clear specifications: "Main Header": on every page (Text, Logo and Barcode) "Sub Header": (Customer Data) -> On the first page this block should be about 10% of the pages height -> On all the others page this block should be about the half smaller, so lets say 5% "Last-Page Footer": just on the last page of course (Total amount and signatures) "Every-page Footer": just for the printing date "Body": the content of the billing (every position) should flow in between of the all headers and footers automatically