apache-fop

Embedding Font into Apache FOP

我与影子孤独终老i 提交于 2019-11-30 07:36:18
I am tring to get Apache FOP to use Arial as font. So far, without luck. In my config.xml it says: <fonts> <font kerning="yes" embed-url="file:///C:/Windows/Fonts/Arial.ttf" encoding-mode="auto">> <font-triplet name="Arial" style="normal" weight="normal"/> </font> </fonts> But it doesnt seem to work. When I start FOP on the command line it says font Arial normal not found. I have tried to generate the Arial.xml file from the ttf with TTFReader in FOP but that, too, hasnt worked (even following the instructions on the fop webpage). I get the following error message: C:\Users\xy\Desktop\FOP2

PDF report with embedded HTML

混江龙づ霸主 提交于 2019-11-30 03:18:30
问题 We have a Java-based system that reads data from a database, merges individual data fields with preset XSL-FO tags and converts the result to PDF with Apache FOP . In XSL-FO format it looks like this: <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE Html [ <!ENTITY nbsp " "> <!-- all other entities --> ]> <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="/"

Using ApacheFOP v1.0 in .NET application

自闭症网瘾萝莉.ら 提交于 2019-11-30 02:22:09
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(); } } } Clay Benoit (Courtesy of the folks on the FOP Users Group) Prerequisite: IKVM 0.44.0.5 installed. Download FOP 1.0 from http:/

FO to PDF/a Conversion with Apache FOP Java Library

℡╲_俬逩灬. 提交于 2019-11-29 17:30:15
I'm trying to convert .fo files to PDF/a with Apache FOP 2.1 with the exemple code given in the documentation. I managed to convert the helloworld.fo file into PDF but, when I tried to convert it into PDF/a file I get this error: org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Helvetica That's why I tried to embedded fonts in the fop.xconf file: <fonts> <font kerning="yes" embed-url="C:/Users/thinkpad/workspace/FopConverter/Fonts/arial.ttf" name="Arial"> <font-triplet name="Arial" style="normal" weight="700"/> <

How can I sum up some values per page in a table in XSL-FO?

流过昼夜 提交于 2019-11-29 13:02:00
I'm using XSL-FO to generate an account statement print out. The PDF is actually just a simple table with a simple header on every page. The difficulty is that I have to display transaction volumes per page, e.g. Page 1 +------------------------------+-----------+-----------+---------------------+ | Text | Credit | Debit | Balance | +------------------------------+-----------+-----------+---------------------+ | Previous month | | | (*1) 1000 | | abc | 1000 | | 2000 | | abc | | 500 | 1500 | | abc | | 200 | 1300 | | ... | | | | | Carry over | (*2) 1000 | (*3) 700 | (*4) 1300 | +----------------

How to detect the last page of the document?

我与影子孤独终老i 提交于 2019-11-29 12:07:58
I create pdf files from xml files with FOP. I would like to display something on the last page of the pdf. The thing is I can not know how many pages are needed to display the content so how can I know I am on the actual last page? (each page-sequence can generate 1+ document pages according to the size of the content) Thanks. You can specify conditional page masters for general page layout and headers and footers (fo:static-content): http://www.w3.org/TR/xsl/#page-position Usage: 1.) In your fo:layout-master-set, define the different page masters you want to have. For example, a normal page

Set FopFactoryBuilder baseURI to jar classpath

我怕爱的太早我们不能终老 提交于 2019-11-29 11:07:29
I'm upgrading an Apache FOP 1.0 project to Apache FOP 2.1. In this project, all necessary files are packaged within the jar file. I've added the new FopFactoryBuilder to generate a FopFactory FopFactoryBuilder builder = new FopFactoryBuilder(new File(".").toURI()); builder = builder.setConfiguration(config); fopFactory = builder.build(); but all my resouces are loaded from the relative path on my file system, not from the jar. How can I set the baseURI to the jar's classpath? Thanks We also used FOP 2.1 and want to achieve, that images inside jars-classpath will be found. Our tested and used

XSL-FO fop. Long text flows into adjacent cells/block, obscuring stuff there

被刻印的时光 ゝ 提交于 2019-11-29 09:30:19
Could anyone suggest me a way to make long words (like serial numbers) to be wrapped? I tried some commercial software and there is no such issue. Is it a fop bug or probably there is a solution available? I can't insert zero length space after each character of every word in document. This solution sounds insane for me. You can specify the wrap-option attribute in your fo:block like so: <fo:block wrap-option="wrap"> ... stuff </fo:block> Here's the XSL-FO specification for this attribute: XSL Definition: Value : no-wrap | wrap | inherit Initial : wrap Applies to : fo:block, fo:inline, fo:page

Compare these products for PDF generation with Java given requirements inside: iText, Apache PDFBox or FOP? [closed]

巧了我就是萌 提交于 2019-11-28 16:05:36
There were questions on that but not recently and technology must have gone ahead since then. Requirements: generating pdf documents based on predefined template (I can use either pdf forms or xsl-fo) being able to fill textual data being able to fill graphical data (generated bar codes) being able to alter pdf template in production environment without patching (recompiling) generating pdf file to be saved in the database (as blob) and/or printed open source/free The options assumed are iText, PDFBox, FOP, anything else? What are recommendations based on the requirements above? iText;

Does FOP 2.1 support ViewerPreferences?

谁说我不能喝 提交于 2019-11-28 13:54:11
I'm using FOP 2.1 and am trying to set ViewerPreferences, e.g. DisplayDocTitle -> true. I'm trying (from this question <fo:declarations> <pdf:dictionary type="Catalog" xmlns:pdf="http://xmlgraphics.apache/org/fop/extensions/pdf"> <pdf:dictionary type="normal" key="ViewerPreferences"> <pdf:entry key="DisplayDocTitle" type="boolean">true</pdf:entry> </pdf:dictionary> </pdf:dictionary> <x:xmpmeta xmlns:x="adobe:ns:meta/"> ... but getting Jul 13, 2016 11:18:31 AM org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://xmlgraphics.apache/org/fop