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 6139675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:01:16+00:00 2026-05-23T18:01:16+00:00

While parsing page no. 22 of http://sfdoccentral.symantec.com/sf/5.1/linux/pdf/vxfs_admin.pdf , I am able to parse all

  • 0

While parsing page no. 22 of http://sfdoccentral.symantec.com/sf/5.1/linux/pdf/vxfs_admin.pdf, I am able to parse all the words except mount_vxfs as its encoding style and/or font is different than normal plain text.
Please find attached PDF Page for details.

Please find my code :-

`#!/usr/bin/perl
use CAM::PDF;
my $file_name="vxfs_admin_51sp1_lin.pdf";
my $pdf = CAM::PDF ->new($file_name);
my $no_pages=$pdf->numPages();
print "$no_pages\n";
for(my $i=1;$i<$no_pages;$i++){
my $page = $pdf->getPageText($i);
//for page no. 22
//if($i==22){ 
print $page;
//}
}`
  • 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-05-23T18:01:16+00:00Added an answer on May 23, 2026 at 6:01 pm

    PDF doesn’t store the semantic text that you read but rather uses character codes which map to glyphs (the painted characters) in a particular font. Often, however, the code-glyph mapping matches common character sets (such as ISO-8859-1 or UTF-8) so that the codes are human-readable. That’s the case for all of the text you have been able to parse, although sometimes the odd character, mostly punctuation, is also “wrong”.

    The text for “mount_vxfs” in your document is encoded completely differently, unfortunately, resulting in apparent garbage. If you’re curious, you can see what’s really there by substituting getPageText() with getPageContent() in your code.

    In order to convert the PDF text back to meaningful characters, PDF readers have to jump through hoops with a number of conversion tables (including the so-called CMaps). Because this is a lot of programming work, many simpler libraries opt not to implement them. That’s the case with CAM::PDF.

    If you’re just interested in parsing the text (not editing it), the following technique is something I use with success:

    1. Obtain xpdf (http://foolabs.com/xpdf) or Poppler (http://poppler.freedesktop.org/). Poppler is a newer fork of xpdf. If you’re using *nix, there will be a package available.

    2. Use the command-line tool ‘pdftotext’ to extract the text from a file, either page-wise or all at once.

    Example:

    #!/usr/bin/perl
    use English;
    my $file_name="vxfs_admin.pdf";
    
    open my $text_fh, "/usr/bin/pdftotext -layout -q '$file_name' - 2>/dev/null |";
    local $INPUT_RECORD_SEPARATOR = "\f";    # slurp a whole page at a time
    while (my $page_text = <$text_fh>) {
        # this is here only for demo purposes
        print $page_text if $INPUT_LINE_NUMBER == 19;
    }
    close $text_fh;
    

    (Note: The document I retrieved using your link is slightly different; the offending bit is on page 19 instead.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://support.xbox.com/en-us/contact-us uses javascript to create some lists. I want to be able to parse
While parsing the contents of a page I want to just list images, but,
i have following url structure http://www.mydomain.com/vpn-offers-p3.html this page should be redirect to http://www.mydomain.com/vpn-offers.php?st=60&page=3 here
I m using JSON and while parsing, i m getting the returned value as
I got this error An error occurred while parsing EntityName. Line 1, position 61.
I'm creating a DNS name resolver. While parsing the returned packet I read the
I am currently developing using the cxml-stp framework, but while parsing I do get
//$colspan is a number in a string (eg. $colspan=5 ). While parsing, sometimes it
Possible Duplicate: Parsing errors in awk blocks I am getting a parsing error while
I'm parsing HTML page with XPath and want to grab whole text of some

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.