6/19/2023 0 Comments Convert docx to pdf javascriptI'm looking for the best/cleanest way to somehow control these Word processes better by giving them a deadline or something. The process is also blocked until any user intervention to pass the prompt. Sometimes the Word process would hang at a 'Bookmark'-prompt.Until any user interaction the process would just block. Sometimes one Word process would hang at the 'Save as'-prompt, if this happened user intervention was needed to continue.On a small scale this seems to work great, but when dealing with a lot of documents like several thousands, I encountered a couple of problems: This javascript-script is called from my Java program synchronously for each document. WScript.Echo("An error occured: " + err.message) WScript.Echo("The CV was succesfully converted.") ObjWord = new ActiveXObject("Word.Application") WScript.Echo("Saving '" + docPath + "' as '" + pdfPath + "'.") I've stumbled upon a javascript script to use the underlying Microsoft Word instance to open the file and save it as a PDF (found at: ): var fso = new ActiveXObject("Scripting.FileSystemObject") ÄocPath = fso.GetAbsolutePathName(docPath) docx-files to pdf such as using several open source Java libraries, sadly these libraries would often mess up the layout in the documents. I've tested several different ways to convert. I'm working on a Java program that programmatically converts.
0 Comments
Leave a Reply. |