Skip to main content

LibreOffice Utils

Actions Status PyPi versions PyPi Download stats

Headless (command line) operations on Word, Excel, Powerpoint and most other formats LibreOffice can handle for:

  • Doc => PDF conversion (LibreOffice only)
  • printing (to the system default printer only)

from Python command line using LibreOffice or Microsoft Word

.doc / .docx to PDF conversion

Convert a directory of .doc / .docx to .pdf by:

python -m loutils.doc2pdf ~/Documents

Printing

CAUTION:

The doc2print.py script can print an unlimited number of pages to an unwanted printer, possibly causing great expense or violation of private documents to a public printer. Use great care with these scripts, preferably to a local non-networked printer you are sitting next to.

python -m loutils.doc2print ~/mydocs

The -exe parameter allows selecting the printing program. The script does not check that the files can be printed appropriately, it just prints. Thus use the -s parameter to select only the suffixes wanted. For example to print all Markdown files in a directory with Notepad++:

python -m loutils.doc2print ~/mydocs -s .md -exe notepad++

LibreOffice 7.2 finally fixed file globbing, but we use explict for-looping to work with older LibreOffice. LibreOffice is not thread-safe, so documents are converted or printed one at a time.

Metadata

Release files for loutils 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loutils 1.4.0
File Size Uploaded
loutils-1.4.0.tar.gz 4.9 kB Details

Release files / loutils-1.4.0.tar.gz

Download URL loutils-1.4.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
51f6bd787f505da108780274575d086440aebf11fcb2339677c133c2fc30eccb
BLAKE2b-256 checksum
How to use checksums
6799990dcb9663c0c46039444dba1640fd1e149398bb553e786a521cb2333aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.4.0 This release

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page