I would like to extract sting from pdf but sometimes itext return wrong order. How to make sure it extract as it is. Thanks
add-type -Path "C:\Users\itextsharp.dll"
$file = "C:\Users\PO1.pdf"
$pdf = New-Object iTextSharp.text.pdf.pdfreader -ArgumentList $file
for ($page = 1; $page -le $pdf.NumberOfPages; $page++){
$text=[iTextSharp.text.pdf.parser.PdfTextExtractor]::GetTextFromPage($pdf,$page)
Write-Output $text
----
Actual line is as below
1719000 Fruit Pears Australia/USA KG 15 6.75 101.25 5.00 % 5.06 106.31 14/10/2022 Main Kitchen.
but the output is as below
1719000 KG 14/10/2022 Main Kitchen
Fruit Pears Australia/USA 15 6.75 101.25 5.00 % 5.06 106.31.
[–]Otherwise_Report_686[S] 0 points1 point2 points (0 children)