Before you attempt to perform a silent conversion with more than one file, you need to get set up.

You will need to create 3 folders ( you can name them however you choose - the following are just examples). The best place for these folders is directly in your C: drive:

  • InputFolder: Place all the PDF files that you wish to convert in this folder. Note that you can only convert using a single layout at a time, so if your files are different, you will want to keep them in separate folders.
  • LayoutsFolder: Place the layout file that is specific to the structure of the PDF files in your InputFolder. If you haven't created a layout file yet, open your user interface and create one. Then, export it into this folder.
  • OutputFolder: This is the file where your converted files will be saved to. Leave it empty.

Method 1

When performing a silent conversion on multiple files, use the " %%g" so that it's not necessary to type in the path to each file indivudually.

Here is a sample of a basic silent conversion with multiple files from a .bat file.

for /r "C:\InputFolder" %%g in (*.pdf) do "C:\Program Files (x86)\CogniView\PDF2XL\PDF2XL.exe" -input="C:\InputFolder\%%~ng.pdf" -layout="C:\LayoutsFolder\TheLayout.layoutx" -format=excelfile -range=all -output="C:\OutputFolder\%%~ng.xlsx" -noui -autoopen=off

When using the sample script above, be sure to change the paths ( example: C:\InputFolder) to properly identify where your files are stored, as well as the layout name (TheLayout.layoutx).

There is a simpler method, however, that allows you to convert multiple files within a folder.
Note that you would enter your information in the top section like this example:

set SOURCE=C:\MyInputFolder

set DESTINATION=C:\MyOutputFolder

set TEMPLATE=C:\MyLayoutFolder\MyLayout.layoutx

set SOURCE=%1



set PDF2XL="%ProgramFiles(x86)%\CogniView\PDF2XL\PDF2XL.exe"

for /r "%SOURCE%\" %%g in (*.pdf) do start /w "pdf2xl" PDF2XL -input="%%g" -layout="%TEMPLATE%" -format=excelfile -range=all -output="%DESTINATION%\%%~ng.xlsx" -noui -autoopen=off
Did this answer your question?