Skip to content

pdftables/powershell-pdftables-api

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

powershell-pdftables-api

Example of using the https://pdftables.com/ API from Windows PowerShell.

The scripts require PowerShell 3.0 or later. This is installed by default from Windows 8. In Windows 7 you can install it from:

https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell?view=powershell-5.1

powershell-convert-dir.ps1

This enables you to batch convert PDFs from the command line in Windows.

The script will convert all PDFs in a directory (folder) using PDFTables. It will also process PDFs in sub directories and will mirror the input sub-directory structure in the output sub-directory.

This script takes three mandatory parameters:

  • Your PDFTables API Key (displayed on https://pdftables.com/pdf-to-excel-api after you login)
  • The input directory containing PDF files
  • The output directory containing PDF files (this can be the same as the input directory)

It also has one optional parameter: the format in which you want the output files. This is specified with -format VALUE where VALUE can be xlsx-single (the default), xlsx-multiple, csv or xml.

Example usage from Windows command line:

powershell -ExecutionPolicy Unrestricted -File pdftables-convert-dir.ps1 YOUR-API-KEY INPUT_DIR OUTPUT_DIR

Example usage output in CSV format:

powershell -ExecutionPolicy Unrestricted -File pdftables-convert-dir.ps1 YOUR-API-KEY INPUT_DIR OUTPUT_DIR -format csv

powershell-convert-single.ps1

This enables you to convert a PDF from one directory into another (or same) directory from the command line in Windows.

This script takes three mandatory parameters:

  • Your PDFTables API Key (displayed on https://pdftables.com/pdf-to-excel-api after you login)
  • The input directory including your PDF file name
  • The output directory where you'd like to save your converted PDF (this can be the same as the input directory)

It also has one optional parameter: the format in which you want the output files. This is specified with -format VALUE where VALUE can be xlsx-single (the default), xlsx-multiple, csv or xml.

Example usage from Windows command line:

powershell -ExecutionPolicy Unrestricted -File pdftables-convert-single.ps1 YOUR-API-KEY INPUT_DIR_FILE OUTPUT_DIR

Example usage output in CSV format:

powershell -ExecutionPolicy Unrestricted -File pdftables-convert-single.ps1 YOUR-API-KEY INPUT_DIR_FILE OUTPUT_DIR -format csv

About

Example of using the https://pdftables.com/ API from Windows PowerShell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published