apache-fop

Apache FOP XML - XLS-FO generates invalid pdf

China☆狼群 提交于 2019-12-12 04:45:46
问题 I'm trying to create a PDF document with Apache FOP from an xml file that is formatted with an xlst stylesheet to convert the original xml file to an xml-fo formatted xml file. As I'm new to this, I tried to create a simple hello world example, without success. The generation process seems to succeed (no exceptions) but the generated pdf file is invalid for some reason. The size of the file is 4.8KB, and when opened with libreoffice writer, data has definitely been written to the file, but

Apache FOP Return Code 1 on PDF Generation

一世执手 提交于 2019-12-12 04:05:31
问题 I am attempting to use the latest version of Apache FOP to generate PDF's. When doing this however, I am getting an error with the return code. For some reason it is now returning "1" instead of "0" on the process execute. ProcessBuilder processBuilder = new ProcessBuilder(commandWords); processBuilder.directory(fopFolder); processBuilder.redirectErrorStream(true); StringBuilder outputBuilder = new StringBuilder(); Process process = processBuilder.start(); exitCode = process.waitFor(); /

XSLT new lines not being preserved

人走茶凉 提交于 2019-12-12 03:25:20
问题 For some reason my spaces aren't being preserved in my final PDF after xslt. My desired output is: Static text bold. Here's my xslt template: <xsl:preserve-space elements="*" /> <xsl:strip-space elements="" /> <xsl:template match="coverPage"> <fo:block font-size="12pt" color="black" text-align="center"> <xsl:text> Static text </xsl:text> </fo:block> <fo:block font-size="12pt" color="black" text-align="center" font-weight="bold"> <xsl:text> bold. </xsl:text> </fo:block> </xsl:template> 回答1:

Image not found for background-image attribute of block-container

末鹿安然 提交于 2019-12-11 23:32:29
问题 I have xslt template that generates pdf using Apache FOP. I have problem that background image cannot be found. I have tried absolute paths, relative paths and many else, but nothing happens. Could any of you help me ? I have tried following paths, but it did not help. c:/Projects/demo/src/main/resources/certificate.png is absolute path background-image="c:/Projects/demo/src/main/resources/certificate.png" background-image="file:///c:/Projects/demo/src/main/resources/certificate.png"

Apache FOP2 is adding unwanted spacing between images

时间秒杀一切 提交于 2019-12-11 23:02:11
问题 I'm trying to take a sliced up A4 design (designed in photoshop) and re-creating it in Apache FOP. Here's a snippet of a section that's in the design: and this is what it looks like when I take the images and place them in the XML: The big white gaps below referenceegoeshere and amountgoeshere is caused by the last image overflowing. When I remove it, I still get spacing around images: The design is done in 300dpi and the sliced up images are still 300dpi. In Apache FOP's config I've set the

How can I embed a base14 font in a pdf

做~自己de王妃 提交于 2019-12-11 19:33:38
问题 I'm using FOP 0.94 I might be able to upgrade to FOP 0.95. Is it possible to embed base14 fonts? If so, how? I have tried putting this in the fop.xconf: <font-metrics type="TYPE1"> <font-name>Times-Roman</font-name> <embed/> </font-metrics> That didn't work. Best regards, Morten 回答1: I choose to upgrade to FOP 1.1. A lot of issues went away. 来源: https://stackoverflow.com/questions/18475131/how-can-i-embed-a-base14-font-in-a-pdf

Xsl-fo How to render whole report but also single elements

怎甘沉沦 提交于 2019-12-11 18:04:28
问题 I have a document that consists of about 40 pages. It consists of nested report elements like sections, chapters, pictures, paragraphs, tables and charts. Each element has an attribute "layout" and an attribute "pagemaster". "pagemaster" should be responsible for which page-master-reference is used and "layout" for the appearance on the page. (like font styles etc) My goal is that each element has its own render information based on these attributes, so that the complete document as well as

Copyright statement not building

时光总嘲笑我的痴心妄想 提交于 2019-12-11 09:36:10
问题 For me, this builds the preface content, but no copyright matter. The file location is correct. From my ditamap: <frontmatter> <notices format="dita" href="preface/src/c_copyright.xml" linking="none" navtitle="Copyright and disclaimer" scope="local" toc="no" type="concept"> </notices> <booklists> <toc/> </booklists> <preface navtitle="nested Preface inside"> <topicref format="ditamap" href="maps/GSGettingStarted_preface.ditamap" navtitle="GSGettingStarted_preface"> </topicref> </preface> Am I

getting blank page when printing with fop 1.1

时光总嘲笑我的痴心妄想 提交于 2019-12-11 08:34:27
问题 using fop1.1 , i'm trying to print a document using the intermediate file method disscussed in this section fop intermediate format the problem is that it prints a blank page in the 3rd step . this is the FO file i'm using for my tests : <?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xml.apache.org/fop/extensions"> <fo:layout-master-set> <fo:simple-page-master master-name="all" page-height="5.4cm" page-width="9.56cm" margin-top=

At least one of minimum, optimum, or maximum IPD must be specified on table - XSL-FO Apache FOP

偶尔善良 提交于 2019-12-11 08:31:40
问题 I am writing an XSL stylesheet for XSL-FO transfomration to create a PDF, with tables, using Apache FOP library. I have succeeded in getting PDF document with data. But having some issues with the layout. The following lines are getting printed to my Netbeans IDE console, while creating PDF. [ERROR] At least one of minimum, optimum, or maximum IPD must be specified on table. [INFO] area contents overflows area in line My table cell contents are getting overlapped due to this. I want to know