Re: FOP 1.1 - Japanese 4-byte characters are rendering as '?' in pdf

2015-05-22 Thread Glenn Adams
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  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
> 
> 
> 
> First Name  ??
> Jock
> 
>
> 2. The XSL contains font family for blocks in which those will be rendered.
> -  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
> 
> // configure fopFactory
> final FopFactory fopFactory = FopFactory.newInstance();
>
> // FOP configuration -  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: [email protected]
> For additional commands, e-mail: [email protected]
>
>


Re: FOP 1.1 - Japanese 4-byte characters are rendering as '?' in pdf

2015-05-22 Thread mrunal28
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
  


First Name  ??
Jock


2. The XSL contains font family for blocks in which those will be rendered.
-  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
  
// configure fopFactory
final FopFactory fopFactory = FopFactory.newInstance();

// FOP configuration -  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: [email protected]
For additional commands, e-mail: [email protected]



Re: FOP 1.1 - Japanese 4-byte characters are rendering as '?' in pdf

2015-05-20 Thread Glenn Adams
Firstly, I suggest you avoid using the term "4-byte Japanese characters",
since that has no meaning except in the context of some encoding, like
UTF-8, UTF-16, UTF-32, etc. In Java, all String objects are encoded in
UTF-16 as 16-bit code units. So BMP characters use one 16-bit code unit,
and non-BMP characters use two 16-bit code units, i.e., an upper and lower
surrogate.

Hiragana characters are encoded in the BMP in the range U+3040 to U+309F
[1], Katakana in U+30A0 to U+30FF [2], and CJK Ideographs starting at
U+4E00.

[1] http://www.unicode.org/charts/PDF/U3040.pdf
[2] http://www.unicode.org/charts/PDF/U30A0.pdf
[3] http://www.unicode.org/charts/PDF/U4E00.pdf

For external FO files, or XML files you will translate to FO via XSLT, you
should use the UTF-8 encoding of Unicode, and ensure that you provide a
correct XML declaration at the beginning of your file:



I also suggest that you ensure the presence of the UTF-8 encoding of the
BOM [4] at the beginning of the file: 0xEF 0xBB 0xBF.

[4] http://en.wikipedia.org/wiki/Byte_order_mark

On Wed, May 20, 2015 at 3:20 AM, mrunal28  wrote:

> Hi Glenn,
>
> I am trying to understand if Katakana japanese language is a BMP unicode as
> per below link:
> http://www.sttmedia.com/unicode-basiclingualplane
> 
>
> If I assume that Katakana is a 4-byte japanese language. As per your reply
> if Katakana is BMP encoded and FOP supports it, then using FOP 1.1, my code
> should render 4-byte japanese characters correctly in pdf.
>
> I am attaching my code which I am using to convert japanese text into pdf.
> Please find attached files. fop_allfonts.xconf
> 
> ExampleXML2PDF.java
> 
>
> Please if you have suggestion on shared files.
>
> So Questions are:
> 1. Is Kanataka is BMP encoded? I assume it is.
> 2. Am I missing something in code to convert japanese 4-byte into 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-tp42117p42155.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


Re: FOP 1.1 - Japanese 4-byte characters are rendering as '?' in pdf

2015-05-20 Thread mrunal28
Hi Glenn,

I am trying to understand if Katakana japanese language is a BMP unicode as
per below link:
http://www.sttmedia.com/unicode-basiclingualplane
  

If I assume that Katakana is a 4-byte japanese language. As per your reply
if Katakana is BMP encoded and FOP supports it, then using FOP 1.1, my code
should render 4-byte japanese characters correctly in pdf.

I am attaching my code which I am using to convert japanese text into pdf.
Please find attached files. fop_allfonts.xconf
  
ExampleXML2PDF.java
  

Please if you have suggestion on shared files.

So Questions are:
1. Is Kanataka is BMP encoded? I assume it is.
2. Am I missing something in code to convert japanese 4-byte into 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-tp42117p42155.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: FOP 1.1 - Japanese 4-byte characters are rendering as '?' in pdf

2015-05-18 Thread Glenn Adams
Not sure what you mean by "four byte characters" unless you are referring
to non-BMP Unicode code points, i.e., those that require two 16-bit UTF-16
surrogates. FOP does not yet support non-BMP encoded characters.

On Mon, May 18, 2015 at 6:01 AM, mrunal28  wrote:

> Hi,
>
> I am using FOP 1.1 and trying to convert xml to pdf. My XML file contains
> japanese 4-byte characters(/カサタナハ) whose font is japanese katakana.
>
> But my generated PDF contains '?' instead of original japanese characters.
>
> I have font file for example katakana.ttf and made corresponding entry in
> FOP config file as below:
>
> 
>   
>   
>  
>
> weight="normal"/>
>
>   
>   
>   
> 
>
> Can anyone please tell me if FOP 1.1 supports japanese 4-byte characters
> and
> if so what extra configuration is required?
>
> I look out for same but none of FOP documentation clearly mentions that.
>
>
>
> --
> View this message in context:
> http://apache-fop.1065347.n5.nabble.com/FOP-1-1-Japanese-4-byte-characters-are-rendering-as-in-pdf-tp42117.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


FOP 1.1 - Japanese 4-byte characters are rendering as '?' in pdf

2015-05-18 Thread mrunal28
Hi,

I am using FOP 1.1 and trying to convert xml to pdf. My XML file contains
japanese 4-byte characters(/カサタナハ) whose font is japanese katakana.

But my generated PDF contains '?' instead of original japanese characters.

I have font file for example katakana.ttf and made corresponding entry in
FOP config file as below:


  
  
  

   
  
  
  
  


Can anyone please tell me if FOP 1.1 supports japanese 4-byte characters and
if so what extra configuration is required?

I look out for same but none of FOP documentation clearly mentions that.



--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/FOP-1-1-Japanese-4-byte-characters-are-rendering-as-in-pdf-tp42117.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]