Replace text to image in PDF and specify image width and height

  VeryPDF PDF Text Replacer Command Line not only can be used to replace text by text  in PDF file. It also can be used to replace text by image and it allows you to specify the image width and height.  By this function, you do not worry that image size is too big to be displayed properly in the output PDF. In the following part, I will show you how to use this software.

Step 1. Download PDF Text Replacer

  • There are two versions PDF Text Replacer: GUI version and command line version. Both of two version can be used to replace text by image but in this article, I will take the command line version for example.
  • Once downloading finishes, there will  be a zip file in the downloading folder. Please unzip it to some folder then you can find the executable file and find the parameter list.

Step 2. Replace Text by Image

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

  • When you need to simply replace text by text, please refer to the following command line.
    pdftr.exe -contentreplace "My Name=>Your Name" D:\in.pdf D:\out.pdf
    -contentreplace <string>      : this parameter is an order to replace text in page content objects directly
  • When you need to replace text by image singly, please refer to the following template.
  • pdftr.exe -oldtext "Old Text" -image D:\test.png D:\in.pdf D:\out.pdf
    Please note the image file format only can be one of the following three file formats:JPEG, PNG and TIFF
    -oldtext <string> :this parameter is an order to specify text to replace
    -image <string> : this parameter is an order to specify image to replace with, support JPEG, PNG and TIFF

  • Here come to the key point. When we need to replace text by image and specify the image width and height, please refer to the following templates.
  • pdftr.exe -oldtext "Old Text" -image D:\test.png -imgwidth 20 -imgheight 50 D:\in.pdf D:\out.pdf
    pdftr.exe -oldtext "Old Text" -image D:\test.png -imgwidth -1 -imgheight -1 D:\in.pdf D:\out.pd
    -imgwidth <int>   : set width for the new image, unit: pixel, default is 0 for auto, -1 for full image width
    -imgheight <int>  : set height for the new image, unit: pixel, default is 0 for auto, -1 for full image height
    Note: please pay attention to the value:
    0: default or set width or height automatically.
    -1: for full image width or height

    Now let us make field practice in the MS Dos Windows. All the replacing detail information will be shown in the MS Dos Windows.
    MS Dos Replacement 

  • Now let us check the replacing effect.
    input PDF and output PDF

During 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

This entry was posted in PDF Text Replacer 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!