xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From FOPUser <srinivas.cha...@gmail.com>
Subject FOP Special characters rendering
Date Tue, 15 Dec 2015 04:14:30 GMT
We are currently using FOP 1.0 for PDF generation. One of the requirements
for our application is to support  special characters. The special
characters are part of the content that the application receives from a
third party. So, we don’t know where special characters occurs in the
content. The requirement is the render the  special characters in the PDF .
While, testing the special characters we found all, the special characters
from the Symbol fonts are rendered as ‘#’ in the PDF.   From the logs it is
clear  non availability of the glyps are the reason for special characters
rendered as #.  The symbol fonts are part of the  14 base fonts and doesn’t
need any additional configuration. Appreciate any help that will help us
move forward on this.
	I am using the example from the
https://xmlgraphics.apache.org/fop/quickstartguide.html and below are
examples and output from PDF generation.

name.xml:
<name>Ohm unicode - "&#x2126;"    Omega decimal code- "&#937;"</name>

name2fo.xsl:

<?xml version="1.0" encoding="utf-8"?>
<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="/">
    <fo:root>
      <fo:layout-master-set>
        <fo:simple-page-master master-name="A4-portrait"
              page-height="29.7cm" page-width="21.0cm" margin="2cm">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="A4-portrait">
        <fo:flow flow-name="xsl-region-body">
          <fo:block>
             <xsl:value-of select="name"/>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
</xsl:stylesheet>

Output:
C:\fop -xml name.xml -xsl name2fo.xsl -pdf name.pdf

Dec 14, 2015 9:49:55 PM org.apache.fop.events.LoggingEventListener
processEvent
WARNING: Glyph "?" (0x2126, Ohm) not available in font "Helvetica".
Dec 14, 2015 9:49:55 PM org.apache.fop.events.LoggingEventListener
processEvent
WARNING: Glyph "?" (0x3a9, Omegagreek) not available in font "Helvetica".
Dec 14, 2015 9:49:55 PM org.apache.fop.events.LoggingEventListener
processEvent
INFO: Rendered page #1.
name.pdf <http://apache-fop.1065347.n5.nabble.com/file/n43155/name.pdf>  
name.pdf <http://apache-fop.1065347.n5.nabble.com/file/n43155/name.pdf>  



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/FOP-Special-characters-rendering-tp43155.html
Sent from the FOP - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message