简体   繁体   中英

Converting a lot of PDF to XLS documents using a batch program

I want to convert a lot of documents from PDF to XLS with a program called CogniView PDF2XL CLI, so I created a Batch program (.bat) like this:

@ECHO OFF 
cd C:\Program Files\CogniView\PDF2XL
FOR /F "delims=." %%g in ('dir /b "C:\InputFolder"\*.pdf') do PDF2XL -input="C:\InputFolder\%%g.pdf" -layout="C:\LayoutsFolder\TheLayout.layout" -format=excelfile -range=all -output="C:\OutputFolder\%%g.xls" -noui -autoopen=on

The code executed without error, but when I look in the output folder I don't see the XLS files. Did I miss something?

In your input files, you're doubling the ".pdf" at the end. Try this, I removed .pdf from the end of the input files:

@ECHO OFF 
cd C:\Program Files\CogniView\PDF2XL
FOR /F "delims=." %%g in ('dir /b "C:\InputFolder"\*.pdf') do PDF2XL -input="C:\InputFolder\%%g" -layout="C:\LayoutsFolder\TheLayout.layout" -format=excelfile -range=all -output="C:\OutputFolder\%%g.xls" -noui -autoopen=on

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM