Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add word to PDF option #2

Open
jawrainey opened this issue Apr 30, 2020 · 3 comments
Open

Add word to PDF option #2

jawrainey opened this issue Apr 30, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@jawrainey
Copy link
Collaborator

jawrainey commented Apr 30, 2020

Use docx2pdf to batch convert the generated .docx documents into .pdfs. In my experience, I had to run docx2pdf once, grant access to Microsoft Word, and could then run the whole batch nicely. I first moved all generated .docx to a folder to use the folder-batch from docx2pdf easily. I might turn this together into a bash script in the future.

@davidverweij -- that would be really useful. Maybe you could expand your CLI to pipe the output into docx2pdf:

poetry csv2docx <params> | poetry docx2pdf <params>

*Assuming your programme has a name change to docx-csv-mailmerge

@davidverweij davidverweij added the enhancement New feature or request label May 12, 2020
@salmannotkhan
Copy link
Contributor

salmannotkhan commented May 20, 2020

Look at requirement of docx2pdf. It says that user need MS Office in order to use this library. MS Office is not compatible with Linux so we can't use this library on Linux systems.

@davidverweij
Copy link
Owner

I found this alternative which works on all platform. It uses the unoconv library, though introduces the threshold to install Libre / Open Office. Then again, it can be run headless. Perhaps worth a consideration. Somewhere I feel we would be better off using Word for macOS and Windows, and perhaps Libre Office for Linux - instead of one for all, primarily due to the familiarity and user base of Microsoft Word.

@davidverweij
Copy link
Owner

davidverweij commented Oct 10, 2020

I was just thinking, also in relation to #32, that I am curious to see the performance difference between:

  1. generate multiple .docx, and convert them all with e.g. docx2pdf, or
  2. generate one merged .docx (e.g. Creating single docx containing all the merged documents #32), convert that one with docx2pdf, and then split the pdf with something like this.

Especially since docx2pdf in my own experience seems to 'open' each .docx. Probably has a convertion point depending on the amount of .docx to be generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants