Answer the question
In order to leave comments, you need to log in
Is it possible to somehow optimize pdfreader itextsharp?
There is a method that many times, using rectangle, reads text from different pages of a pdf document. Accordingly, the larger the file, the slower everything is processed, I tried to use parallel.foreach, but it didn’t work out much, everything seems to rest on pdfreader.
The method is something like this:
var lst = new ConcurrentBag<Test3>();
using(var reader = new PdfReader(byteArr))
{
Parallel.Foreach(areas, t =>
{
var pageSize = reader.GetPageSize(t.PageNumber);
var rectangle = GetRectagle(t.AreaData, pageSize);
var text = GetTextFromRectangle(reader, rectagle, t.PageNumber);
lst.Add(text);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question