Hi All,
I am using Aspose.Pdf dll to generate PDF document.I am getting the issue that “Invalid index in Rows indexer: 0” while generating the PDF.
Where I am getting Issue/Error:
There is a table with many number of rows while generating PDF. Its a for loop to add each row with data in table. Here I am using fontsize 11 to display the text in each row table. The issue is getting here that “Invalid index in Rows indexer: 0” randomly. But not frequently. If I reduce the font size to some 5 number down, then its working without any issue. some code snippet is pasting here. I hope you all understood the issue.
row = pdfTableResourceTeam.Rows.Add();
Cell cellRole = row.Cells.Add();
Text textRole = new Text(teamMemberTable.Rows[count][“Role”].ToString());
Aspose.Pdf.TextInfo txtinfoRole = textRole.TextInfo.Clone() as Aspose.Pdf.TextInfo;
txtinfoRole.FontSize = 8;
txtinfoRole.Color = col;
textRole.TextInfo = txtinfoRole;
cellRole.Paragraphs.Add(textRole);
Any fix for this? Any solution for this defect?
Please help me.
Thanks and Regards
Prathap Reddy
Hello Prathap,
Hi Nayyer Shahbaz,
Thanks for your reply.
The number of rows are 15. It may increase or decrease based on data.
The content in the cell is simple text. The text does not contain number of line. Its just name of person.
Font size is 11.
Not possible to share the code. The sample snippet is already placed in my first post. Check the same.
If I change the font then its working. Its generating PDF file. But I don’t want to change the font size. All text in PDF should be in the same font size. that is 11.
Any help?
Thanks and Regards
Prathap
Hello Prathap,
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
// create section obejct and add it to pdf document
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();
Aspose.Pdf.Generator.Table pdfTableResourceTeam = new Aspose.Pdf.Generator.Table();
// set the column width information for table cells
pdfTableResourceTeam.ColumnWidths = “50”;
// set the border style for table object
pdfTableResourceTeam.Border = new Aspose.Pdf.Generator.BorderInfo((int)BorderSide.All,0.3f);
pdfTableResourceTeam.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)BorderSide.All, 0.3f);
// add the table to paragraphs collection of section
section.Paragraphs.Add(pdfTableResourceTeam);
for (int i = 0; i < 15; i++)
{
Aspose.Pdf.Generator.Row row = pdfTableResourceTeam.Rows.Add();
Cell cellRole = row.Cells.Add();
Text textRole = new Text(“Role-text”);
Aspose.Pdf.Generator.TextInfo txtinfoRole = new Aspose.Pdf.Generator.TextInfo();
txtinfoRole.FontSize =11;
txtinfoRole.Color = new Aspose.Pdf.Generator.Color(“Blue”);
textRole.TextInfo = txtinfoRole;
cellRole.Paragraphs.Add(textRole);
}
// save the reusltant Pdf file
pdf.Save(@“D:\pdftest\Sample_table.pdf”);
Hi Nayyer Shahbaz,
Thank you for your time and information.
Even I am getting the issue randomly but not always. My PDF file is having different sections with large data. I am not sure whether this issue will get for small PDF file generation.
I am using Aspose.Pdf dll version is 5.0.1.0. Is this issue because of using old version dll which may have this bug. Any idea on this? Meanwhile I will download latest Aspose.Pdf.dll and will test my issue. I will update you on this.
Thanks and Regards
Prathap
Hin Prathap,
Hi,
New version also does not work for my issue. Any other ideas?
Thanks and Regards
Prathap
Hi Prathap,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for the feedback.
However, as mentioned by Nayyer, we are not able to reproduce your issue at our end. Please create a sample application to reproduce the issue and post it here. This will help us reproduce the issue and rectify it.
Also, please share the details regarding your system environment i.e. OS, .NET Framework, 32 bit or 64 bit processor etc. so we can test your issue according to your system environment.
Sorry for the inconvenience,
Hi,
Hi Prathap,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
<o:p> </o:p>
Thank you for the details and sample application.<o:p></o:p>
<o:p> </o:p>
I am able to reproduce your mentioned issue after an initial test
using your sample application. For further investigation and rectification, I
have created an issue in our issue tracking system with issue id: PDFNEWNET-33761. Our development team
will further look into the cause of the exception. I will notify you via this
forum thread regarding any updates against your issue.<o:p></o:p>
<o:p> </o:p>
Sorry for the inconvenience,<o:p></o:p>
Hi Nausherwan,
Hi John,
Thanks for your inquiry.
I have verified the status of this issue from our issue tracking system and regret to share that this issue is still unresolved and currently is pending for analysis. Moreover, I am very sorry to share with you that you cannot track the status of logged issues in our issue tracking system. Issues can be tracked internally. You can get the status of logged issues using forum threads.
Please feel free to contact support in case you need any further assistance.
Thanks & Regards,
Hi John,
I had a similar problem (same exception) and switching to version 6.7.0 has solved it.
Daniel
Hi Daniel,
Thanks for using our products and sorry for replying you late.
Our development team is working on this issue and you will be updated as soon as it is resolved. We are really sorry for this inconvenience.
Thanks & Regards,
G’day Rashid,
Hi Matt,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I am afraid; the issue is still not resolved. However, I have requested the development team to share an ETA regarding the resolution of this issue. As soon as I get a feedback, I will update you via this forum thread.
Sorry for the inconvenience,
Hi,
Any fix for this issue? Please let me know.
Thanks and Regards
Prathap
Hi Prathap,
Any Fix for given Issue....
Thanks,
Vijay
Hi Vijay,