Closed natcohen closed 9 years ago
It is maybe possible to port parts of libreoffice into the browser using emscriptem.
Then use PDF.js for viewing the document. However it wouldn't be very easy to write a wysivig editor on top of that.
@edi9999 sounds easier than it really is... Converting with emscripten is a hassle (if you have experience with it, I would be happy to hear any advice you have or if you're willing to start it, I'll be the first to help!). LibreOffice is moving to the cloud by the end of the year so it won't be a problem to implement an editor. If you're talking about a pdf editor, there is also a solution (http://www.codeproject.com/Articles/466362/Blend-PDF-with-HTML).
Anyway, I really think docxtemplater + docx2pdf is the ultimate solution to generate documents without re-designing a document with pdfKit or jsPDF (which can be time consuming and not very efficient for complex layout). It would offer much more flexibility and open for new applications. Docxtemplater would really benefit from that because ultimately it is very rare for an app/website to output a docx file.
Yes I know that converting with emscriptem is very difficult, however I've never done it before. I guess with a huge codebase such as the one of libre office, it would be an enormous amount of time.
You're talking about docx2pdf, but is this a "hypothetical tool" or something that really exists ?
I also think that it would simplify things a lot if we could do this PDF conversion step in the browser as well
Unfortunately it's hypothetical...
This is really cool feature.....if can somehow create generate a pdf from the doc template will be great. This should be reopened and added as a feature request.
This issue is out of scope with this project. Creating a docx to pdf renderer totally in JS is an enormous amount of work, probably more than 10 times the amount of work of this library.
@edi9999 and anyone who stumbles across this, there is now docx-wasm which can convert the docx to PDF; it performs the conversion locally. (Freemium model library).
@plutext That's amazing if it does what I think it does :)
PS you should fix the link, "which" at the end should be removed
great insight, thank you @plutext, will try it in the future. They also have a client side example : https://github.com/NativeDocuments/docx-wasm-client-side
Hi, @plutext, @Aarbel NativeDocument.com cannot be openned, the project docx-wasm may has been died. It will be an amazon things if we could do that in browser, all of the reporting tools,like crystal report, ssrs,fastreport etc will be ened.
Hi, @edi9999, can check the pdfmake to which have api to wirte pdf https://github.com/bpampuch/pdfmake
Yes, one way is to forget about docx completely, however it makes it not possible to use Word to create your templates (which is the power of this library).
After many years, I still don't have a perfect solution for this.
PDFTron works quite well as far as I can tell.
if anyone is looking for this, you can use libreoffice like this lowriter --convert-to pdf /path or https://github.com/unoconv/unoserver which launches a libreoffice server and also allows you to specify input/output filenames and paths
Hi @nirkons, The industry needs an lightweiht solution without any 3rd party software based on docx specification and pdf specification only. It can be library or framework other than software application
@edi9999 , Tried pdftron, there're still many formation issue caused docx file different with pdf file
I know it's out of scope but it would be amazing to be able to use this library, modify docx templates and then convert them into PDF (wysiwig and all in browser...). Anyway, amazing job!