(Text translated). Good afternoon. Help me please. I’m trying to extract data from a PDF file with text slam. I use the library itextsharp.dll. Everything works, but there is one problem. I attached a photo of the table where the data is coming from. In the first column, the name wraps to the next line. Tell me a way how can I write in PS so that the name is on one line.
PS:
Add-Type -Path C:\temp\serg\PDF\itextsharp\lib\itextsharp.dll
Add-Type -Path C:\temp\serg\PDF\bouncycastle\lib\BouncyCastle.Crypto.dll
try { Add-Type -Path “C:\temp\serg\PDF\itextsharp\lib\itextsharp.dll” }
catch { $_.Exception.LoaderExceptions }
$pdf = ‘C:\temp\serg\PDF\test.pdf’
$pdfreader = [iTextSharp.text.pdf.pdfreader]::new($pdf)
$text = [iTextSharp.text.pdf.parser.PdfTextExtractor]::GetTextFromPage($pdfreader, 1)
$pdfreader.Close()
$string = $Text
$string.Remove($string.IndexOf(‘Руководитель организации’))
($string -split “1 1а 2 2а 3 4 5 6 7 8 9 10 10а 11”)[1]
PS answer:
Аджисепт с медом и — 796 шт 2,00 89,81 179,62 без 10% 17,96 197,58 356 Индия 10131010/131
лимоном акциза 020/0109374
д/рассасывания Таб.
Х24
Аллапинин 25мг Таб. — 796 шт 4,00 494,38 1 977,52 без 10% 197,75 2 175,27 — — —
Х30 (R) акциза
Аркоксиа 90мг Таб. — 796 шт 1,00 410,80 410,80 без 10% 41,08 451,88 528 Нидерланды 10607120/110
п/пл/об. Х7 акциза 620/0020073/2
Аторвастатин- Тев — 796 шт 3,00 216,35 649,05 без 10% 64,91 713,96 376 Израиль 10607120/250
а 20мг Таб. п/пл/об. акциза 620/0022323/1
Х30 (R)