Skip to main content
Command Line Examples
PDF2XL Support avatar
Written by PDF2XL Support
Updated over a week ago

The following are a few examples of the usage of the PDF2XL Command Line Interface.

Note that you must run these commands from the installation folder of PDF2XL, or otherwise provide a full path to the application.

These paths are found in the following locations...

Version 8.4 and higher

Installed for User only:


Installed for Everybody (Admin install):

"C:\Program Files (x86)\CogniView\PDF2XL\PDF2XLCLI.bat"

Version 8.0 to 8.3


*8.?.?.? - use currently installed version

Version 6.5 (and lower)

"C:\Program Files (x86)\CogniView\PDF2XL CLI\PDF2XL.exe"

To open one or more files using PDF2XL CLI's command line, just specify the filename(s).

This will open a single file:

(PDF2XL path) c:\input.pdf

This will open the two specified files:

(PDF2XL path) "c:\some documents\data.pdf" "c:\some documents\more data.pdf"

Note that if the file path contains a space, you will need to use quotes around the path.

You can also use the input command to open the file. The following command is similar to the previous example:

(PDF2XL path) -input="c:\some documents\data.pdf" -input="c:\some documents\more data.pdf"

Another option is to change the initial structure type of a document (providing you haven't opened it yet) by setting it in the command line:

(PDF2XL path)="c:\layouts\a_""quoted""_layout"

This will run a clipboard conversion on the c:\input.pdf file using the layout found at c:\def_layout.layout, converting the 1st-3rd and 5th-8th pages:

(PDF2XL path) -noui -input="c:\input.pdf" -format=clipboard -range="1-3,5-8" ย -layout="c:\def_layout.layoutx" 2> c:\error.log

Note that if an error occurs, a detailed message will be found in the file c:\error.log

Sometimes it's easier to test the parameters you provide to the command line when running with a full UI. To do that, replace the -noui command with -run -autoclose (and of course, the error redirection is not required):

(PDF2XL path) -run -autoclose -input="c:\input.pdf" -format=clipboard -range="1-3,5-8" -layout="c:\def_layout.layoutx"

This will convert all the PDF files inside C:\InputFolder into similarly named Excel files and put them in C:\OutputFolder:

for /F "delims=." %%g in ('dir /b C:\InputFolder\*.pdf') do PDF2XL -input="C:\InputFolder\%%g.pdf" -layout="C:\LayoutsFolder\TheLayout.layoutx" -format=excelfile -range=all -output="C:\OutputFolder\%%g.xls" -noui -autoopen=off

Note that quotes are only needed when there is a space in the path.

"C:\Input Folder\*.pdf"

...needs quotations around it because of the space between Input and Folder, but:


...does not.

Did this answer your question?