xsl-fo

Creating a PDF from XML using XSL FO w/ Python

…衆ロ難τιáo~ 提交于 2019-12-08 03:57:52
问题 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? 回答1: 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,

Float image in PDF using xsl:fo

孤街醉人 提交于 2019-12-08 03:51:35
问题 I have been trying hard to find a solution to this but no luck till now. I'm generating a PDF from xml and I want to float the images inside the pdf. Like for example if I have image floating left in the xml, same should get applied into the pdf. <p> <img width="127" height="190" src="/images/241729.jpg" style="float: left;"> Globally transition high standards in technology via ubiquitous partnerships. Distinctively pursue worldwide paradigms vis-a-vis business e-business. </p> and the XSL

Use XSL:FO to add attachments to PDF

孤街浪徒 提交于 2019-12-08 01:28:18
问题 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)? 回答1: 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

How to use `xsl:include` with apache fop

…衆ロ難τιáo~ 提交于 2019-12-08 00:21:28
问题 I use apache FOP to generate pdf files. I have this xsl code <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 font-size="11pt" font-family="serif"> <fo:layout-master-set> <fo:simple-page-master master-name="A4-portrait" page-height="29.7cm" page-width="21.0cm" margin-top="1cm" margin-left="1.5cm" margin-right="1cm" margin-bottom="1cm"> <fo

Processing FOP with parameters

旧时模样 提交于 2019-12-07 22:43:09
问题 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> .... 回答1: If you're using the fop batch/shell file that comes with the distribution, you can use the --param argument to fop, as documented on the Fop page -param name value <value> to use for

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

眉间皱痕 提交于 2019-12-07 18:50:48
问题 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)

XSL:FO float for displaying margin notes - breaks document

风流意气都作罢 提交于 2019-12-07 16:39:37
问题 I have a large medieval manuscript transcribed into XML (using TEI schema). I am using xsl:fo and Apache FOP to process into PDF. The file is constructed using nested <body> , <p> , <seg> as shown below. Occasionally <add> is used for margin notes. <body> <p> <title>title here</title> <seg>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a orci non mauris convallis imperdiet consequat nec purus. Cras mollis lacus vel lectus facilisis, non hendrerit velit tempor. Phasellus

How to manipulate page number in FOP?

匆匆过客 提交于 2019-12-07 15:48:54
问题 I am using Apache FOP 0.95, and all I want to do is add 1 to the current page number. So, on page 12, I want to show 12 / 13. Then nothing on page 13, of course. Any ideas how I could do this, perhaps by manipulating <fo:page-number /> ? Thanks y'all! 回答1: Short answer for this is that you can't achieve the result you after with straight FO. This is because you can't programatically access the page-numbers until FOP has assigned them, so your XSLT doesn't know what they are. You can get round

XSL-FO SVG Format support - .Net

谁说胖子不能爱 提交于 2019-12-07 09:23:36
问题 I need to render svg in my XSL fo in c#.Net which is available in https://fonet.codeplex.com/. I tried to use svg in the xsl-fo but it does not render any pdf and fails silently. If anybody has found a solution for this issue please help. I need my pdf report to support svg contents. 回答1: Use the below code to add Hander of an image incase of svg extensions FonetDriver fonetDriver = FonetDriver.Make(); fonetDriver.ImageHandler = SvgImageHandler; Add the SvgImageHandler Hander private static

xls-fo fop 0.94 Using the keep-together with wrap-option=“wrap”

China☆狼群 提交于 2019-12-07 00:51:48
问题 In xls-fo fop 0.94 Using the keep-together along with with wrap-option="wrap" ignores the wrap option ? Is there a way to make them both work? <fo:table-row border="1pt solid black" keep-together="always"> <fo:table-cell> <fo:block overflow="scroll" wrap-option="wrap"> This is a long text It is desired that this text be wrapped in the table cell but just can not make it happen! </fo:block> </fo:table-cell> </fo:table-row> 回答1: keep-together="always" implicitely sets keep-together.within-line=