Hi, I am reading a xml file and creating a pdf from it. When the line number of the file is more than 6,00,000 (approx) the pdf.save getting stuck without any exception.
Do you have any limit of the file size which Aspose can support to generate the PDF ? If Yes please let me know the line numbers or the file size.
Code template :
Pdf pdf = new Pdf(); String inputFile = “C:\ziptest\jira1271\bulk-xml-1271.xml”; String data = readFile(new File(inputFile)); pdf.bindXML(new StringBufferInputStream(data), null); pdf.save(“C:\AsposeTest\config\test\My_TEST_PDF_12.pdf”);
I am using Java Aspose 2.7.0. Here is a small stats about the time taken for pdf generation. Is the time taken Ok as per Aspose standard ?
I have tested the scenario using following XML file and code snippet and as per my observations when using Aspose.Pdf for Java 2.9.0, I am getting StackOverflowError when placing around 32000 rows inside PDF document. For the sake of correction, I have logged it as PDFJAVA-29159 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction.
However, can you please share the XML file and code snippet that you are using so that we can also test it in our environment. We are really sorry for this inconvenience.
[Java]
Pdf pdf = new Pdf(); pdf.bindXML("d:/pdftest/XMLFile1.xml", null); long begin = System.currentTimeMillis(); Section sec1 = pdf.getSections().getSection("Section1"); Table Section_Table = (Table) sec1.getParagraphs().getParagraph("Table1"); for(int i=0; i<=32000; i++) { Row New_Row = new Row(Section_Table); Cell Temp_Cell1 = New_Row.getCells().add("Sample Line..." +i ); Section_Table.getRows().add(New_Row); }
pdf.save("d:/pdftest/LargePDF_result.pdf"); long end = System.currentTimeMillis(); System.out.println("Document generated.....Total Time taken = " +(end-begin));
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.