How to replace text in PDF and specify page range by command line?

VeryPDF PDF Text Replacer Command Line version has been developed based on the functions of GUI version. Through this version, you can do text search and replace by command line accurately and easily. In this article, I will show you how to replace text in specified page range by command line.

tryme                                          buyone$79.95

Step 1. Download and Install

  • This software is command line version, for facilitating uploading and downloading, we have compressed it to zip file. After downloading, please extract the zip file to some folder then you can use it normally.
  • After extracting it to folder, you will find that there are some bat files for testing effect easily,  readme.txt for knowing parameters and usage easily and an encoding folder which contains software combining elements.

Step 2. Replace Text Following Examples

  • Please check usage here:

Usage: pdftr.exe [options] <Input-file> <Output-file>
Examples:

    • When you need to simply replace text in the whole PDF pages, please refer to the following command line. The following snapshot is from the command line practice option. When the replacing finishes, there will be detail replacing information showed in the following part. By this way, you do not need to open the output PDF then you can judge whether the replacing succeeds or not.
      pdftr.exe -contentreplace "My Name=>Your Name" D:\in.pdf D:\out.pdf

-contentreplace <string>      : replace text in page content objects directly
command line example

  • When you need to replace text in some specified page range, please refer to the following template.
    pdftr.exe -pagerange 1-3 -contentreplace "Old Text=>New Text||VeryPDF=>VeryDOC||My Name=>Your Name" D:\in.pdf D:\out.pdf
    -pagerange <string>           : set page range for replace words, search words, e.g., 1,3-5,7.
    Specifying page range, for one thing it can enhance the replacing speed, say there are thousands of pages in some PDF, this parameter can help you narrow the searching page range then replace them; for another thing, it can enhance degree of accuracy.
    As the command line usage is a little complicated, please obey the rule or else the replacing may fail.

As there are too many parameters, I can not list all of them here. If you need to know more, please check them on our website or in the readme.txt file.

By this software, there is no limit of adding file size. Even if you add thousands pages PDF file, this software can help you replace text by command line in a few seconds. Now let us check the replacing effect from the following snapshot. During the using, if you have any question, please contact us as soon as possible.

reaplce text effect

 

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

This entry was posted in PDF Editor and tagged , . Bookmark the permalink.

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!