never got to watch this video, but today i had the need to convert 30+ docxs to pdf and immediately remembered that you can do this with python. What a time to be alive
It doesn't work in case of images, if you want to extract and associate images with respective pages, you will observe that all the images will be embedded in all the pages
Few weeks back I was facing an interesting problem with docx . I wanted to extract the text from the file then translate them and put them back with the same formatting,styles, size etc for each word. We could achieve formatting properly but couldn’t do the same for styles and sizes. Is there anyway to do this? Would love to see a video about this
Hi, run mh code in .exe file and i try to convert doc to pdf. It shows some server error failed. But code works fine. How can i rectify that doc to pdf part
Docx2pdf not working while converting my code into .exe file using pyinstaller. It shows nonetype object has no attribute value. But mh code works fine.
In Linux you are really not doing the conversion in Python but rather just using Python as a wrapper. In this case I would just use a shell script and be done with it.
Getting this error "[WinError 2] The system cannot find the file specified" in windows...! I have executed same code (changed "file.docx" to "WordToPDF.docx")
Download 'LibraOffice' and set path so it run on window error you are getting is window error def convert_to_pdf(doc_path): # Define the output PDF path based on input DOC or DOCX path pdf_output_path = f"{doc_path.rsplit('.', 1)[0]}.pdf" # Full path to soffice.exe # libreoffice_path = r'C:\Program Files (x86)\LibreOffice\program\swriter.exe' # Use LibreOffice to convert both .doc and .docx to PDF subprocess.run(['libreoffice', '--headless', '--convert-to', 'pdf', doc_path, '--outdir', upload_dir]) return pdf_output_path
python rule 34: if it exists there is a function for it
How can I find all rules? Can you share the source?
@@Md.AlmasAlirules of the internet joke
@@Md.AlmasAli That's a joke.
never got to watch this video, but today i had the need to convert 30+ docxs to pdf and immediately remembered that you can do this with python. What a time to be alive
It doesn't work in case of images, if you want to extract and associate images with respective pages, you will observe that all the images will be embedded in all the pages
Few weeks back I was facing an interesting problem with docx . I wanted to extract the text from the file then translate them and put them back with the same formatting,styles, size etc for each word. We could achieve formatting properly but couldn’t do the same for styles and sizes. Is there anyway to do this? Would love to see a video about this
You can use the docx library to deal with styles
Hi, run mh code in .exe file and i try to convert doc to pdf. It shows some server error failed. But code works fine. How can i rectify that doc to pdf part
When I use to convert docx file to pdf but images or animation s of docx file are not show in converted pdf file and it shows like text file why ?
Docx2pdf not working while converting my code into .exe file using pyinstaller. It shows nonetype object has no attribute value. But mh code works fine.
Your videos are very useful👍 and like to me. 🇺🇿
how to convert many files at once?
add import os and make sure to contain your multiple docx files into one single folder and then convert its path
This does not work for conda3_python in aws sagemaker can someone help
Fj
This is what happened to Dr Disrespect
In Linux you are really not doing the conversion in Python but rather just using Python as a wrapper. In this case I would just use a shell script and be done with it.
Bro do some complex stuff. These kind of video in 2024 is very shitty
Getting this error "[WinError 2] The system cannot find the file specified" in windows...!
I have executed same code (changed "file.docx" to "WordToPDF.docx")
It seems like the terminal is run not inside the same directory of the file
@@manifestasisanubari I tried the code in the same directory of the word file. Still no luck
Download 'LibraOffice' and set path so it run on window error you are getting is window error
def convert_to_pdf(doc_path):
# Define the output PDF path based on input DOC or DOCX path
pdf_output_path = f"{doc_path.rsplit('.', 1)[0]}.pdf"
# Full path to soffice.exe
# libreoffice_path = r'C:\Program Files (x86)\LibreOffice\program\swriter.exe'
# Use LibreOffice to convert both .doc and .docx to PDF
subprocess.run(['libreoffice', '--headless', '--convert-to', 'pdf', doc_path, '--outdir', upload_dir])
return pdf_output_path