xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Adams <gl...@skynav.com>
Subject Re: FOP 1.1 - Japanese 4-byte characters are rendering as '?' in pdf
Date Fri, 22 May 2015 13:14:08 GMT
You should experiment with using XSL-FO directly as input using the command
line interface for FOP (and not your Java code). That will allow you to
figure out what input and configuration is required. Then you can craft the
appropriate XSLT and Java integration to produce the same results.

On Fri, May 22, 2015 at 3:29 AM, mrunal28 <loharms@gmail.com> wrote:

> Thanks for reply. This ensures that Katakana is BMP encoded and FOP 1.1
> supports it.
>
> But I am stuck in while generating pdf using FOP 1.1.
> Here are some more queries to get it work.
>
> 1. The XML which I am using to convert into Pdf, contains encoding UTF-8 as
> you suggested.
> sample1.xml
> <http://apache-fop.1065347.n5.nabble.com/file/n42183/sample1.xml>
> <?xml version="1.0" encoding="UTF-8"?>
> <data>
>     <field>First Name???? ???? ??</field>
>     <data-entered>Jock</data-entered>
> </data>
>
> 2. The XSL contains font family for blocks in which those will be rendered.
> -  sample1.xsl
> <http://apache-fop.1065347.n5.nabble.com/file/n42183/sample1.xsl>
> Question:
> 1) Should I specify the font in XSL for Japanese language?
>
> 3. Java code contains the main steps to convert XML into pdf. -
> ExampleXML2PDF.java
> <http://apache-fop.1065347.n5.nabble.com/file/n42183/ExampleXML2PDF.java>
> // configure fopFactory
> final FopFactory fopFactory = FopFactory.newInstance();
>
> // FOP configuration -  fop_allfonts.xconf
> <http://apache-fop.1065347.n5.nabble.com/file/n42183/fop_allfonts.xconf>
> fopFactory.setUserConfig("fop_allfonts.xconf");
>
> // configure foUserAgent
> FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
>
> // Construct fop with Pdf output format
> Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
>
> // Setup XSLT
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transformer = factory.newTransformer(new
> StreamSource(xsltfile));
> // Start XSLT transformation and FOP processing
> transformer.transform(src, res);
>
> Question:
> 1) Do I need to specify fonts which will get used while rendering pdf?
> (for example) fopFactory.getFontManager().setFontBaseURL("C:/fonts");
> 2) I have converted XSL file directly into Pdf. Is it required to convert
> XSL into FO first and then from FO to Pdf?
>
>
>
>
> --
> View this message in context:
> http://apache-fop.1065347.n5.nabble.com/FOP-1-1-Japanese-4-byte-characters-are-rendering-as-in-pdf-tp42117p42183.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