Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8084673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:52:02+00:00 2026-06-05T17:52:02+00:00

How to use the ABCPdf.NET tool to extract the content texts from a PDF

  • 0

How to use the ABCPdf.NET tool to extract the content texts from a PDF file?

I tried the GetText method but doesn’t extract the contents:

var doc = new Doc();    

        var url = @".../FileName.pdf";

        doc.Read(url);

        string xmlContents = doc.GetText("Text");
        Response.Write(xmlContents);
        doc.Clear();
        doc.Dispose();

My pdf has almost 1000 words but the GetText only returns 4-5 words. I realized it returns only the texts of the first page.

So the question should be “how to extract the text from all pages of a pdf file?” -(changed the Title to make it clearer).

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:52:04+00:00Added an answer on June 5, 2026 at 5:52 pm

    For your benefit, yes you!

     public string ExtractTextsFromAllPages(string pdfFileName)
        {
            var sb = new StringBuilder();
    
            using (var doc = new Doc())
            {
                doc.Read(pdfFileName);
    
                for (var currentPageNumber = 1; currentPageNumber <= doc.PageCount; currentPageNumber++)
                {
                    doc.PageNumber = currentPageNumber;
                    sb.Append(doc.GetText("Text"));
                }
            }
    
            return sb.ToString();
        }
    

    if you don’t have the url but have the bytes, then:

    public string ExtractTextsFromAllPages(Byte[] pdfBytes)
        {
            var sb = new StringBuilder();
    
            using (var doc = new Doc())
            {
                doc.Read(pdfBytes);
    
                for (var currentPageNumber = 1; currentPageNumber <= doc.PageCount; currentPageNumber++)
                {
                    doc.PageNumber = currentPageNumber;
                    sb.Append(doc.GetText("Text"));
                }
            }
    
            return sb.ToString();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following acceptance criteria for creating a pdf file from my asp.net
We use ABCPDF to convert a HTMl page to a PDF. Everything works fine,
I have a command-line process that creates a PDF file from an HTML file
I am using ABCPDF to print a PDF file to a local printer via
I would like to use abcPDF (.net) generator to output a stream of data
use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
use this website a lot but first time posting. My program creates a number
use Service layer to persist data into database. But the Unit Test does not
Use of java.net.URLConnection is asked about pretty often here, and the Oracle tutorial is
Use a Content Delivery Network (CDN) Compress components with gzip Configure entity tags (ETags)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.