Given this parameters:
var exportOptions = new ExportOptionsJPEG(); exportOptions.antiAliasing = true; exportOptions.horizontalScale = 500; exportOptions.verticalScale = 500; exportOptions.qualitySetting = 100;
How did it come up with this properties(see dimensions and resolution properties)?
May I know the computation for this?
Also when exporting JPEG in illustrator, the UI show this:
How can I simulate those values using the scripting way(ExportOptionsJPEG)
horizontal/verticalScale is a percentage (e.g. 500% in that instance).
qualitySetting is the compression level (100 = no/minimum compression).
What are the dimensions of the original file?
See attached for the exact AI file.
This is the image generated using Export as JPEG via illustrator UI
This is the image generated using ExportOptionsJPEG via scripting
Here the details of exported image via Illustrator UI
Your first post shows different settings (72 PPI and CMYK ve 300 PPI RGB). Which do you want to achieve?
There is no PPI setting in ExportOptionsJPEG. Do you want a particular pixel size or a particular real-world size (inches or cm)?
It's 300 PPI RGB.
I just wanted to know how to simulate the export JPEG in illustrator UI on ExportOptionsJPEG script.
For example: on export UI I selected this options: 300 PPI RGB and then it produces an image with 1613x2682 dimension and 300x300 dpi. What values(vertical/horizontal scale) should I added to ExportOptionsJPEG script to produce the same image?
That would suggest you are exporting from a 387 x 644 px document in Illustrator?
As I said, there is no PPI setting in ExportOptionsJPEG.
If you want a 1613x2682 px file, I suggest you create an artboard that size and use horizontal/verticalScale of 100.
Provision for applying PPI appears to have been introduced with the Export for Screens options. See here for some discussion, especially Carlos's post:
You did nothing to set ppi in your code. It is not calculated from your unrelated options. It is not set at all. 96 is a default shown by some viewers; others show a default of 72.