I only have windows so it will always work for me. Post one of those
garbled PDFs. 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Jus
> Sent: Tuesday, October 18, 2005 2:22 PM
> To: [email protected]
> Subject: [iText-questions] iText output is garbled on 
> Japanese AIX, works on Windows
> 
> we are using legacy AWT code and converting that to PDF using 
> iText, initially
> we had problems once we tried to render a PDF that had 
> contents in Japanese. To
> get it to work on windows the following was done.. we had 
> written a class that
> implements FontMapper.. all it does is
> public BaseFont awtToPdf(Font font) {
>         try {
>             //return BaseFont.createFont("arialuni.ttf", 
> BaseFont.IDENTITY_H, true);
> 
> //OR            
>             return BaseFont.createFont("msgothic.ttc,2", 
> BaseFont.IDENTITY_H, true);
> 
>         }
>         catch (Exception e) {
>             e.printStackTrace();
>             throw new ExceptionConverter(e);
>         }
>     }
> The arialunit.ttf, msgothic.ttc are available within 
> application... in windows
> this works fine, but on AIX the output is garbled.. Following 
> is sample sketch
> code that generates PDF...
> 
> Document document = new Document(PageSize.A4.rotate(), 72, 
> 72, 72, 72);
> 
> PdfWriter writer  = PdfWriter.getInstance(document, new 
> FileOutputStream(workDir
> + fileName));
> document.open();
> 
> contentByte = writer.getDirectContent();
> 
> PdfTemplate template = contentByte.createTemplate(width, height);
>                     
> IndusFontMapper fontMapper = new IndusFontMapper();
>                    
> FontFactory.registerDirectory("/u01/app/oracle/oas/9.0.4/jdk/j
> re/lib/fonts");
> //No Difference
> 
> Graphics2D  g2d = template.createGraphics(width, height, fontMapper);
>                     
> template.setWidth(width);
> template.setHeight(height);
> g2d.translate(printPageFormat.getImageableX(), 
> printPageFormat.getImageableY());
> g2d.setClip(0, 0, (int) printPageFormat.getImageableWidth(), (int)
> printPageFormat.getImageableHeight());
> g2d.setPaint(Color.black);
>                     
> Font font = g2d.getFont();
> //g2d.setFont(new Font("Arial Unicode MS", Font.PLAIN, 12));  
>                   
> g2d.setFont(new Font("MS UI Gothic", Font.PLAIN, 12));
>                     
> 
> report.renderPage(g2d, j);
> g2d.dispose();
> contentByte.addTemplate(template, 0, 0);
> document.newPage();
> contentByte.reset();
> 
> appreciate any response if some one has come across.. 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, 
> discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to