1

I want to have my code find the xy position of text in a pdf or image, so that I can crop the image out, this is so that I can include any diagrams that the question includes in the question (which consists of an image that text is put on top of), I am currently using the EJ2.PdfViewer from syncfusion but I am happy to use other packages that are more useful for my purposes.

My test code for reference if it will help:

Imports System
Imports Syncfusion.EJ2.PdfViewer
Module Program
    Sub Main(args As String())
        Dim extraction As PdfRenderer = New PdfRenderer()
        extraction.Load("C:\math.pdf")
        Dim textCollection As List(Of TextData) = New List(Of TextData)
        Dim text As String = extraction.ExtractText(44, textCollection)
        Console.WriteLine(text)
    End Sub
End Module
LBloxo
  • 13
  • 4

1 Answers1

0

To get position of text in a pdf , you can use some libs:

To get position of text in a Image:

D T
  • 3,522
  • 7
  • 45
  • 89
  • Correct me if I a wrong, but from what I see the biggest problem with a couple of these is I believe I need to pay considerable money to use them over a long while. Because I need this to work for about 4-5 months, i'm not sure if it is an option. Spire only works for pdfs up to 10 pages, Google vision gives only $300 credit for 90 days. IText seems the most promising, but do I need to contact them directly to get the open source license? – LBloxo Oct 25 '22 at 03:11
  • Itext7 and Spire PDF both have free versions. – D T Oct 25 '22 at 03:13