apache-fop

Adding a PDF fillable form (acrofield) using Apache FOP

旧街凉风 提交于 2020-01-01 15:34:29
问题 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? 回答1: (disclosure: I'm a FOP developer, though not very active

Adding a PDF fillable form (acrofield) using Apache FOP

拈花ヽ惹草 提交于 2020-01-01 15:34:04
问题 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? 回答1: (disclosure: I'm a FOP developer, though not very active

Access file in WebContent folder from a servlet

亡梦爱人 提交于 2019-12-31 22:25:56
问题 I'm trying to generate a PDF document using FOP. The pdf generation code is kept in a servlet and the xsl is in a specific folder in the WebContent folder. How can I access this xsl file by giving a relative path? It works only if I give the complete path in the File object. I need to generate the xml content dynamically. How can I give this dynamically generated xml as the source instead of a File object? Please provide your suggestions. 回答1: To get the path you can just do: String path = s

Block Image Right and Flow Text Around It?

会有一股神秘感。 提交于 2019-12-29 08:08:28
问题 I'm working with DockBook 4.5 and Apache FOP 1.1 on Ubuntu 13.04. The Docbook translation are provided by Ubuntu and FOP was downloaded directly from Apache. Would someone please tell me how to insert an image on the right of a paragraph, where the paragraph has text, too? Bonus points if scaling works (think: thumbnail). For example: xxx xxx xxx xxx +---------------+ xxxxxx xx xxx | | xxxx xxxxx xxxxx | Image | xxx xxxx xxx | | xxx xxx xxxx xxx +---------------+ xxxxx xx xxx xxxx xxxxxx xx

Resolving relative paths when loading XSLT files

偶尔善良 提交于 2019-12-28 06:21:50
问题 I need to do an XSL transformation using Apache FOP and I had code like this: //Setup FOP Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out); //Setup Transformer Source xsltSrc = new StreamSource(new File(xslPath)); Transformer transformer = tFactory.newTransformer(xsltSrc); //Make sure the XSL transformation's result is piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); //Setup input Source src = new StreamSource(new File(xmlPath)); //Start the transformation and

Resolving relative paths when loading XSLT files

孤人 提交于 2019-12-28 06:21:41
问题 I need to do an XSL transformation using Apache FOP and I had code like this: //Setup FOP Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out); //Setup Transformer Source xsltSrc = new StreamSource(new File(xslPath)); Transformer transformer = tFactory.newTransformer(xsltSrc); //Make sure the XSL transformation's result is piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); //Setup input Source src = new StreamSource(new File(xmlPath)); //Start the transformation and

Resolving relative paths when loading XSLT files

痞子三分冷 提交于 2019-12-28 06:21:01
问题 I need to do an XSL transformation using Apache FOP and I had code like this: //Setup FOP Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out); //Setup Transformer Source xsltSrc = new StreamSource(new File(xslPath)); Transformer transformer = tFactory.newTransformer(xsltSrc); //Make sure the XSL transformation's result is piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); //Setup input Source src = new StreamSource(new File(xmlPath)); //Start the transformation and

I can't capture the console output from Java in FOP process and all my process it doesn't work

一世执手 提交于 2019-12-25 16:27:15
问题 I'm using eclipse + java. I have a method for execute instructions from console. Copied & pasted from internet... public void viewPDF(String cmd){ try { Process p = Runtime.getRuntime().exec( cmd); BufferedReader in = new BufferedReader( new InputStreamReader(p.getInputStream())); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } } catch (IOException e) { e.printStackTrace(); } } If I execute this code in console cmd all is Ok. C:\fop-0.93\fop -xml C:

Java Transformation to PDF

孤街醉人 提交于 2019-12-25 09:43:21
问题 I am doing a POC for one of my performance projects. Currently I'm facing an OutOfMemoryError . First we had loaded an XML file using DOM and then attempted to transform it with XSL into a PDF. After reading one of the comments from this forum, I switched to a SAX parser but it still gives the same error. The file is 30MB and the System Memory is 512MB. System.out.println("FOP XMLTOPDFConverter\n"); System.out.println("Preparing..."); // Setup directories /* File baseDir = new File("."); File

How to use apache fop with extensions (f.e. barcode4j) in java applet

时光总嘲笑我的痴心妄想 提交于 2019-12-25 08:47:51
问题 I want to have a barcode (Code128) generated during the xsl fop translation. As it is said in the apache fop documentation (and barcode4j docs), if you want to use extension, put it on the classpath. This works fine for a desktop app and an applet running from the eclipse. But how to run it from a browser? As a proof of concept, I extracted everything to so called 'fat-jar' - one jar, everything repacked from the eclipse as "Export to runnable jar" with "Extract required libs into generated