• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Converting Word to PDF

Explorer ,
Nov 14, 2021 Nov 14, 2021

Copy link to clipboard

Copied

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);

TOPICS
Feature request , How to , Import and export , Scripting , Sync and storage

Views

464

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 14, 2021 Nov 14, 2021

Copy link to clipboard

Copied

You might be better posting in the Acrobat forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 14, 2021 Nov 14, 2021

Copy link to clipboard

Copied

But I need to do it using InDesign app only. Using CEP extension. Not using Acrobat.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 15, 2021 Nov 15, 2021

Copy link to clipboard

Copied

So you are Placing a Word file into InDesign and exporting the resulting document to PDF – have you tried just using one of InDesign's Adobe PDF Presets?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 15, 2021 Nov 15, 2021

Copy link to clipboard

Copied

I am using this setting to export all pages: app.pdfExportPreferences.pageRange = "All";

 

Problem is that the order of execution is not in sync. PDF is getting exported before SmartTextReflow loads all pages of Word doc.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 15, 2021 Nov 15, 2021

Copy link to clipboard

Copied

Ok. Then disable SmartTextReflow and add pages and frames until the story will not overflow.

Only then export to PDF.

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

Word- go Print/choose pdf.

Lee- Graphic Designer, Print Specialist, Photographer

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

>>Word- go Print/choose pdf.

If you are referring to creating the PDF from Word, simply do a Save As. You don't need Acrobat--Office apps have been able to save to PDF since version 2007.

David Creamer: Community Expert (ACI and ACE 1995-2023)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

Hi @SVIDdev ,

 

I have added recompose() method after placement of word doc file.

 

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];
tempDoc.recompose();
app.pdfExportPreferences.pageRange = "All";
tempDoc.exportFile(ExportFormat.PDF_TYPE, File(myPDFFile + ".pdf"), false);

  

-Sumit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Converting word to pdf, go print choose print to pdf. Should be a drop down menu in the bottom left corner that says pdf. You can choose how you would like the pdf saved.

Lee- Graphic Designer, Print Specialist, Photographer

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Or do a Save As...

David Creamer: Community Expert (ACI and ACE 1995-2023)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2022 Jun 11, 2022

Copy link to clipboard

Copied

"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."

 

Well, do not use smart text reflow.

Add pages and also text frames if necessary and thread them by assigning values for nextPage or previousPage of the text frame as you go. recompose() the story and check for story.overflows.

 

Also note, that there could be circumstances in the Word file where you run in permanent overflow.

Look up some discussions here at the InDesign user forum where we discussed exactly this some years ago.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2022 Jun 11, 2022

Copy link to clipboard

Copied

LATEST

Oops. Just noticed that this thread is from November 2021…

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines