Mobile app version of vmapp.org
Login or Join
Nickens508

: HorizontalScale when exporting JPG limits to 776.19 I'm trying to export jpeg files from multiple eps files (with many different artboard sizes) with a specific size - 5000px on long edge. But

@Nickens508

Posted in: #AdobeIllustrator #Export #IllustratorScripting #Javascript #Jpg

I'm trying to export jpeg files from multiple eps files (with many different artboard sizes) with a specific size - 5000px on long edge. But when artboard is too small horizontalScale exceed its range and script fails. Is there anyway I can solve this problem?

Here is my script:

var doc = app.activeDocument;
var abActive = doc.artboards[doc.artboards.getActiveArtboardIndex()];

var artWidth = abActive.artboardRect[2] - abActive.artboardRect[0];
var artHeight = abActive.artboardRect[1] - abActive.artboardRect[3];

if (artWidth>=artHeight)
{
var fileName = doc.fullName.toString();
var exportOptions = new ExportOptionsJPEG();

var fileSpec = new File(fileName);
exportOptions.antiAliasing = true;
exportOptions.artBoardClipping = true;
exportOptions.qualitySetting = 100;
exportOptions.horizontalScale = (5000/artWidth)*100;
exportOptions.verticalScale = (5000/artWidth)*100;

doc.exportFile( fileSpec, ExportType.JPEG, exportOptions );
}
else
{
var fileName = doc.fullName.toString();
var exportOptions = new ExportOptionsJPEG();

var fileSpec = new File(fileName);
exportOptions.antiAliasing = true;
exportOptions.artBoardClipping = true;
exportOptions.qualitySetting = 100;
exportOptions.verticalScale = (5000/artHeight)*100;
exportOptions.horizontalScale = (5000/artHeight)*100;


doc.exportFile( fileSpec, ExportType.JPEG, exportOptions );
}


P.S. I thought about cheking artboard size before export and if it too small - scale it to needed size, but it would make export process really slow.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Nickens508

1 Comments

Sorted by latest first Latest Oldest Best

 

@Vandalay110

I've tried different export format and PNG worked. Instead of JPG, PNG does not have this limit in scale. And after export it easy to convert all PNG into JPG using something like ACDSee etc.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme