[VeryPDF Release Notes] VeryPDF Releases PDF Text Replacer Command Line software

VeryPDF has released PDF Text Replacer Command Line software today, this powerful command line application will allow you to replace text contents in PDF pages quickly.

PDF Text Replacer Command Line has following features,

  • Support page range for search keywords
  • Able to replace more keywords at one time
  • Able to open password protected PDF files
  • Able to search text in PDF pages and show the text position and result for the found information
  • Able to uncompress the PDF file, this function is useful to debug the PDF file
  • Able to replace the text in PDF page content objects directly
  • Able to overlay text or image to each found text string
  • Able to specify font name, font size, text color, background color for overlay text contents
  • You can overlay image to the found keywords, the width and height of image can be calculated automatically

The following are examples about how to use PDF Text Replacer Command Line application,

灯泡 pdftr.exe -searchtext "PDF Editor" verypdf.pdf

image

-searchtext parameter will search “PDF Editor” in verypdf.pdf document, it will output following information to console,

X:\>pdftr.exe -searchtext "PDF Editor" verypdf.pdf
===== Search keyword in page 1 =====
[16.16, 283.87, 63.47, 294.89] 'PDF Editor'
[471.69, 378.41, 507.77, 387.59] 'PDF Editor OCX Control (ActiveX)'
===== Search keyword in page 2 =====
[93.80, 5.35, 128.13, 14.60] 'PDF Tools, PDF Converter, PDF Editor, PDF Creator,
PDF Printing Assistant'
[222.66, 688.15, 277.80, 700.86] 'PDF Editor'
[222.66, 703.87, 258.74, 713.06] 'PDF Editor is a powerful PDF application. It i
s a useful PDF editor that can edit'

灯泡 pdftr.exe -uncompress verypdf.pdf _uncompress.pdf

-uncompress parameter will decompress verypdf.pdf to _uncompress.pdf file, the file size of output PDF file is bigger than input PDF file.

灯泡 pdftr.exe -contentreplace "PDFcamp Printer=>VeryPDF Printer" verypdf.pdf _textreplace_PDFcampPrinter_VeryPDFPrinter.pdf

-contentreplace parameter will replace text in PDF content streams directly, however, if your PDF file is contain embedded fonts with font subsetting, -contentreplace parameter may found nothing, at this time, pdftr.exe will switch to use “Overlay” mode automatically.

-contentreplace parameter will keep original font name, font color, font size and everything automatically, the output PDF file looks perfect,

image

Sometimes, if a PDF file contains only embedded fonts or subset fonts, -contentreplace parameter may failed to locate text or replaced text but show garbage in output PDF file, we need to use -searchandoverlaytext parameter to overlay text instead of replacement, for example,

灯泡 pdftr.exe -searchandoverlaytext "PDFcamp Printer=>VeryPDF Printer" -overlaytextfontname "Verdana" -overlaytextfontsize 80%% -overlaytextcolor FF0000 -overlaybgcolor 00FF00 verypdf.pdf _textoverlay_PDFcampPrinter_VeryPDFPrinter.pdf

Above command line does overlay new text on each found item, we are using green background color and blue text color in this example, you can also change the colors by yourself,

image

灯泡 pdftr.exe -oldtext "PDFcamp Printer" -newtext "VeryPDF Printer" verypdf.pdf _textreplace2_PDFcampPrinter_VeryPDFPrinter.pdf

-oldtext and -newtext parameters are designed to compatible with old version, the document for old version can be found at following web page,

http://www.verypdf.com/app/pdf-text-replacer/search-and-replace-pdf-text-command-line.html

-oldtext and -newtext parameters are support only one word replacement at one time, if you need replace more words in one command line, you need use -contentreplace parameter, such as,

pdftr.exe -pagerange 1-3 -contentreplace "Old Text=>New Text||VeryPDF=>VeryDOC||My Name=>Your Name" D:\in.pdf D:\out.pdf

PDF Text Replacer Command Line  can overlay image instead of text, here is the example command line,

灯泡 pdftr.exe -oldtext "PDFcamp Printer" -image verypdf_logo.png verypdf.pdf _overlayimage_PDFcampPrinter_VeryPDFPrinter.pdf

image

The width and height of image can be calculated to fit original text block automatically.

PDF Text Replacer Command Line is a powerful software to batch replace text in all of your PDF files in a folder and its sub-folders, the following command lines will replace text in all PDF files in D:\temp folder,

for %F in (D:\temp\*.pdf) do pdftr.exe -contentreplace "My Name=>Your Name""%F""out_%~nF.pdf"

for %F in (D:\temp\*.pdf) do pdftr.exe -searchandoverlaytext "My Name=>Your Name""%F""C:\test\%~nF.pdf"

the following command lines will replace text in all PDF files in D:\temp folder and its sub-folders recursively,

for %F in (D:\temp\*.pdf) do pdftr.exe -skip "%F""C:\test\%~nF.pdf"

for /r D:\temp %F in (*.pdf) do pdftr.exe -oldtext "Old Text" -newtext "New Text""%F""C:\test\%~nF.pdf"

 

You can call PDF Text Replacer Command Line from C# code to replace text contents, here is the C# example,

Make use of the PROCESS classavailablein SYSTEM.DIOGNOSTICS namespace, use the following piece of code to execute the doc2any.exe file,

~~~~~~~~~~~~~~~~~

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Diagnostics;

 

namespace ConsoleApplication1

{

    classProgram

    {

        staticvoid Main(string[] args)

        {

                Process proc = new Process();

                proc.StartInfo.FileName = @"C:\\pdftr.exe";

                string strArguments = "";

                strArguments += " -contentreplace \"PDFcamp Printer=>VeryPDF Printer\""

                                " D:\test.pdf D:\out.pdf";

                Console.WriteLine(strArguments);

                proc.StartInfo.Arguments = @strArguments;

                proc.Start();

                proc.WaitForExit();

        }

    }

}

~~~~~~~~~~~~~~~~~

 

Here is the VB.NET example to call pdftr.exe application,

System.Diagnostics.Process.Start("D:\pdftr.exe -contentreplace ""PDFcamp Printer=>VeryPDF Printer"" D:\verypdf.pdf D:\out.pdf")

The following is the full command line document for PDF Text Replacer Command Line software,

C:\>E:\pdftextreplacer_cmd\pdftr.exe

Web: http://www.verypdf.com

Email: support@verypdf.com

Build date: Mar 27 2013

VeryPDF PDF Text Replacer Command Line v3.0

Batch replace or overlay text with text or image to PDF pages.

Copyright 1996-2013 VeryPDF.com Inc.

===========================================

Support input format:

  1. PDF: Adobe Acrobat PDF file format

Support output format:

  1. PDF: Adobe Acrobat PDF file format

===========================================

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

  -pagerange <string>           : set page range for search keywords, e.g., 1,3-5,7,9-

  -opw <string>                 : owner password (for encrypted files)

  -upw <string>                 : user password (for encrypted files)

  -searchtext <string>          : search text in PDF pages and show result to console

  -uncompress                   : uncompress the PDF file

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

  -searchandoverlaytext <string>: search and overlay text to PDF pages

  -overlaytextfontname <string> : set overlay text fontname, default is 'Arial'

  -overlaytextfontsize <string> : set overlay text font size, default is 0 forauto

  -overlaytextcolor <string>    : set overlay text color, in Hex, default is 000000

  -overlaybgcolor <string>      : set overlay text background color, in Hex, default is FFFFFF

  -oldtext <string>             : specify text to replace

  -newtext <string>             : specify text to replace with

  -image <string>               : specify image to replace with, support JPEG, PNG and TIFF

  -imgwidth <int>               : set width for the new image, unit: pixel, default is 0 forauto, -1 for full image width

  -imgheight <int>              : set height for the new image, unit: pixel, default is 0 forauto, -1 for full image height

  -skip                         : don't overwrite an output file if it already exists

  -h                            : print usage information

  -help                         : print usage information

  --help                        : print usage information

  -?                            : print usage information

  -$ <string>                   : input your license key

