You must Sign In to post a response.
  • Category: .NET

    How i get specific text coordinates from existing pdf file with itextsharp

    Hi all. I want to get coordinates a specific text from existing pdf file with itextsharp. i search for this issue on google but i'm only find C# code and i can't convert to vb.net. It's important for my project.If anyone solve this issue please post code in this thread. Thanks for help.
  • #768274
    Hi,

    Instead of ITextSharp try to use FreeSpire.PDF from Nuget packages it will help to solve your problem.
    It is a free ware and also we have lots of advantages than ItextSharp. No Abode installation required for this Package with Adobe it will work.

    Kindly check the below forum for more details.

    http://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-Text-to-PDF-with-C-VB.NET.html

    Thanks,
    Mani

  • #768319
    Yes, you can use Free Spire.PDF, it supports to get coordinates as well as height and width of the specific text.

    You can download its Nuget package from https://www.nuget.org/packages/FreeSpire.PDF/.

    Below code for your reference:

    'Load the PDF file
    Dim doc As New PdfDocument()
    doc.LoadFromFile("E:\Program Files\Sample.pdf")
    Dim result As PdfTextFind() = Nothing
    For Each page As PdfPageBase In doc.Pages
    'Find the text
    result = page.FindText("PDF").Finds
    'Get the coordinate of text
    For Each text As PdfTextFind In result
    Dim p As PointF = text.Position
    Console.WriteLine(p)
    Next
    Next


  • Sign In to post your comments