Batch Conversion of different files in a folder to PDF

4

1

I need a Linux command-line instrument that can make scripted conversion of files of different format (usually .odt, .docx and .rtf) to PDF. How would I do that?

biryulin04

Posted 2018-10-23T21:09:49.840

Reputation: 127

Answers

4

Two choices come to mind: Unoconv and LibreOffice.

Don't know much about Unoconv, but the syntax to use with LibreOffice is

libreoffice --headless --convert-to pdf *.docx
libreoffice --headless --convert-to pdf *.odt
libreoffice --headless --convert-to pdf *.rtf

You might also need to find which of the eight (count them, 8) different flavors of PDF your organization or client needs, and how well each of the choices above renders PDF to meet that need. Thanks to https://blog.marconet.com for the summary with explanation, below:

PDF - This general PDF standard is sufficient for in-office use, sharing and viewing online and for standard quality documents.

PDF/A - This standard was developed for long-term file storage, commonly used by archivists, records managers and compliance managers. It has a restricted set of features, without JavaScript, audio and video content and encryption, because they may disallow users from opening and viewing accurately in the future.

PDF/E – Architects, engineers, construction professionals and manufacturing product teams will use this standard most often. According to Planet PDF, “This standard was intended to address key issues in the areas of large-format drawings, multimedia, form fields and rights management – to name a few – that might prevent the engineering community from embracing PDF in their workflows.”

PDF/X – This standard best suits print professionals, graphic designers and creative professionals. High quality, professional grade documents can be expected when using this standard. This PDF standard will ensure documents are print-ready by correctly embedding fonts, images, color profiles and more.

PDF/UA – This standard enhances the readability for people with disabilities, IT managers in government or commercial enterprises and compliance managers. The UA stands for Universal Access; this standard will work with assistive technology that assists users through reading and navigation.

PDF/VT – Print professionals will also use this standard for documents. This standard is based on components of the PDF/X standard, allowing some features such as color profiles, layers and transparency to be maintained. The biggest addition is the ability to customize data within these files, such as bank statements, business invoices or personalized marketing material.

TWO TYPES OF PDF STANDARDS FROM OTHER ORGANIZATIONS Additional organizations have adopted standards for their specific document needs.

PAdES – Standardizes secure paperless transactions that conform to the European legislation. This standard was established for PDF digital signatures in the EU.

PDF Healthcare – According to Acrobat, This standard “Provides best practices and implementation guidelines to facilitate the capture, exchange, preservation and protection of healthcare information. Following these guidelines provides a more secure electronic container that can store and transmit health information including personal documents, XML data, DICOM images and data, clinical notes, lab reports, electronic forms, scanned images, photographs, digital X-rays and ECGs.”

K7AAY

Posted 2018-10-23T21:09:49.840

Reputation: 6 962

2

pandoc is a good solution that supports converting many file formats. Style may not be maintained however.

If you need to convert files from one markup format into another, pandoc is your swiss-army knife. - http://pandoc.org/index.html

To install

sudo apt install pandoc

Bash example

Convert all files in folder to pdf:

for file in ./folder
do
     pandoc "$file" -o "$file".pdf
done 

nimda

Posted 2018-10-23T21:09:49.840

Reputation: 51

-1

https://answers.microsoft.com/en-us/office/forum/office_2016-word/need-to-batch-convert-word-to-pdf-files/4ee388d3-038f-4c46-a67c-9aacdbdfc2a0

This is a VBA script so hopefully you have some scripting skills but it basically uses the Word COM object to access the saveas method while specifying the PDF file type and has Word do the work for you.

thepip3r

Posted 2018-10-23T21:09:49.840

Reputation: 281

User asked for Linux. – K7AAY – 2018-10-23T21:44:25.320

well, i read that to mean that he needed them to go to PDF so they would work on linux... my bad i guess. – thepip3r – 2018-10-23T21:51:51.003