If you’re working with hundreds or thousands of files, you need a way to convert to PDF/A as quickly and conveniently as possible. This post will show you how you can accomplish this using PDFTron’s easy-to-use command line tool to batch convert files to PDF/A on Windows, Linux and Mac.
Using the command line tool in batch mode, you can ensure your PDF files are suitable for long-term archiving without altering the original look or accessibility of your documents.
To access the CLI, download a trial . Those looking to automate PDF/A conversion and verification can check out our article on converting from PDF to PDF/A for instructions on how to leverage the SDK to convert files server-side or even purely client-side, via Windows, Mac, Linux, iOS, Android or web-based apps.
For most people, and where you are not constrained by a policy, we recommend converting files in PDF/A-2b mode, or at least PDF/A-1b or PDF/A-3b, as this will make it easier for files to pass auto-conversion.
The basic command-line syntax for PDF/A Manager is as follows:
# command line pdfa [options] file1 file2 folder1 file3 ...
Therefore, entering the following command will convert files in your present working directory to PDF/A-2b files optimized for fast web view.
# command line pdfa --level 2B --convert --linearize --verb 2 --outdir outputfolder .
By default, the tool will convert all files with the extension ‘.pdf’ and save converted files in the path you specify for outputfolder. If the output folder does not exist, the converter tool will try to create it. Leveraging the
--subfolders option would also let you recursively process subfolders, so you’re not limited to working in one directory! The syntax is as follows:
# command line --subfolders myfolder1 myfolder2
Since the PDFTron SDK successfully converts 20+ file types to PDF/A, you can also choose to convert files based on the extension. Simply use the
--extension parameter. For example, to convert all PDF documents in a subfolder with a custom extension ‘.blob’, add the following:
# command line --extension .blob --subfolders myfolder1
Wildcard characters are also supported and can be used to process multiple input files. (For more on how to use wildcards, please consult the documentation in the PDF/A Manager CLI download.)
Once you’ve input your command, the converter tool takes over and performs only the light touch edits necessary to convert your files while preserving the original look and content. Afterwards, the tool produces an XML report, which you can use to automate document processing -- or open in a web browser to see the errors the tool encountered during the conversion process, as well as access links to successfully converted files.
At this point, you may also choose to inspect and correct files directly with PDFTron’s CosEdit tool if that level of detail is required. The image beneath shows a PDF/A Manager-generated XML report open in a browser side-by-side with the CosEdit tool window. The number of the PDF object under inspection in CosEdit is highlighted in yellow where it appears in both windows.
You now know everything you need to batch convert files in 20+ formats to PDF/A. To experience more PDFTron PDF/A features, test a sample file via our free veraPDF-tested PDF/A Converter or start a free trial of PDFTron’s PDF SDK.
If you have any questions about PDFTron’s PDF SDK, feel free to get in touch !