Hi, i have some problem when i get TextArea from this code:
When i run this script in Windows 10 Platform - LinqPad:
using (var document = PdfDocument.Open(FACTURA_AFIP.pdf))
{
for (var i = 1; i <= document.NumberOfPages; i += 4)
{
// For PDF coordinates the y-axis runs from the bottom of the page up
var bottomLeft = new PdfPoint(479, 149);
var topRight = new PdfPoint(559, 159);
var square = new PdfRectangle(bottomLeft, topRight);
var page = document.GetPage(i);
var letters = page.Letters.Where(x => square.IntersectsWith(x.GlyphRectangle)).ToList();
var wordsInRegion = DefaultWordExtractor.Instance.GetWords(letters);
var textInRegion = string.Join(" ", wordsInRegion.Select(x => x.Text).ToList());
textInRegion.Dump();
}
}
Result:
72515176735833
but the same Script in Linux Ubuntu 20.04 - dotnet-script:
N°: 72515176735833
Why do Windows and Linux show different results?
Upload the PDF file form more detail.
FACTURA_AFIP.pdf
Hi, i have some problem when i get TextArea from this code:
When i run this script in Windows 10 Platform - LinqPad:
Result:
72515176735833
but the same Script in Linux Ubuntu 20.04 - dotnet-script:
N°: 72515176735833
Why do Windows and Linux show different results?
Upload the PDF file form more detail.
FACTURA_AFIP.pdf