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

Check and change document width and resolution.

Engaged ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

Hello, greetings to all!

How to check if a document has the width 21.5 cm in a resolution 200?

If the document has these values all ok, if not, please change.

It would be something like this:

var doc = activeDocument 

if(doc.resolution<200){ 

    doc.resizeImage (undefined, undefined, 200, )} 

This script alters the resolution however and I need it to change the value of the width "if it does not match" and thus proportionally change width and height at a 200 resolution.

TOPICS
Actions and scripting

Views

2.1K

Translate

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

Engaged , Sep 01, 2017 Sep 01, 2017

I usually do a sweep here in the community and I'm collecting information and I'm putting together one of the pieces: I found in these discourses something that might help you:

https://forums.adobe.com/message/9050951#9050951

https://forums.adobe.com/message/9463456#9463456

Result:

var doc = activeDocument 

if(doc.resolution<200){ 

    doc.resizeImage (undefined, undefined, 200, )} 

if(doc.resolution>200){ 

    doc.resizeImage (undefined, undefined, 200, )}

    activeDocument.resizeImage(new UnitVal

...

Votes

Translate

Translate
Adobe
Engaged ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

I usually do a sweep here in the community and I'm collecting information and I'm putting together one of the pieces: I found in these discourses something that might help you:

https://forums.adobe.com/message/9050951#9050951

https://forums.adobe.com/message/9463456#9463456

Result:

var doc = activeDocument 

if(doc.resolution<200){ 

    doc.resizeImage (undefined, undefined, 200, )} 

if(doc.resolution>200){ 

    doc.resizeImage (undefined, undefined, 200, )}

    activeDocument.resizeImage(new UnitValue (210, "mm"), undefined, undefined)

Code as clean as possible:

var doc = activeDocument 

if(doc.resolution<200)(doc.resolution>200){ 

    doc.resizeImage (undefined, undefined, 200, )} 

    doc.resizeImage(new UnitValue (210, "mm"), undefined, undefined)

Votes

Translate

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
Engaged ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

LATEST

Great! That's what I was looking for. Thank you for your help smithcgl9043167

Votes

Translate

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 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

If you set a document resolution to 200 and its width is not 21.5 cm you can interpolate it to 21.5CM and constrain the height to its current aspect ratio.  However, whenever you resample an image you will loose some image quality.  For your either throwing away details you have for the image or creating detail you do not have for the image.  You may want to use a particular interpolation method like bicubic.

JJMack

Votes

Translate

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