Get X,Y cordinates of word/text on PDF

2 posts, 0 answers
  1. André
    André avatar
    2 posts
    Member since:
    Dec 2016

    Posted 26 Mar Link to this post

    Hi,

    I need to build a solution to export text from PDF including their X,Y cordinates. 

    Could it be done with PDFViewer or other Telerik product?

    Best regards,
    André

  2. Tanya
    Admin
    Tanya avatar
    833 posts

    Posted 28 Mar Link to this post

    Hi André,

    You can traverse the content of a PDF document and check only the elements containing text using the PdfProcessing library. What you would need to do is to import the document and then iterate through all the Content of each RadFixedPage:
    foreach (var page in this.pdfDocument.Pages)
    {
        foreach (var item in page.Content)
        {
            var textFragment = item as Telerik.Windows.Documents.Fixed.Model.Text.TextFragment;
            if (textFragment != null)
            {
                var position = textFragment.Position;
            }
        }
    }

    Hope this is helpful.

    Regards,
    Tanya
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top