0

I want to resize entire indesign document width and height here is my code its give error

Error Number:11265 Error string: This value would cause one or more object to leave the paste board

please help me to fix, Thank you

var NEW_HEIGHT = '25 cm';  
var NEW_WIDTH = '18 cm';  

// MULTIPLE RESIZE() IN ONE STEP  
// =============================  
app.activeDocument.textFrames.everyItem().resize(  

    // Target bounding box(es) -- Use OUTER_STROKE_BOUNDS if needed  
    // ---  
    [CoordinateSpaces.INNER_COORDINATES, BoundingBoxLimits.GEOMETRIC_PATH_BOUNDS],  

    // Reference point -- Here resize is performed relative to the top edge  
    // ---  
    AnchorPoint.TOP_CENTER_ANCHOR,  

    // Absolute replacement  
    // ---  
    ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, 

    // [width, height] in points  
    // ---  
    [UnitValue(NEW_WIDTH).as('pt'), UnitValue(NEW_HEIGHT).as('pt')] 
    ); 
Haja
  • 74
  • 2
  • 11

1 Answers1

1

You need to increase the size of the pasteboard before you begin resizing.

To do this add the following line of code before your resize step:

app.activeDocument.pasteboardPreferences.pasteboardMargins = [ '1000pt', '1000pt'];

Note: You may need to increase the x and y values (i.e. 1000pt) depending on the size of your document(s).

Further info regarding the PasteboardPreference class can be found here.

RobC
  • 22,977
  • 20
  • 73
  • 80
  • Thanks for your reply. its work only once, when i execute this script again its shows same error. – Haja Nov 08 '18 at 19:56
  • 1
    Haja - Is it only working once when you execute the script again on the same document or another/different document? Perhaps the x and y values need increasing for the document that you’re getting the same error. – RobC Nov 08 '18 at 21:30