How to replace text in PDF by original font style by command line?

    In the market, there are lots of software which can be used to replace text in PDF. However, most of them can not keep original font style in the newly input text. So it will be a little weird and you can find which part has been changed easily. In this article, I will show you one method of replacing text in PDF with original font style in PDF. Then the replacing effect could be perfectly harmonious.

  I use software VeryPDF PDF Text Replacer, which can be used to replace specified text in specified positions of pages, with text or images. And there are two versions of this software: GUI version and command line version. In this article, I will show you the command line version.

Step 1. Download PDF Text Replacer Command Line

  • Now this command line version sells at $79.95, which you can use it the whole life without any fee. And before buying, you can try it free tens of times.
  • Once downloading finishes, please extract it to some folder then call the executable file in MS Dos Windows.

Step 2. Replace text by command line

  • Please obey rule when using this software. Here is the usage for your reference:  pdftr.exe [options] <Input-file> <Output-file>
  • Please note this software only can replace text in text  based PDF file. When replacing text in image PDF, it will fail. As to how to judge image PDF and text PDF, please open it and try copy and paste. If you can be copied and pasted successfully, then use this software.
  • When replace text by original text style, please refer to the following command line template.
    pdftr.exe -contentreplace "My Name=>Your Name" D:\in.pdf D:\out.pdf
    By this command line, please use parameter -contentreplace then input original text and replaced text. At last,please input the full path of the input PDF and output PDF.
  • Please note that there are three modes for replacing text in PDF, which lead by the following three parameters:
    Mode 1: -contentreplace <string>      : this mode can help you replace text in page content objects directly
    Mode 2: -searchandoverlaytext <string>: this mode allows you to search text first then overlay text with specified mode and style to PDF pages
    Mode 3: -oldtext <string>: this mode allow you to  specify text to replace
  • When you need to replace text in PDF by original font style, please choose mode 1.

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.

input PDF and output PDF

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!