Convert PDF to text and add page number by command line

When you need to convert PDF to text and add page number for easy checking by command line, maybe you can have a free trial of software VeryPDF OCR to Any Converter Command Line. Different with other PDF to Text Converter, this software was developed with advanced OCR functions, so even if handling image PDF, there is no problem. In the following part,  I will show you how to use this software.

Step 1. Download OCR to Any Converter Command Line

  • As this is command line version software, when downloading finishes, there will be a zip file. Please unzip it and then you can check elements in it and call the executable file in MS Dos Windows.
  • And please note this is Window application, now it can work under Mac and Linux system.

Step 2. Convert PDF to Text and add page number.

  • When you run the conversion, please refer to the usage and examples.
  • Usage:     ocr2any.exe [options] <PDF-file> <Text-file>
  • When you convert PDF to text and add page number in output text file, please refer to the following command line template. ocr2any.exe -text "PageText %PageNumber% of %PageCount%" C:\in.pdf C:\out.txt
    Related parameters:
  • -text <string>   : by this parameter, you can add additional text at end of each text page, this parameter supports the following variables:
        %PageNumber%: current page number
        %PageCount% : total page count of PDF file
    And when you run the conversion, please add parameters and values at first then input the full path of input PDF file and output text file.
    Now let us check the conversion effect from the following snapshot.

    input PDF file
                                               This is from input PDF file.

     output text file
                     This is from output text file.

  • When you need to convert PDF to text singly or in batch, please refer to the following command line templates.
  • ocr2any.exe C:\in.pdf C:\out.txt
    By this command line, we can convert text based PDF file to text.
    ocr2any.exe -firstpage 1 -lastpage 1 C:\in.pdf C:\out.txt
    By this command line, we can convert PDF to text and specify conversion page range.
    ocr2any.exe -ocr -res 300 C:\in.pdf C:\out.txt
    By this command line, we can convert image PDF to text and specify resolution.
    ocr2any.exe -ownerpwd 123 -userpwd 456 C:\in.pdf C:\out.txt
    By this command line, we can convert password protected PDF file to text.
    ocr2any.exe -layout C:\in.pdf C:\out.txt
    By this one, convert PDF to text and keep layout.
    ocr2any.exe -noc C:\in.pdf C:\out.txt
    When converting PDF to text and don't insert page breaks 0x0C between pages in text file, please use this command line.

If you need to check more parameters and examples, please check them in readme.txt. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!