Hello Jeremias,

 Thank you for your help and the example you have attached, but it still not
working for me. I think there is some problems with the FOP configuration. I
getting this error:

org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even
the base 14 fonts, have to be embedded! Offending font: Times-Roman
        at org.apache.fop.pdf.PDFFont.validate(PDFFont.java:199)
        at org.apache.fop.pdf.PDFFont.toPDFString(PDFFont.java:210)
        at org.apache.fop.pdf.PDFObject.toPDF(PDFObject.java:164)
        at org.apache.fop.pdf.PDFObject.output(PDFObject.java:153)
        at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:831)
        at org.apache.fop.pdf.PDFDocument.outputTrailer(PDFDocument.java:896)
        at 
org.apache.fop.render.pdf.PDFRenderer.stopRenderer(PDFRenderer.java:483)
        at
org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:241)
        at
org.apache.fop.area.AreaTreeHandler.endDocument(AreaTreeHandler.java:426)
        at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:171)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.endDocument(TransformerIdentityImpl.java:962)
        at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown 
Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown 
Source)
        at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

Can you please look at my code maybe you can see what is wrong ?

                  FopFactory fopFactory = FopFactory.newInstance();

                  File configFile = new
File("/home/vk/a-tests/fop/exampl/fop.xconf");
                  fopFactory.setUserConfig(configFile);

                  FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
                  foUserAgent.getRendererOptions().put("pdf-a-mode",
"PDF/A-1b");

                  PDFRenderer pdfrenderer = new PDFRenderer();
                  pdfrenderer.setUserAgent(foUserAgent);

                  foUserAgent.setRendererOverride(pdfrenderer);


                  // Construct fop with desired output format
                  Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
foUserAgent, outputMessages[0]);

                  fopFactory.addElementMapping(new FOElementMapping());
                  fopFactory.addElementMapping(new SVGElementMapping());
                  fopFactory.addElementMapping(new
BatikExtensionElementMapping());
                  fopFactory.addElementMapping(new
ExtensionElementMapping());
                  fopFactory.addElementMapping(new XMPElementMapping());
                  fopFactory.addElementMapping(new RDFElementMapping());
                  fopFactory.addElementMapping(new
PSExtensionElementMapping());

                  // Setup JAXP using identity transformer
                  TransformerFactory factory =
TransformerFactory.newInstance();
                  Transformer transformer = factory.newTransformer(); //
identity transformer

                  // Setup input stream
                  Source src = new StreamSource(inputMessages[0]);

                  // Resulting SAX events (the generated FO) must be piped
through to FOP
                  Result res = new SAXResult(fop.getDefaultHandler());

                  // Start XSLT transformation and FOP processing
                  transformer.transform(src, res);

  
  Thank you in advance,

  Virginijus Kandrotas
-- 
View this message in context: 
http://www.nabble.com/Need-working-example-or-help-how-to-use-PDF-A-1b-with-FOP-0.93-tf3227266.html#a8966701
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to