apache-fop

FOP Driver Configuration same as FOPFactory

旧时模样 提交于 2019-12-04 15:27:07
I am currently using FOP embedded using Driver as follows Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PDF); driver.setInputSource(new InputSource(new FileInputStream(tempout))); File tempFile = File.createTempFile("W2P", ".pdf"); FileOutputStream pdfOutput = new FileOutputStream(tempFile); tempFile.deleteOnExit(); driver.setOutputStream(pdfOutput); driver.run(); but i would like to have access to configuration settings programatically specifically the output resolution as I have to produce multiple resolution files 72dpi 150dpi 300dpi the only way i can find of doing that is

Adding a PDF fillable form (acrofield) using Apache FOP

假如想象 提交于 2019-12-04 11:40:05
I am trying to add a fillable form (so the end-user can insert information into it using acrobat reader and then save it) to a PDF I generate using Apache FOP. I can't seem to find any information on how this is done, if it is possible. Google doesn't give much relevant information, mostly on the fact that it's not possible, but most of that information dates from the early 2000's. Is there a way to add acrofields using FOP? lfurini (disclosure: I'm a FOP developer, though not very active nowadays) The XSL-FO language , which is FOP's input language, does not have formatting objects defining

How display preformatted text in a pdf generated by fop?

荒凉一梦 提交于 2019-12-04 09:41:57
Does anyone know how I can display preformatted html text like: <ol> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ol> inside a pdf generated with fop? Thanks This XSLT 1.0: <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 indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page

Convert a string to XML input stream in java

て烟熏妆下的殇ゞ 提交于 2019-12-04 08:05:07
问题 I'm trying to generate a PDF document using FOP and Java. I receive the XML as a string and not as a file. How can I convert this XML string to an XML input stream so that I can call xslfoTransformer.transform(source, res); where source is my XML string as an Input stream. Please provide your suggestions. 回答1: You probably want to convert it to a Reader , not an InputStream . Use StringReader to do this. StreamSource has a constructor that takes a Reader, and you can pass that StreamSource to

How to change Apache FOP Xalan XSLT Processor?

本小妞迷上赌 提交于 2019-12-04 07:34:11
I am using Apache FOP 1.1.I want to change current apache Xalan XSLT processor to other for supporting XSLT 2.0. Currently it is not supporting XSLT 2.0. Please help me how to solve this problem. thank you. I got my Answer. TransformerFactory has a plug-ability layer. JAXP provides a common Java interface that allows flexibilty to add various implementations of the supported standards XSLT processors. TransformerFactory tFactory = TransformerFactory.newInstance(); This had look-up procedure to locate XSLT processors.AS we does not defined any,it will take available or default. Now, I am adding

FOP XSL-FO Anchor in an external destination

十年热恋 提交于 2019-12-04 03:22:56
With XSL-FO (Fop), I succeeded in creating a link to an external PDF : <fo:basic-link show-destination="new"> <xsl:attribute name="external-destination">foo.pdf</xsl:attribute> </fo:basic-link> But now, I would like to reach an anchor in this external PDF. So I tried to build something like that : <fo:basic-link show-destination="new"> <xsl:attribute name="external-destination">foo.pdf#anchorId</xsl:attribute> </fo:basic-link> Unfortunately, when I click on the generated link, I get an error. It tries to open the document foo.pdf%23anchorId . In my .fo file, the link is correct with a # but

Using ApacheFOP v1.0 in .NET application

余生长醉 提交于 2019-12-03 18:55:07
问题 Has anyone successfully complied the Apache FOP v1.0 library to a .NET DLL? I am using the IKVM syntax found at http://onjava.com/pub/a/onjava/2004/08/18/ikvm.html; however, the compiled DLL seems to be incomplete. For example, I cannot instantiate FopFactory object as: using org.apache.fop.apps; namespace Utils { public class PdfRender { public void Render() { FOUserAgent foUserAgent = fop.getUserAgent(); FopFactory fopFactory = FopFactory.newInstance(); } } } 回答1: (Courtesy of the folks on

XSL-FO Foreign Characters (Polish) Unicode in APACHE FOP (V. 1.1)

荒凉一梦 提交于 2019-12-03 16:12:04
I have the following xsl-fo code, attempting to produce foreign characters. <?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> ... <fo:block font-size="11pt" font-family="calibri" language="pl"> Odwrotna strona tego pisma zawiera ważne informacje. jeżeli potrzebuje Pan/i pomocy, aby je zrozumieć, proszę zadzwonić pod numer X-XXX-XXX-XXXX po bezpłatne usługi językowe. </fo:block> I've tried every font-type I can think of to access the required unicode characters, but have had no success so far. Is there something wrong with my formatting? Or the

FOP: how to specify image src relative path?

不羁岁月 提交于 2019-12-03 13:38:44
问题 This is my first question here, i hope i'm doing it right. Sorry for my bad English in advance :) I am using JSF 2.0 (Eclipse IDE) and i'm trying to generate some PDF files using Apache FOP 1.0. I was able to make simple PDF files using instructions on Apache Fop site , but i can't insert any image from my application folder. My folder structure is like this: In my application WebContent i have (among else) pdf_transform/xslt/transformFile.xsl, and pdf_transform/xslt/logo.jpg In transformFile

good way to generate PDF offline on Android device… tried DOCX4J

放肆的年华 提交于 2019-12-02 12:34:46
问题 is there a good way to generate a PDF document on a Android device? I have a DOCX file as a Base. I know that it is possible: here a very good app https://play.google.com/store/apps/details?id=cn.wps.moffice_eng they render it offline. some ideas? I already tried DOCX4J, and it is generating a DOCX file properly, how ever using the WordprocessingMLPackage wordMLPackage to prepare the PDF it says: E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.ExceptionInInitializerError at org.plutext