Hi Team,
While generating PDF with Aspose, using temporary license we are unable to see complete data in the PDF generation and unable to find any error in the server logs, below is the message we are getting.
This document was truncated here because it was created in the Evaluation Mode.
Code:
com.aspose.pdf.License license = new com.aspose.pdf.License();
inputStream = getClass().getClassLoader().getResourceAsStream(“Aspose_Total.lic”);
license.setLicense(inputStream);
public void generatePDF(String xmlFile, String rtfFile, String pdfName,String protectionPassword) {
logger.info(“Enter in generatePDF(): rtfFile: {}, pdfName: {}”,rtfFile,pdfName);
new RTFGeneratorHelper().setAsposeLicense();
InputStream rtfStream = null;
InputStream xmlStream = null;
DataSet ds = null;
try {
File file = new File(rtfFile);
if (file.exists()) {
rtfStream = new FileInputStream(file);
com.aspose.words.Document doc = new com.aspose.words.Document(rtfStream);
//ObjectMapper om = new ObjectMapper();
//System.out.println(om.writeValueAsString(doc));
String fontFolder = System.getProperty("FONT_FOLDER");
// System.out.println("---------------------------------- fontFolder “+fontFolder);
logger.info(”---------------------------------- fontFolder : {} ",fontFolder);
if(fontFolder != null){
FontSettings fs = FontSettings.getDefaultInstance();
fs.setFontsFolder(fontFolder, false);
doc.setFontSettings(fs);
}
String localeCode= (String) RequestContext.getObject(RequestContext.LOCALE_ID);
if(null != localeCode && localeCode.equals("zh_CN"))
{
FontSettings fs = FontSettings.getDefaultInstance();
URL url = getClass().getClassLoader().getResource("fonts");
fs.setFontsFolder(url.toURI().getPath(), false);
fs.setDefaultFontName(arialUnicodeFont);
doc.setFontSettings(fs);
}
logger.info("end generatePDF()");
} catch (Exception e) {
logger.error("Error in generatePDF()");
e.printStackTrace();
throw new RuntimeException(e.getMessage());
} finally {
try {
if (ds != null)
ds.close();
} catch (Exception e) {
ds = null;
}
try {
if (rtfStream != null)
rtfStream.close();
} catch (Exception e) {
rtfStream = null;
}
try {
if (xmlStream != null)
xmlStream.close();
} catch (Exception e) {
xmlStream = null;
}*/
}
}
Can you please help us to proceed further to generate entire rows as we can see only 20k rows where we have 50k rows in the database.
Appreciate your help.