Jump to content
Changes to the Jaspersoft community edition download ×

How can I open a PDF document directly


prsam

Recommended Posts

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...