When the code goes to absorber.Visit(pdfDocument.Pages[1]); always give me a error,such as index out of range ,internal error.
Hi there,
Hi Tilal,
I too facing the same problem when trying to extract the pages from the PDF
Below is the sample code
static void Main(string[] args)
{
// load existing PDF file
Document pdfDocument = new Document(“sample5.pdf”);
// Create TableAbsorber object to find tables
TableAbsorber absorber = new TableAbsorber(); // Index out of range error occurring here
absorber.Visit(pdfDocument.Pages[2]);
foreach (var table in absorber.TableList)
{
foreach (var row in table.RowList)
foreach (var cell in row.CellList)
foreach (var txt in cell.TextFragments)
Console.WriteLine(txt.ToString());
}
}
Sample5.pdf is a multi page PDF with tables embedded
Thanks in Advance
Ravi
Hi Ravi,
Hi Nayyer,
Thanks for your reply.
The below code which am using to visit the pages
// load existing PDF file
Document pdfDocument = new Document(“sample4.pdf”);
// Create TableAbsorber object to find tables
TableAbsorber absorber = new TableAbsorber();
absorber.Visit(pdfDocument.Pages[2]);
Am able to visit all the pages when am using Textfragmentabsorber. The issue is only when am using Tableabsorber.
Please find the attached pdf that i used for extracting the pages
Also please find the stack track below which i observed
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List1.get_Item(Int32 index)<br> at Aspose.Pdf.Text.TableAbsorber. (List
1 )
at Aspose.Pdf.Text.TableAbsorber.Visit(Page page)
at PDFAbsorber.Program.Main(String[] args) in c:\Users\rkumar\Documents\Visual Studio 2012\Projects\PDFAbsorber\PDFAbsorber\Program.cs:line 28
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Hi Ravi,
notice the same problem. For the sake of correction, I have logged this problem
as PDFNEWNET-39715 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. Please be patient and spare us little time. We are sorry
for this inconvenience.
Hi Nayyer,
Thanks for the info. I’ll wait for your update on this
Regards,
Ravi
I am experiencing the same issue regardless of the page #. Please let me know when there is a fix.
Hi Nayyer,
Hi Jim,jim.fisher:
I am experiencing the same issue regardless of the page #. Please let me know when there is a fix.
Hi Ravi,ravikaranam27:
It seems like lot of facing the same problem. If you could give a quick solution or a patch it would be of great help
Hi Ravi,ravikaranam27:
It seems like lot of facing the same problem. If you could give a quick solution or a patch it would be of great help
Hi Nayyer,
Attached is the request PDF sample.
Hi Jim,jim.fisher:
Attached is the request PDF sample.
Hi Nayyer,
Hi Ravi,
It’s been a little over a month, do you have any updates?
Hi Jim,
Month #2 … Any update? Any guesses for a timeframe?