Override HorizontalScale limits (776.19) when exporting 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.
