Converting Word to PDF
Hi,
I have a Word document having approx 10 pages. And I use smartTextReflow to load all the pages and then I want to export the entire document as PDF.
But only first page is getting exported before in the CEP script the export command gets executed before SmartTextReflow loads all the Word pages. Please help how to sync this.
Following is the code:
var tempDoc = app.documents.add();
var myPDFPage;
tempDoc.documentPreferences.facingPages = false;
tempDoc.documentPreferences.createPrimaryTextFrame = true;
var leftMargin = tempDoc.pages.item(0).marginPreferences.left;
var topMargin = tempDoc.pages.item(0).marginPreferences.top;
var myTextFrameTemp = tempDoc.pages.item(0).textFrames.firstItem();
myTextFrameTemp.geometricBounds = [leftMargin, topMargin, myDocument.documentPreferences.pageHeight - topMargin, myDocument.documentPreferences.pageWidth - leftMargin];
myPDFPage = myTextFrameTemp.place(File(myPDFFile), false)[0];
app.pdfExportPreferences.pageRange = "All";
tempDoc.exportFile(ExportFormat.PDF_TYPE, File(myPDFFile + ".pdf"), false);
