xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From knoxorino <p...@knoxor.com>
Subject Re: Embeded Cyrillic Font still showing unicode chars .. HELP!!
Date Wed, 20 Feb 2008 13:50:40 GMT

Hi,

Thanks for the reply.

I'm using the one step approach (xml + xsl) although I'm not serializing the
xml file and using the javax.xml.transform.dom.DOMSource class to hold the
xml file.

My code is as follows:
 
           ByteArrayOutputStream out = new ByteArrayOutputStream();

          // add fonts for Russian and Chinese certificates
          String fontConfig = path + "fonts/fontcfg.xml";
	  FopFactory fopFactory = FopFactory.newInstance();
	  fopFactory.setUserConfig(fontConfig);
	  FOUserAgent foAgent = fopFactory.newFOUserAgent();
          //Setup FOP
          Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,foAgent , out);

          //Setup Transformer
          Source xsltSrc = new StreamSource(new File(xslFile));

          TransformerFactory tFactory = TransformerFactory.newInstance();
          Transformer transformer = tFactory.newTransformer(xsltSrc);

          //Make sure the XSL transformation's result is piped through to
FOP
          Result res = new SAXResult(fop.getDefaultHandler());

          //Setup input
          Document xmlDom = generateXml(certificate);
          Source domSrc = new DOMSource(xmlDom);          
          
	  //Start the transformation and rendering process
          transformer.transform(domSrc, res);

          //Prepare response
          response.setContentType("application/pdf");
          response.setContentLength(out.size());
          
          //Send content to Browser
          response.getOutputStream().write(out.toByteArray());
          response.getOutputStream().flush(); 


thanks
-- 
View this message in context: http://www.nabble.com/Embeded-Cyrillic-Font-still-showing-unicode-chars-..-HELP%21%21-tp15586777p15589463.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