I am trying to extract the text from the pdf (attachment link) with the code (lib itext7) below:
public static PageDescribe GetTextFromPage(PdfDocument fullDoc, int pageNum)
{
if (pageNum < 1)
return null;
else
{
PdfPage page = fullDoc.GetPage(pageNum);
if (page == null)
return null;
else
{
LocatedTextStrategy lStrat = new LocatedTextStrategy();
string s = PdfTextExtractor.GetTextFromPage(page, lStrat,);
DateTime _startPoint = DateTime.Now;
lStrat.Points.Defragmentation();
PageDescribe _res = new PageDescribe(pageNum, lStrat.Points);
return _res;
}
}
}
}
but i get the error Cannot find image data or EI :
If I Manually remove the initial logo of the pdf this error does not occur. But I can not change the source system that provides this files.
Anyone have any suggestions?