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

How do I create a new document with the same dimensions as the original document?

Engaged ,
Nov 18, 2024 Nov 18, 2024

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
205
Translate
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

correct answers 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);
Translate
Community Expert ,
Nov 18, 2024 Nov 18, 2024
LATEST

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