Please enable JavaScript to view this site.

Navigation: Developer Information > Command Line Interface

Command Line Content Search

Scroll Prev Top Next More

win2pdfd.exe getcontentsearch "sourcepdf" "password" "searchtext"

win2pdfd.exe getcontentsearch "sourcepdf" "password" "searchtext" "fieldlength"

win2pdfd.exe getcontentsearchbelow "sourcepdf" "password" "searchtext"

win2pdfd.exe getcontentsearchbelow "sourcepdf" "password" "searchtext" "fieldlength"

win2pdfd.exe getcontentsearches "sourcepdf" "password" "searchtext"

win2pdfd.exe getcontentsearches "sourcepdf" "password" "searchtext" "fieldlength"

 

Search the PDF file specified by "sourcepdf" for the text specified by "searchtext". If the "searchtext" is found in the PDF file, the text immediately to the right of "searchtext" (for getcontentsearch) or immediately below the searchtext (for getcontentsearchbelow) is printed to standard out (STDOUT). The search is stopped when a space, tab, or newline character is encountered.

 

The "getcontentsearch" variation stops after the first text matching the "searchtext" is found.  The "getcontentsearches" variation continues searching the entire PDF and prints all instances of text matching the "searchtext" to standard out.

 

If the "fieldlength" is specified, the search is stopped when the number of characters specified by "fieldlength" have been printed or a newline character is encountered. This allows you to search for fields that include space characters.

 

If the path to "sourcepdf" contains spaces, it must be enclosed with quotation marks. The "sourcepdf" can be a local file path, or an web address (URL) to an existing PDF.

 

If the PDF is password protected, the master password should be provided in the "password" parameter. Otherwise, the parameter should be set to '' (single quotes).

 

The "searchtext" parameter is case sensitive.

 

This command can be used by custom programs, plug-ins, or Power Automate Desktop flows for operations such as renaming based on the contents of the PDF.

 

Requires a licensed version of Win2PDF version 10.0.100 or above. Contact us for a time limited evaluation license.

 

Returns 0 on success, and a Windows system error code on failure.