Convert Word Files To PDF in Python - DOCX To PDF

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 23

  • @sad_man_no_talent
    @sad_man_no_talent 5 місяців тому +18

    python rule 34: if it exists there is a function for it

    • @Md.AlmasAli
      @Md.AlmasAli 5 місяців тому

      How can I find all rules? Can you share the source?

    • @Eurotool
      @Eurotool 5 місяців тому

      ​@@Md.AlmasAlirules of the internet joke

    • @d_mvp
      @d_mvp 5 місяців тому

      @@Md.AlmasAli That's a joke.

  • @nopens
    @nopens 4 місяці тому

    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

  • @avishkar6181
    @avishkar6181 5 місяців тому +1

    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

    • @frostpredator
      @frostpredator 5 місяців тому

      You can use the docx library to deal with styles

  • @sundarravikumar4533
    @sundarravikumar4533 4 місяці тому

    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

  • @sundarravikumar4533
    @sundarravikumar4533 4 місяці тому

    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.

  • @vaibhavgirase3021
    @vaibhavgirase3021 3 місяці тому

    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 ?

  • @InviProgUz
    @InviProgUz 5 місяців тому

    Your videos are very useful👍 and like to me. 🇺🇿

  • @umaidstudy
    @umaidstudy 2 місяці тому

    This does not work for conda3_python in aws sagemaker can someone help

  • @AviSchwartz1
    @AviSchwartz1 5 місяців тому

    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.

  • @alexeykazmin7539
    @alexeykazmin7539 5 місяців тому

    how to convert many files at once?

    • @TimeCheckOfficial
      @TimeCheckOfficial 2 місяці тому

      add import os and make sure to contain your multiple docx files into one single folder and then convert its path

  • @psyraxx39
    @psyraxx39 4 місяці тому +1

    This is what happened to Dr Disrespect

  • @cyanide_stew
    @cyanide_stew Місяць тому +1

    Fj

  • @artCoderr
    @artCoderr 5 місяців тому

    Bro do some complex stuff. These kind of video in 2024 is very shitty

  • @harshabugatti
    @harshabugatti 5 місяців тому +1

    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")

    • @manifestasisanubari
      @manifestasisanubari 5 місяців тому

      It seems like the terminal is run not inside the same directory of the file

    • @harshabugatti
      @harshabugatti 5 місяців тому

      @@manifestasisanubari I tried the code in the same directory of the word file. Still no luck

    • @AtulMishra-r3z
      @AtulMishra-r3z Місяць тому

      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