Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

covert docx to pdf with libraoffice in python

from subprocess import  Popen
LIBRE_OFFICE = r"C:Program FilesLibreOfficeprogramsoffice.exe"

def convert_to_pdf(input_docx, out_folder):
    p = Popen([LIBRE_OFFICE, '--headless', '--convert-to', 'pdf', '--outdir',
               out_folder, input_docx])
    print([LIBRE_OFFICE, '--convert-to', 'pdf', input_docx])
    p.communicate()


sample_doc = 'file.docx'
out_folder = 'some_folder'
convert_to_pdf(sample_doc, out_folder)
Comment

PREVIOUS NEXT
Code Example
Python :: how to use with statementin python 2.4 
Python :: last element of python list 
Python :: python "urllib3" download and save pdf 
Python :: unique list 
Python :: deepcopy python 
Python :: twitter scraping python 
Python :: Object of type datetime is not JSON serializable 
Python :: pandas unstring list 
Python :: multithreaded programming in python 
Python :: how to create a spark schema using a string 
Python :: remove days when subtracting time python 
Python :: check if a number is in a list python 
Python :: separate each characters by commas into a single characters separated by commas 
Python :: 151 uva problem solution 
Python :: 0x80370102 kali linux 
Python :: can u length a dictionary in python 
Python :: get last x elements of list python 
Python :: skcikit learn decision tree 
Python :: global /tmp/pip-req-build-civioau0/opencv/modules/videoio/src/cap_v4l.cpp (587) autosetup_capture_mode_v4l2 videoio(v4l2:/dev/video0): device is busy 
Python :: stackoverflow python 
Python :: how to extract column from numpy array 
Python :: convert float with missing values to integer 
Python :: threading in python 
Python :: read csv pandas nrow 
Python :: binary tree python implementation 
Python :: python append to tuple list 
Python :: python string assignment by index 
Python :: distribution analysis pandas 
Python :: How to Join list element into a string in python 
Python :: pyhton apend to list 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =