Copy link to clipboard
Copied
Hi,
We can use Shift + Click to insert multi-page Word document into InDesign.
How can I do it using CEP extension/script? Right now, using place only 1st page of Word Document is getting inserted.
Copy link to clipboard
Copied
Hi,
you could trust an automation mechanism that can be turned on or off with InDesign's preferences to add pages and thread the needed text frames: Preferences > Type > Smart Text Reflow or you could add pages and thread text frames until all the contents is visible on the pages.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Please let me know if that can be done using CEP extension i.e. JavaScript/ExtendScript because I am bit new to InDesing and unable to find Smart Text Reflow option in CEP tutorial.
Copy link to clipboard
Copied
Hm. You have to study the vast ExtendScript DOM documentation of InDesign compiled by Gregor Fellenz:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html
Let's assume you know that Smart Text Reflow could be a property of the app or an individual document.
Further, in the UI it obviously has to do with preferences and text. Because I already dealt with it I knew that there are textPreferences. So I searched for textPreferences in the documentation and found this:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#TextPreference.html
Here all the properties you need ( and also a lot you do not need ) are listed.
app.documents[0].textPreferences.smartTextReflow = true ;
That would basically turned it on or off. But look also into other properties that come along with it:
preserveFacingPageSpreads
limitToMasterTextFrames
etc.pp.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thanks a lot for your reply.
But I am facing one issue that:
If I open new document with Primary Text Frame enabled manually without script then Smart Text Reflow works,
But if I create a new document using app.documents.add() then Smart Text Reflow is not working. I am using following options. Please check what I might be missing?
app.activeDocument.documentPreferences.createPrimaryTextFrame = true;
app.activeDocument.textPreferences.smartTextReflow = true;
Copy link to clipboard
Copied
Hi @SVIDdev, I know this is an old post, but I was looking for something similar and I found some great info in another answer by @Laubender. Maybe it would help you. I've added in the smartTextReflow bits and other things.
- Mark
var myDoc = app.documents.add(
{
documentPreferences:
{
intent: DocumentIntentOptions.PRINT_INTENT,
facingPages: false,
createPrimaryTextFrame: true,
pageOrientation: PageOrientation.PORTRAIT,
pagesPerDocument: 1,
startPageNumber: 1,
pageHeight: "210mm",
pageWidth: "297mm"
},
textPreferences:
{
limitToMasterTextFrames: true,
linkTextFilesWhenImporting: false,
smartTextReflow: true
},
viewPreferences:
{
rulerOrigin: RulerOrigin.SPREAD_ORIGIN,
showRulers: false,
horizontalMeasurementUnits: MeasurementUnits.MILLIMETERS,
verticalMeasurementUnits: MeasurementUnits.MILLIMETERS
}
}
);
Copy link to clipboard
Copied
Hi SVIDev and Mark,
maybe the best bet is to turn off smartTextReflow and to add pages and threaded text frames until a given placed text or Word doc is flowing in entirely.
You may also discover, that there is a permanent overflow of text that often can happen when images are placed with a Word document and the anchored image's height exceeds the frame height of the recieving text frame. Very likely in some cases, because InDesign's import for Word will not handle the crop of an image properly that you have done in Word.
How to handle this particular issue is a different discussion…
Regards,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
Thanks @Laubender, in my case the smart text reflow suits me, but I'm bringing in Excel file, not Word, and in a fairly controlled environment. However, your warning is good to know—I think I may have come across that problem years ago. Can't remember how—or if—I solved it.
- Mark