Re: WG: Embedding Fonts for PDF/A
Hi, Oh after i wrote the lines below i see YOUR CONFIG IS MISSING: the font definitions need to be in the fonts tag. So ie.: ... ... Before i recognized the missing in config: As i make fo and config to using fonts, it may help you, try it: First: In FOP config define the directive. Second: In FOP renderer config, where you define fonts, in embed-url use only the file name without path (wich is defined in font-base) Define the font name as it is in the ttf, ie.: "DejaVu Sans" not "DejaVuSans" !!! - may try to use the embedding-mode="full" attribute (i know it will make larger PDF file size) Third: Use the font in fo by its given=real name: font-family="DejaVu Sans" I hope this will help you. Bye, Szeak 2016-01-07 10:14 keltezéssel, Tunahan Coban írta: Hey, I added Pascals variations to my config file and change in the xsl again : . But it still doesn't work. I get the following sentences: // a lot of these Warnings 16:40:27,941 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The following feature isn't implemented by Apache FOP, yet: table-layout="auto" (on fo:table) (Keine Kontextinformationen verfügbar) 16:40:29,082 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) table-layout="fixed" and column-width unspecified => falling back to proportional-column-width(1) (No context info available) 16:40:29,268 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The contents of fo:inline line 1 exceed the available area in the inline-progression direction by 3896 millipoints. (No context info available) 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 16:40:29,675 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-2) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 16:40:29,690 ERROR [stderr] (http-/0.0.0.0:7080-2) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Here is my finally config file after adding your variations: true PDF/A-1a 1.4 Where could be this problem? Thanks. -- -Ursprüngliche Nachricht- Von: Pascal Sancho [mailto:psancho@gmail.com] Gesendet: Mittwoch, 6. Januar 2016 16:20 An: Tunahan Coban; fop-users@xmlgraphics.apache.org Betreff: Re: Embedding Fonts for PDF/A (Tunahan sent me the FO file off-list, due to confidential things) Tunahan, I can reproduce DejaVu substitution: Your config lacks font descriptions for variations: 2016-01-06 15:26 GMT+01:00 Tunahan Coban : Hi Pascal, Thank you to invest your time for me. It is better for me that our conversation don't been uploaded to the mail list site. Because of the internal informations. I hope I understand you correctly with the xsl-fo file. Now I have converted my XML file with the stylesheet to FO. I will send you this as a mail-attachment. When you could say me what kind of mistakes you search, so can I help you.. Because the file is too long, you will see.. :/ Thanks so much ! -- -Ursprüngliche Nachricht- Von: Pascal Sancho [mailto:psancho@gmail.com] Gesendet: Mittwoch, 6. Januar 2016 14:43 An: Tunahan Coban Betreff: Re: Embedding Fonts for PDF/A Hi, Please, rather than XSL stylsheet, it's easier for us to play with resulting XSL-FO, witch can be achieved without FOP, using XALAN, for example. And it is better to attach such file rather than copy/paste in mail body: all blank spaces and lines are preserved, with actual used encoding. 2016-01-06 14:06 GMT+01:00 Tunahan Coban : Hi Pascal, I sent the first part (because the file is 3000 lines long) fro
WG: Embedding Fonts for PDF/A
Hey, I added Pascals variations to my config file and change in the xsl again : . But it still doesn't work. I get the following sentences: // a lot of these Warnings 16:40:27,941 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The following feature isn't implemented by Apache FOP, yet: table-layout="auto" (on fo:table) (Keine Kontextinformationen verfügbar) 16:40:29,082 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) table-layout="fixed" and column-width unspecified => falling back to proportional-column-width(1) (No context info available) 16:40:29,268 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The contents of fo:inline line 1 exceed the available area in the inline-progression direction by 3896 millipoints. (No context info available) 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 16:40:29,675 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-2) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 16:40:29,690 ERROR [stderr] (http-/0.0.0.0:7080-2) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Here is my finally config file after adding your variations: true PDF/A-1a 1.4 Where could be this problem? Thanks. -- -Ursprüngliche Nachricht- Von: Pascal Sancho [mailto:psancho@gmail.com] Gesendet: Mittwoch, 6. Januar 2016 16:20 An: Tunahan Coban; fop-users@xmlgraphics.apache.org Betreff: Re: Embedding Fonts for PDF/A (Tunahan sent me the FO file off-list, due to confidential things) Tunahan, I can reproduce DejaVu substitution: Your config lacks font descriptions for variations: 2016-01-06 15:26 GMT+01:00 Tunahan Coban : > Hi Pascal, > > Thank you to invest your time for me. It is better for me that our > conversation don't been uploaded to the mail list site. Because of the > internal informations. I hope I understand you correctly with the xsl-fo file. > Now I have converted my XML file with the stylesheet to FO. > I will send you this as a mail-attachment. > > When you could say me what kind of mistakes you search, so can I help > you.. Because the file is too long, you will see.. :/ > > Thanks so much ! > > -- > > > -Ursprüngliche Nachricht- > Von: Pascal Sancho [mailto:psancho@gmail.com] > Gesendet: Mittwoch, 6. Januar 2016 14:43 > An: Tunahan Coban > Betreff: Re: Embedding Fonts for PDF/A > > Hi, > > Please, rather than XSL stylsheet, it's easier for us to play with resulting > XSL-FO, witch can be achieved without FOP, using XALAN, for example. > And it is better to attach such file rather than copy/paste in mail > body: all blank spaces and lines are preserved, with actual used encoding. > > 2016-01-06 14:06 GMT+01:00 Tunahan Coban : >> Hi Pascal, >> >> >> >> I sent the first part (because the file is 3000 lines long) from the >> *.xsl file, too. >> >> Here again: >> >> >> >> >> >> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >> xmlns:fo="http://www.w3.org/1999/XSL/Format";> >> >> >> >> >> >> > page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" >> margin-right="2cm"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > initial-page-number="1" format="1"> >> >> >> >> >> >> >> >> >> >> >> >>
Re: Embedding Fonts for PDF/A
Hi Pascal, I sent the first part (because the file is 3000 lines long) from the *.xsl file, too. Here again: http://www.w3.org/1999/XSL/Transform"; xmlns:fo="http://www.w3.org/1999/XSL/Format";> . ... I tested now the normal PDF converting and its still does work. Only the PDF/A doesn't work.. Maybe my java-code is wrong? // TODO:Fonts configuration in work DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File("cfg.xml")); FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()).setConfiguration(cfg); final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI()); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfOut); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(styleSheet); transformer.setParameter("versionParam", "2.0"); Result fopResult = new SAXResult(fop.getDefaultHandler()); transformer.transform(xml, fopResult); } finally { pdfOut.close(); } } catch (Exception e) { e.printStackTrace(System.err); } } Thanks ! --
Re: Embedding Fonts for PDF/A
(Tunahan sent me the FO file off-list, due to confidential things) Tunahan, I can reproduce DejaVu substitution: Your config lacks font descriptions for variations: 2016-01-06 15:26 GMT+01:00 Tunahan Coban : > Hi Pascal, > > Thank you to invest your time for me. It is better for me that our > conversation don't been uploaded to the mail list site. Because of the > internal informations. I hope I understand you correctly with the xsl-fo file. > Now I have converted my XML file with the stylesheet to FO. > I will send you this as a mail-attachment. > > When you could say me what kind of mistakes you search, so can I help you.. > Because the file is too long, you will see.. :/ > > Thanks so much ! > > -- > > > -Ursprüngliche Nachricht- > Von: Pascal Sancho [mailto:psancho@gmail.com] > Gesendet: Mittwoch, 6. Januar 2016 14:43 > An: Tunahan Coban > Betreff: Re: Embedding Fonts for PDF/A > > Hi, > > Please, rather than XSL stylsheet, it's easier for us to play with resulting > XSL-FO, witch can be achieved without FOP, using XALAN, for example. > And it is better to attach such file rather than copy/paste in mail > body: all blank spaces and lines are preserved, with actual used encoding. > > 2016-01-06 14:06 GMT+01:00 Tunahan Coban : >> Hi Pascal, >> >> >> >> I sent the first part (because the file is 3000 lines long) from the >> *.xsl file, too. >> >> Here again: >> >> >> >> >> >> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >> xmlns:fo="http://www.w3.org/1999/XSL/Format";> >> >> >> >> >> >> > page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" >> margin-right="2cm"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > initial-page-number="1" format="1"> >> >> >> >> >> >> >> >> >> >> >> >> > space-before.optimum="1pt" space-after.optimum="2pt"> >> >> >> >> >> >> >> >> >> >> >> >> > text-align="center" padding-start="3pt" padding-end="3pt" >> padding-before="3pt" padding-after="3pt" display-align="center" >> border-style="solid" border-width="1pt" border-color="white"> >> >> >> >> > select="data"> >> >> > select="texts"> >> >> > select="DateText"> >> >> > font-size="7pt"> >> >> >> >> >> >> >> >> >> >> >> >> >>….. >> >> >> >> … >> >> >> >> I tested now the normal PDF converting and its still does work. Only >> the PDF/A doesn’t work.. >> >> Maybe my java-code is wrong? >> >> >> >> // TODO:Fonts configuration in work >> >>DefaultConfigurationBuilder cfgBuilder = new >> DefaultConfigurationBuilder(); >> >>Configuration cfg = cfgBuilder.buildFromFile(new >> File("cfg.xml")); >> >>FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new >> File(".").toURI()).setConfiguration(cfg); >> >> >> >> >> >> final FopFactory fopFactory = FopFactory.newInstance(new >> File(".").toURI()); >> >> >> >> >> >> FOUserAgent foUserAgent = fopFactory.newFOU
Re: Embedding Fonts for PDF/A
That should be fo:root not fot:root Sent from my iPhone 6s > On Jan 6, 2016, at 3:41 AM, Tunahan Coban wrote: > > Hi Simon, > > Thanks for your answer. But it doesn’t work when I add > font-family=”DejaVuSans” to fot:root. I deleted the too. > > Maybe my java-code has a problem? > > // TODO:Fonts configuration in work > DefaultConfigurationBuilder cfgBuilder = new > DefaultConfigurationBuilder(); > Configuration cfg = cfgBuilder.buildFromFile(new > File("cfg.xml")); > FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new > File(".").toURI()).setConfiguration(cfg); > > > final FopFactory fopFactory = FopFactory.newInstance(new > File(".").toURI()); > > > FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); > foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); >// fopFactoryBuilder.setConfiguration(this.getClass().getResource(c)) > > > OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); > > try { > > Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, > pdfOut); > > TransformerFactory factory = TransformerFactory.newInstance(); > Transformer transformer = factory.newTransformer(styleSheet); > transformer.setParameter("versionParam", "2.0"); > > Result fopResult = new SAXResult(fop.getDefaultHandler()); > > transformer.transform(xml, fopResult); > > > } finally { >pdfOut.close(); > } > > } catch (Exception e) { > e.printStackTrace(System.err); > } > } > > Thanks
Re: Embedding Fonts for PDF/A
Hi, Simon asked for XSL-FO file (what feeds FOP), not fop.xconf 2016-01-06 13:18 GMT+01:00 Tunahan Coban : > Edit: > > > > I change the font to Arial. But it still doesn’t work. > > > > > >true > > > > > > PDF/A-1a > > 1.4 > > > > embed-url="file:///C:/Utilities/arial.ttf"> > > weight="normal"/> > > > > > > > > > > > > > > > > Thanks. > > > > -- -- pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Embedding Fonts for PDF/A
Edit: I change the font to Arial. But it still doesn't work. true PDF/A-1a 1.4 Thanks. --
RE: Embedding Fonts for PDF/A
Hi Simon, Thanks for your answer. But it doesn't work when I add font-family="DejaVuSans" to fot:root. I deleted the too. Maybe my java-code has a problem? // TODO:Fonts configuration in work DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File("cfg.xml")); FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()).setConfiguration(cfg); final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI()); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); // fopFactoryBuilder.setConfiguration(this.getClass().getResource(c)) OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfOut); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(styleSheet); transformer.setParameter("versionParam", "2.0"); Result fopResult = new SAXResult(fop.getDefaultHandler()); transformer.transform(xml, fopResult); } finally { pdfOut.close(); } } catch (Exception e) { e.printStackTrace(System.err); } } Thanks
RE: Embedding Fonts for PDF/A
Hi, Show us the xslfo file. Thanks From: Tunahan Coban [mailto:tunahan.co...@coconet.de] Sent: 06 January 2016 11:42 To: simonsteiner1...@gmail.com; fop-users@xmlgraphics.apache.org Subject: RE: Embedding Fonts for PDF/A Hi Simon, Thanks for your answer. But it doesn't work when I add font-family="DejaVuSans" to fot:root. I deleted the too. Maybe my java-code has a problem? // TODO:Fonts configuration in work DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File("cfg.xml")); FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()).setConfiguration(cfg); final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI()); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); // fopFactoryBuilder.setConfiguration(this.getClass().getResource(c)) OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfOut); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(styleSheet); transformer.setParameter("versionParam", "2.0"); Result fopResult = new SAXResult(fop.getDefaultHandler()); transformer.transform(xml, fopResult); } finally { pdfOut.close(); } } catch (Exception e) { e.printStackTrace(System.err); } } Thanks
RE: Embedding Fonts for PDF/A
Hi, Add font-family="DejaVuSans" to fo:root, maybe remove auto-detect from conf.xml also. Thanks From: Tunahan Coban [mailto:tunahan.co...@coconet.de] Sent: 06 January 2016 10:11 To: fop-users@xmlgraphics.apache.org Subject: Embedding Fonts for PDF/A Hi, this is my first question to the list and I don't know if this way the right one. So I have a problem with the fonts to generate a PDF/A. I have testing to embed the fonts Helvetica and DejaVuSans but anyone don't work. I used the following conf.xml with trying to embed DejaVuSans: true PDF/A-1a 1.4 I have download the DejaVuSans.ttf from <http://dejavu-fonts.org/wiki/Main_Page> http://dejavu-fonts.org/wiki/Main_Page. Then I get this: 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 10:44:20,602 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-4) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 10:44:20,602 ERROR [stderr] (http-/0.0.0.0:7080-4) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Is it the right way to embed any fonts? It would be greate if you can show me an example with embedding DejaVuSans or Helvetica.. Thank you so much! --
Embedding Fonts for PDF/A
Hi, this is my first question to the list and I don't know if this way the right one. So I have a problem with the fonts to generate a PDF/A. I have testing to embed the fonts Helvetica and DejaVuSans but anyone don't work. I used the following conf.xml with trying to embed DejaVuSans: true PDF/A-1a 1.4 I have download the DejaVuSans.ttf from http://dejavu-fonts.org/wiki/Main_Page. Then I get this: 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 10:44:20,602 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-4) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 10:44:20,602 ERROR [stderr] (http-/0.0.0.0:7080-4) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Is it the right way to embed any fonts? It would be greate if you can show me an example with embedding DejaVuSans or Helvetica.. Thank you so much! --