ConvertAPI helps in converting various file formats. Creating PDF and Images from various sources like Word, Excel, Powerpoint, images, web pages or raw HTML codes. Merge, Encrypt, Split, Repair and Decrypt PDF files and many other file manipulations. You can integrate it into your application in just a few minutes and use it easily.
The ConvertAPI CLI makes it easier to use the Convert API from your shell without having to build your own HTTP calls. You can get your free secret at https://www.convertapi.com/a
Download compressed CLI executable
- Linux: convertApi-cli-linux-x64.zip
- Linux ARM64: convertApi-cli-linux-arm64.zip
- MacOS (Intel x64): convertApi-cli-osx-x64.zip
- MacOS (Apple Silicon arm64): convertApi-cli-osx-arm64.zip
- Windows: convertApi-cli-win-x64.zip
(this utility can also be built from source code for many other CPU and OS)
Unzip executable
unzip convertapi-cli*.zipAnd you are done. Optionally you can move the executable file to a more appropriate place and make utility accessible for all local users. On Linux it would be:
sudo mv convertapi /usr/local/binIn order to use this CLI utility, you must create your free trial account on https://www.convertapi.com site.
After the sign-up process, you will get your secret at https://www.convertapi.com/a .
The secret will be used in every CLI utility run.
convertapi-cli.exe <api-token> <output-directory> <input-files...> [from-format] [to-format] [key1=value1 key2=value2 ...]Example:
convertapi-cli.exeAny of these authentication mechanisms can be used as api-token:
- ConvertAPI usersecret: https://www.convertapi.com/a
- Access token: ConvertAPI dashboard.
- JWT token: ConvertAPI dashboard.
Example:
api_tokenDirectory where converted file / files needs to be saved in your system. Example:
<directory-in-your-file-system>The full file path in your file system. If the conversion supports multiple input files, separate their full paths with spaces (' ').
<full-path1> <full-path2> <full-path3>Find specific formats from all conversions here: https://www.convertapi.com/api. When you open a conversion, the From (Source) and To (Destination) formats are visible in the browser's URL and in the API Request panel, which displays the HTTP POST request URL. Example:
- Docx to Html conversion: https://www.convertapi.com/a/api/docx-to-html. From-format is:
docx. - Watermark PDF conversion: https://www.convertapi.com/a/api/pdf-to-watermark. From-format is:
pdf. - Images to Join conversion: https://www.convertapi.com/a/api/images-to-join. From-format is:
images.
Find specific formats from all conversions here: https://www.convertapi.com/api. When you open a conversion, the From (Source) and To (Destination) formats are visible in the browser's URL and in the API Request panel, which displays the HTTP POST request URL.
Example:
- Docx to Html conversion: https://www.convertapi.com/a/api/docx-to-html. To-format is:
html. - Watermark PDF conversion: https://www.convertapi.com/a/api/pdf-to-watermark. To-format is:
watermark. - Images to Join conversion: https://www.convertapi.com/a/api/images-to-join. To-format is:
join.
All parameters can be found on a specific conversion. Parameters are separated with spaces (' ').
Example: For example, we are doing PDF to JPG conversion: https://www.convertapi.com/a/api/pdf-to-jpg and want to set Pdf password, result file name and result image resolution.
password=1234 filename=new-wonderful-name ImageResolution=300 Convert a single PDF to DOCX:
convertapi-cli.exe YOUR_API_TOKEN output.docx input.pdfMerge multiple PDF files into one:
convertapi-cli.exe YOUR_API_TOKEN output_directory file1.pdf file2.pdf file3.pdf pdf mergeProtect a PDF with a password:
convertapi-cli.exe YOUR_API_TOKEN output_directory input.pdf pdf protect UserPassword=1234 OwnerPassword=abcd FileName=protectedAdd a watermark to a PDF:
convertapi-cli.exe YOUR_API_TOKEN output_directory input.pdf pdf watermark Text=Confidential FileName=watermarkAdd watermark-overlay to a PDF:
Note: Overlay file path is added as parameter.
convertapi-cli.exe YOUR_API_TOKEN output_directory input.pdf pdf watermark-overlay OverlayFile=overlay-file.pdf FileName=watermarkResultPlease leave all comments, bugs, requests, and issues on the Issues page. We'll respond to your request ASAP!
The ConvertAPI CLI is licensed under the MIT license. Refer to the LICENSE file for more information.