I have to extract text from a pdf doc within a specific rectangular region. The work-flow is as following. First of all pdf is converted to an jpg image. Then user draws selection rectangle on top of the picture. Then I somehow need to extract all text from pdf doc within that selection region. Any suggestions what freeware pdf libs accessible from C# to use?
Open a PDF file containing a scanned image in Acrobat for Mac or PC. Click on the “Edit PDF” tool in the right pane. Acrobat automatically applies optical character recognition (OCR) to your document and converts it to a fully editable copy of your PDF. Click the text element you wish to edit and start typing.
Once you've opened the file, click on the "Edit" tab, and then click on the "edit" icon. Now you can right-click on the text and select "Copy" to extract the text you need.
You can capture text from a scanned image, upload your image file from your computer, or take a screenshot on your desktop. Then simply right click on the image, and select Grab Text. The text from your scanned PDF can then be copied and pasted into other programs and applications.
Open Reader and navigate to the document page you want to have read aloud. From the top left menu, click View, then Read Out Loud. You can choose to have the whole document read aloud or just the page you're on. Select either Read to End of Document or Read This Page Only, respectively.
this code will perfectly extract pdf data on the basis of rectangular coordinates using itextsharp
List<string> linestringlist = new List<string>();
PdfReader reader = new PdfReader(pdfFilename);
iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(coordinate1, coordinate2, coordinate3, coordinate4);
RenderFilter[] renderFilter = new RenderFilter[1];
renderFilter[0] = new RegionTextRenderFilter(rect);
ITextExtractionStrategy textExtractionStrategy = new FilteredTextRenderListener(new LocationTextExtractionStrategy(), renderFilter);
string text = PdfTextExtractor.GetTextFromPage(reader, 1, textExtractionStrategy);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With