Convert Word to PDF in ax 2012
Hi,
please use the below job to covert your word file into pdf file.
static void convertWordToPDF(Args _args)
{
COM wordApplication;
COM wordDocuments;
COM wordDocument;
//COM wordRange;
Filename docFileName = @"C:\AX Documents\Document Handling\GCO-000025.doc";
Filename pdfFileName;
Filename filepath;
Filename fileName;
Filename fileExt;
;
wordApplication = new COM("word.application");
wordDocuments = wordApplication.Documents();
wordDocument = wordDocuments.Open(docFileName);
[filepath, filename, fileExt] = fileNameSplit(docFileName);
pdfFileName = filePath + filename + '.pdf';
wordDocument.ExportAsFixedFormat(pdfFileName, 17);
wordDocument.close();
wordApplication.quit();
//WinAPI::deleteFile(pdfFileName);
info('done');
}
Thanks,
Vijaykarthik
please use the below job to covert your word file into pdf file.
static void convertWordToPDF(Args _args)
{
COM wordApplication;
COM wordDocuments;
COM wordDocument;
//COM wordRange;
Filename docFileName = @"C:\AX Documents\Document Handling\GCO-000025.doc";
Filename pdfFileName;
Filename filepath;
Filename fileName;
Filename fileExt;
;
wordApplication = new COM("word.application");
wordDocuments = wordApplication.Documents();
wordDocument = wordDocuments.Open(docFileName);
[filepath, filename, fileExt] = fileNameSplit(docFileName);
pdfFileName = filePath + filename + '.pdf';
wordDocument.ExportAsFixedFormat(pdfFileName, 17);
wordDocument.close();
wordApplication.quit();
//WinAPI::deleteFile(pdfFileName);
info('done');
}
Thanks,
Vijaykarthik
Comments
Post a Comment