Examples:

   pdftr.exe -$ XXXXXXXXXXXXXXXX

   pdftr.exe -uncompress D:\in.pdf D:\out.pdf

   pdftr.exe -$ XXXXXXXXXXXXXXXX -contentreplace "My Name=>Your Name" D:\in.pdf D:\out.pdf

   pdftr.exe -contentreplace "My Name=>Your Name" D:\in.pdf D:\out.pdf

   pdftr.exe -searchandoverlaytext "My Name=>Your Name" D:\in.pdf D:\out.pdf

   pdftr.exe -searchandoverlaytext "My Name=><IMAGE>D:\temp\myname.png*20*20" D:\in.pdf D:\out.pdf

   pdftr.exe -pagerange 1-3 -contentreplace "Old Text=>New Text||VeryPDF=>VeryDOC||My Name=>Your Name" D:\in.pdf D:\out.pdf

   pdftr.exe -searchtext "string" C:\in.pdf

   pdftr.exe -pagerange 1 -searchtext "string" C:\in.pdf

   pdftr.exe -pagerange 1 -searchandoverlaytext "Old Text=>New Text||VeryPDF=>VeryDOC||My Name=>Your Name" D:\in.pdf D:\out.pdf

   pdftr.exe -overlaytextfontname "Arial" -overlaytextcolor FF0000 -overlaybgcolor 00FF00 -searchandoverlaytext "Old Text=>New Text||VeryPDF=>VeryDOC||My Name=>Your Name" D:\in.pdf D:\out.pdf

   pdftr.exe -opw 123 -upw 456 -contentreplace "Old Text=>New Text||VeryPDF=>VeryDOC||My Name=>Your Name" D:\in.pdf D:\out.pdf

   pdftr.exe -searchandoverlaytext "PDFcamp Printer=>VeryPDF Printer" -overlaytextfontsize 8 D:\in.pdf D:\out.pdf

   pdftr.exe -searchandoverlaytext "PDFcamp Printer=>VeryPDF Printer" -overlaytextfontsize 80% D:\in.pdf D:\out.pdf

   pdftr.exe -oldtext "Old Text" -newtext "New Text" D:\in.pdf D:\out.pdf

   pdftr.exe -oldtext "Old Text" -image D:\test.png D:\in.pdf D:\out.pdf

   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.pdf

   pdftr.exe -oldtext "Old Text" -image D:\test.png -imgwidth 0 -imgheight 0 D:\in.pdf D:\out.pdf

 

Batch process examples:

   for %F in (D:\temp\*.pdf) do pdftr.exe -contentreplace "My Name=>Your Name""%F""out_%~nF.pdf"

   for %F in (D:\temp\*.pdf) do pdftr.exe -searchandoverlaytext "My Name=>Your Name""%F""C:\test\%~nF.pdf"

   for %F in (D:\temp\*.pdf) do pdftr.exe -skip "%F""C:\test\%~nF.pdf"

   for /r D:\temp %F in (*.pdf) do pdftr.exe -oldtext "Old Text" -newtext "New Text""%F""C:\test\%~nF.pdf"

 

 

VeryPDF PDF Text Replace Command Line homepage:

http://www.verypdf.com/app/pdf-text-replacer/search-and-replace-pdf-text-command-line.html

PDF Text Replacer Command Line

Download

USD79.95

VN:F [1.9.20_1166]
Rating: 7.8/10 (4 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
[VeryPDF Release Notes] VeryPDF Releases PDF Text Replacer Command Line software, 7.8 out of 10 based on 4 ratings

Related Posts

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

2 Responses to [VeryPDF Release Notes] VeryPDF Releases PDF Text Replacer Command Line software

  1. VeryPDF says:

    You can replace old text with new text and image in one command line, for example,

    pdftr.exe -searchandoverlaytext “Old Text=>New Text||VeryPDF=>VeryDOC||My Name2=>D:\temp\myname.png*20*20″ D:\in.pdf D:\out.pdf

    is a keyword for image, you MUST add tag to replace a text with a image file. You can use “||” to combine several replacement jobs in one command line.

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

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!