I have a requirement where I have to generate a pdf of 10-15 data sections.
My implementaion is : 1) Getting the string (in xml format) from each data section
2) Appending each sections one by one to a StringBuffer
3) Calling pdf.bindXml(fullString).
During bindXml I am getting the exception "java.lang.IndexOutOfBoundsException: Invalid index in Rows indexer: -1" where as I am able to create the individual pdf file if I am creating individually for each data section. All the data are dynamically getting populated.
Can you please share some sample XML files and the code snippet that you are using so that we can test the scenario at our end. We apologize for your inconvenience.
I have a XML file. I am reading this file and getting the data in a string(which is in xml format) and after that I am writting this in the pdf.
Attaching the XML file.
Snippet :
Pdf pdf = new Pdf(); String medFile = “C:\AsposeTest\config\test\DataInXMLFormat.xml”; String pdfXml = getContents(new File(medFile)); pdf.bindXML(new StringBufferInputStream(pdfXml.toString()), null); pdf.save(“C:\AsposeTest\config\test\OutPut.pdf”); System.out.println(“Aspose PDF is saved successfully”);
Full stack trace what I am getting in exception : log:messageError in Aspose PDF Generation</log:message> log:throwablejava.lang.IndexOutOfBoundsException: Invalid index in Rows indexer: -1 at aspose.pdf.Rows.getRow(SourceFile:163) at aspose.pdf.xml.Acf.a(SourceFile:2719) at aspose.pdf.xml.Acf.a(SourceFile:1432) at aspose.pdf.xml.Acg.a(SourceFile:481) at aspose.pdf.xml.Aca.a(SourceFile:763) at aspose.pdf.xml.Aaq.a(SourceFile:105) at aspose.pdf.xml.Aaz.a(SourceFile:112) at aspose.pdf.Pdf.save(SourceFile:911)
I have tested the scenario and I am able to notice the problem. However in order to figure out the exact reasons of this problem, I need to further investigate it. Please spare us little time and we will get back to you soon. We are sorry for this inconvenience.
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.
Enables storage, such as cookies, related to analytics.
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.