prsam Posted February 2, 2007 Share Posted February 2, 2007 I need to open a PDF document with ean13.ttf font.If I used this:Code:FontKey key = new FontKey("ean13", false, false); //(String fontName, Boolean bold, Boolean italic)PdfFont font = new PdfFont("C:\WINDOWS\Fonts\ean13.TTF",BaseFont.IDENTITY_H,true); //(String pdfFontName, String pdfEncoding, Boolean isPdfEmbedded)fontMap.put(key,font);JRPdfExporter exporter = new JRPdfExporter();exporter.setParameter(JRPdfExporterParameter.CHARACTER_ENCODING, "UTF-8"«»);exporter.setParameter(JRPdfExporterParameter.FONT_MAP, fontMap);JasperReport jasperReport = getCompiledReport(reportFileName);JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, fontMap, conn);exporter.setParameter(JRPdfExporterParameter.JASPER_PRINT, jasperPrint);exporter.setParameter(JRPdfExporterParameter.OUTPUT_FILE_NAME, "C:\testean13.pdf"«»);exporter.exportReport();I got the pdf document, but it is saved.How can I open this file directly? I tried several times, with differents code (generatePDFOutput, bytes...), but I never got what I need - the part with ean13.ttf font is always missing, I see only the letters and no ean13 code... Link to comment Share on other sites More sharing options...
christiaan_se Posted February 2, 2007 Share Posted February 2, 2007 Hi, not sure what you mean, are you talking about opening and modifying an existing pdf file or do you want to generate a pdf file based on a jasper reports. JasperReports is not meant for the first option, you should use something like the iText library. kind regards,Christiaan Link to comment Share on other sites More sharing options...
prsam Posted February 5, 2007 Author Share Posted February 5, 2007 Yes, I was asking about generating a pdf file based on a jasper reports - I put a wrong word in a question.But, I find a solution... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now