How to Extract text with format from PDF or XPS using C#?
I have some PDF/XPS files which are generated by another reporting software. The file mainly includes tables which list some data.
iText can extract the text from the pdf files, but then lost some format, for example, for below table, the extracted text is:
Faults
Count FMI Lookup Code Description Component Status
Active Body Controller Heating Ventilation/Air Conditioning (HVAC) Control
Head Air Inlet DM1. HVAC motor in wrong position or
jammed
SPN 3984 2 126
Active Engine SAE - Catalyst 1 System Monitor - Root cause not known SID 380 11 N/A
Inactive Engine SAE - Crankcase Pressure - Data valid but above normal
operational range - Most severe level
PID 101 0 N/A
Inactive Engine SAE - Crankcase Pressure - Data erratic, intermittent or
incorrect
PID 101 2 N/A
The problem is the text in different columns are on the same line, which makes it almost impossible to know exactly which text is for which column. And unfortunately, I need to save data in different columns to different field in database.
I also tried to convert the PDF to html, but then found that html does not include the actual text, which uses SVG in the html. So I could not get actual text.
Is there a way to do this using C#? Any suggestions? Any library, better free ones?
Thanks

