0
Engaged
,
/t5/illustrator-discussions/how-do-i-create-a-new-document-with-the-same-dimensions-as-the-original-document/td-p/14987175
Nov 18, 2024
Nov 18, 2024
Copy link to clipboard
Copied
If you make a new document with dimensions as in the original document, then the dimensions of the artboard do not match at all in the new document, how can this be handled?
var sourceDoc = app.activeDocument;
var newDoc = app.documents.add(DocumentColorSpace.CMYK);
newDoc.artboards[0].artboardRect = sourceDoc.artboards[0].artboardRect;
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Expert
,
Nov 18, 2024
Nov 18, 2024
instead of copying the Artboard dimensions, try using a document Preset where you can supply some of the properties before creating the document
var sourceDoc = app.activeDocument;
var docPreset = new DocumentPreset;
docPreset.width = sourceDoc.width;
docPreset.height = sourceDoc.height;
docPreset.units = RulerUnits.Points;
docPreset.colorMode = DocumentColorSpace.RGB;
var newDoc = app.documents.addDocument("Web", docPreset);
Explore related tutorials & articles
Community Expert
,
LATEST
/t5/illustrator-discussions/how-do-i-create-a-new-document-with-the-same-dimensions-as-the-original-document/m-p/14988432#M427178
Nov 18, 2024
Nov 18, 2024
Copy link to clipboard
Copied
instead of copying the Artboard dimensions, try using a document Preset where you can supply some of the properties before creating the document
var sourceDoc = app.activeDocument;
var docPreset = new DocumentPreset;
docPreset.width = sourceDoc.width;
docPreset.height = sourceDoc.height;
docPreset.units = RulerUnits.Points;
docPreset.colorMode = DocumentColorSpace.RGB;
var newDoc = app.documents.addDocument("Web", docPreset);
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

