I need to get base64 result in Jasperreport. Its working for me. For this i am using 2 steps.
- Save pdf in disc.
- Get base64 from saved pdf.
My problem is i want get the base64 result without write in desc.(need to skip step1 from the above).
This is my code
JasperReport jasperReport = JasperCompileManager.compileReport("D://PremWorkSpace/PdfCreation/myreport.jrxml");
HashMap reportMap = new HashMap<String, Object>();
reportMap.put("name", "Premkumar Manipillai");
JRDataSource dataSource = new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, reportMap, dataSource);
File outDir = new File("D:/PremWorkSpace/PdfCreation/");
outDir.mkdirs();
JasperExportManager.exportReportToPdfFile(jasperPrint, "D:/PremWorkSpace/PdfCreation/" + "Topup_Nach.pdf");
System.out.println("Report Saved!");
String base64ImageString = encoder("D:/PremWorkSpace/PdfCreation/" + "Topup_Nach.pdf");