1/26/2024 0 Comments Docs to pdf converter libreofficeThis listener avoids to start the LibreOffice instance every time unoconv is called. The script starts with a delay of 20 seconds(!) to give the "unoconv" listener time enough to start. The process of converting about 4500 documents of mostly 1 to 2 pages took on my own laptop about 30 minutes. I admit that my (first) Python script is very basic, but it worked very well for me. I am using the results of the conversion in my ExtJS package ext-pdf-viewer, a PDF Viewer panel for Ext JS, based on the Mozilla's pdf.js library. The nice thing about converting with this unoconv-LibreOffice method is that the generated PDF's are not converted as bitmaps, but as layered PDF's. Unoconv is a command line program that is used to convert between different office document file formats. But the script will continue to the next file in case of file errors. This program doesn't do any checking if a file can be opened or not. Somewhat difficult name, but you have to install it in a folder where you can easily find it, like //py-unoconv-batch-recursive. py-unoconv-batch-recursive ( from Github).Python (Python 2.7.12 installed) ( installation instructions).LibreOffice (from here: Link to LibreOffice).Don't worry, I am not an experienced Python programmer, so I will stick to the plan of getting you to the PDF's as quickly as possible. In this article I describe how I have done the mass conversion on Linux (my other favorite operating system) with LibreOffice, a utility called "unoconv" and a bit of Python programming. 7-PDF Maker, a free command line utility, does a great job, but it broke during the conversion more than once. The challenge is that it has to convert all the documents to PDF recursively and with a good quality. Only 7-PDF Maker on Windows did the job almost as I wanted. I have looked around on the web and found a few utilities for Windows that could handle this to a certain or complete extend. Time for LibreOffice and unoconv and a bit of Python handwork. The demand was to have all these documents available in their online candidates portal for preview. One of our customers has about 4500 documents in Word (Docx and Doc), RTF, TXT, OTF and PDF format collected by their users.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |