Skip to main content
Inspiring
Mar 20, 2025 3:01 PM UTC
Answered

Resize PDF to fit the textFrame

Hello, i insert a PDF but i'm not able to resize it to fit a certain dimension.

 

My code is:

var pdf = textFrame.place(myPDFPath);
textFrame.fit(FitOptions.CENTER_CONTENT);

 

That center the pdf in the page but I can't resize it.

I tried pdf.resize but without success

I'm using Indesign CS5.5 

giovanni_4827Correct answer
Inspiring
Mar 20, 2025 3:04 PM UTC

I solved using 

textFrame.fit(FitOptions.CONTENT_TO_FRAME);
textFrame.fit(FitOptions.CENTER_CONTENT);

2 replies

giovanni_4827AuthorCorrect answer
Inspiring
Mar 20, 2025 3:04 PM UTC

I solved using 

textFrame.fit(FitOptions.CONTENT_TO_FRAME);
textFrame.fit(FitOptions.CENTER_CONTENT);
Translate
Robert at ID-Tasker
Legend
Mar 20, 2025 5:22 PM UTC

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#FitOptions.html

 

Fill Proportionally might be better? 

 

Translate