(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:
<font kerning="yes" embed-url="C:/Utilities/DejaVuSans-Oblique.ttf"> <font-triplet name="DejaVuSans" style="italic" weight="400"/> </font> <font kerning="yes" embed-url="C:/Utilities/DejaVuSans-Bold.ttf"> <font-triplet name="DejaVuSans" style="normal" weight="700"/> </font> <font kerning="yes" embed-url="C:/Utilities/DejaVuSans-BoldOblique.ttf"> <font-triplet name="DejaVuSans" style="italic" weight="700"/> </font> 2016-01-06 15:26 GMT+01:00 Tunahan Coban <[email protected]>: > 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:[email protected]] > 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 <[email protected]>: >> Hi Pascal, >> >> >> >> I sent the first part (because the file is 3000 lines long) from the >> *.xsl file, too. >> >> Here again: >> >> >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <xsl:stylesheet version="1.1" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >> xmlns:fo="http://www.w3.org/1999/XSL/Format"> >> >> <xsl:variable name="fo:layout-master-set"> >> >> <fo:layout-master-set> >> >> <fo:simple-page-master master-name="simpleA4" page-height="29.7cm" >> page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" >> margin-right="2cm"> >> >> <fo:region-body margin-top="2cm" margin-bottom="2cm"/> >> >> <fo:region-before extent="2cm"/> >> >> </fo:simple-page-master> >> >> </fo:layout-master-set> >> >> </xsl:variable> >> >> <xsl:template match="/"> >> >> <fo:root font-family="Arial"> >> >> <xsl:copy-of select="$fo:layout-master-set" /> >> >> <fo:page-sequence master-reference="simpleA4" >> initial-page-number="1" format="1"> >> >> <fo:static-content flow-name="xsl-region-before"> >> >> <fo:block> >> >> <fo:block> >> >> <xsl:text>
</xsl:text> >> >> </fo:block> >> >> <fo:table table-layout="fixed" width="100%" >> space-before.optimum="1pt" space-after.optimum="2pt"> >> >> <fo:table-column /> >> >> <fo:table-column /> >> >> <fo:table-column /> >> >> <fo:table-body> >> >> <fo:table-row> >> >> <fo:table-cell font-family="Arial" >> 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"> >> >> <fo:block> >> >> <xsl:for-each >> select="data"> >> >> <xsl:for-each >> select="texts"> >> >> <xsl:for-each >> select="DateText"> >> >> <fo:inline >> font-size="7pt"> >> >> >> <xsl:apply-templates /> >> >> </fo:inline> >> >> </xsl:for-each> >> >> </xsl:for-each> >> >> </xsl:for-each> >> >> ….. >> >> >> >> … >> >> >> >> 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 ! >> >> >> >> -- > > > > -- > pascal -- pascal --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
