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

Create layer wider than the document?

Contributor ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

Hello,

Maybe it's a stupid question but is there a way to create an art layer (whose kind is LayerKind.NORMAL) wider than the actual document?

For exemple, if my active document is 800 x 600 pixels, I would like to create an art layer of 1000 x 800 pixels.

At least, I could to that by:

1 - getting size and resolution of active document

2 - creating  a temporary new document with desired size at the same resolution

3 - copying the background of the new document

4 - pasting it in my original document

5 - closing without saving the temporary document

But it doesn't seem to be a very clean process. Furthermore, it would erase any previous clipboard's content.

TOPICS
Actions and scripting

Views

883
Translate

Report

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

People's Champ , Sep 20, 2018 Sep 20, 2018

I can suggest doing so

var w = 1000;

var h = 800;

var tmp = preferences.rulerUnits;

preferences.rulerUnits = Units.PIXELS;

activeDocument.artLayers.add();

var c = new SolidColor() ;

c.rgb.hexValue = "FFFFFF";

activeDocument.selection.selectAll(); 

activeDocument.selection.fill(c);

activeDocument.selection.deselect();

activeDocument.activeLayer.resize(100*w/activeDocument.width.value, 100*h/activeDocument.height.value);

preferences.rulerUnits = tmp;

Votes

Translate
Adobe
People's Champ ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

I can suggest doing so

var w = 1000;

var h = 800;

var tmp = preferences.rulerUnits;

preferences.rulerUnits = Units.PIXELS;

activeDocument.artLayers.add();

var c = new SolidColor() ;

c.rgb.hexValue = "FFFFFF";

activeDocument.selection.selectAll(); 

activeDocument.selection.fill(c);

activeDocument.selection.deselect();

activeDocument.activeLayer.resize(100*w/activeDocument.width.value, 100*h/activeDocument.height.value);

preferences.rulerUnits = tmp;

Votes

Translate

Report

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
Community Expert ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

You should have no problem add a new empty layer and filling it with a color and then transform its size to what you want using  the correct percentages for the width and height.  In this case 125% wide and 133.33% high if the layer had an image it would distort because the the percentages are not the same. Here I add  a green layer under a red canvas size layer and transformed the green layer.  I then ran a script the added guide to the layers bounds.

JJMack

Votes

Translate

Report

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
Contributor ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

LATEST

Thanks to both of you, it works

A smarter solution than the one I was thinking of.

Votes

Translate

Report

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