A Word document may be easily converted to a PDF file However, what happens if you need to convert a ton of Word files into PDFs? It will take a long time to open every file by hand and save it to PDF. You may quickly and easily convert large amounts of Word to PDF with the help of this method. And without utilizing any outside tools either. Ms. Word is all you need. Copy the following code into Notepad or Notepad++, then save the file as "PDF.js" in a folder var obj = new ActiveXObject("Scripting.FileSystemObject"); var docPath = WScript.Arguments(0); docPath = obj.GetAbsolutePathName(docPath); var pdfPath = docPath.replace(/\.doc[^.]*$/, ".pdf"); var objWord = null; try { objWord = new ActiveXObject("Word.Application"); objWord.Visible = false; var objDoc = objWord.Documents.Open(docPath); var format = 17; objDoc.SaveAs(pdfPath, format); objDoc.Close(); WScript.Echo("Saving '" + docPath + "'
For Windows and Linux,Ubuntu users to improve their computer performance
Comments
Post a Comment