Override HorizontalScale limits (776.19) when you export a JPG

I'm trying to export JPEGs of multiple files eps (with a lot of different sizes of work plan) with a specific size - 5000px long edges. But when the work plan is too small horizontalScale exceed its range and script fails. Is there anyway that I can fix this?

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 size Board chart cheking prior to export, and if she too small - scale size needed, but it would be really slow export process.

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 ExportOptionsPNG24();

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

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

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

            doc.exportFile( fileSpec, ExportType.PNG24, exportOptions );
        }
doc.close(SaveOptions.DONOTSAVECHANGES);

I also add savings witout file close command. When creating of action with this script and the batch processing of multiple files, it allows to reduce the working time of script.

To convert PNG to JPG I use XnConvert it's free and they all need the functionality of batch convert files.

Tags: Illustrator

Similar Questions

  • How to delete Messages When you export the form to Excel results

    Update:

    I created a menu to call a procedure of database (with asset_id as parameter) that sends a request to retrieve the details of Bill of fa.  It works when I hardcode the asset_id but whenever I try to refer to the system asset_id, I get error messages about invalid tokens, keyword not found, not all variables, etc.

    Here are the formats I've tried:

    ${: item.invoices.asset_id.value}

    ${item.invoices.asset_id.value}

    {: item.invoices.asset_id.value}

    $: item.invoices.asset_id.value

    : item.invoices.asset_id.value

    Item.Invoices.asset_id. Value

    ${item.invoices.asset_id}

    : invoices.asset_id.value

    Should what format I use?

    Thank you!

    Greetings,

    We have a customization of forms on the FAXASSET form, based on the responsibility that disables updates when you navigate to Source lines.  The form generates messages "you can create folders here" without the customization.  Customization has solved the problem with the messages, but the messages to erupt again when users export the data to Excel.  How can we remove these messages when you export to Excel?

    Thank you!

    Scott

    Application version: 11.5.10 CU2

    Database: 10.2.04

    Server: AIX 5.3 on IBM P750

    Hello again,

    The variable being passed to the database procedure is digital so I don't think it was necessary, but it is!

    This format has made the Tower - add three ticks around the reference item.block.field.value.

    '''|| ${item.invoices_header.asset_id.value} | " '

  • Blue mount when you export images via Media Encoder CC 2015 Lumetri

    Hi all

    I have a really weird issue involving images with a Lumetri applied LUT and export through Media Encoder. Rendered images will come out with a massive distribution of blue color. I use CISC-c of a MkII C100 and application of color Lumetri with a LUT and then a few basic correction (no creative effects). There is no other effect applied to the images, and the exported result is not equivalent to the images without the applied LUT (so this isn't like ME is just without taking into account the effect). Export directly from the first results in video correct research, as does the export through ME without the applied LUT.

    Images of example (as it appears in the first and when you export directly, first and then when exported from Media Encoder with the color cast):

    direct.pngmedia_encoder.png

    I'm under Premiere Pro CC 2015 (up to date as that is to ME) on Windows 7 64 bit Pro, Intel Core i7-4910MQ, 32 GB of Ram, Quadro K4100M (362,13 drivers). I can't say with certainty when this problem first arose, partly because I am not using lut for a long time, but it was certainly past at least a month or two. I tried searching online on this subject, but the only similar thing I came up with that was of CS5.5 and given workaround solution was to place an effect of cropping on the video, which I have tried without success.

    Someone else has experienced this or has any ideas please? I can export directly from first as a solution, but it's not ideal at all because I can't move on to other work while it exports.

    Thank you very much

    Tim

    Hi cast,

    What is the setting of reading Mercury on Premiere Pro and SOUL engine?

    In addition, in the preferences of the SOUL, could you please uncheck the option "Import sequences in native mode" and check if it works?

    Thank you

    Regalo

  • How do I make the "REVERB" effect when you export the multitrack mixer?

    How do I make the "REVERB" effect when you export the multitrack mixer?

    The pre-rendered in multitrack view tool is the tilde to bit at the bottom of the effects rack lightning bolt.  Select the range that you have pre-made and click on the button that will turn blue when activated.

    Alternatively, you can go to the sight of waveform on the track, you need to pre render, apply the effect, and use the Save command as (with a new name) to save the new version and keep the original.  Less elegant than pre rendered but sometimes useful.

  • When you export from adobe story to the final draft, there are numbers rolling down both margins. How can I get rid of them?

    When you export from adobe story to the final draft, there are numbers rolling down both margins. How can I get rid of them?

    So that we can suggest an appropriate workaround solution, we would need to have a look at your script of history

    Can you please mail version ".stdoc" of your script of history we at [email protected] ?

    You can export your Story script in the format '.stdoc' by ' file > save to disk ' option

  • When you export files, I get the error message: "Export is not possible..." »

    When you export files, I get the error message: "Export is not possible, an internal error has occurred: error Win32 API 2.» The system cannot find the specified file... The photo is indeed exported correctly, the error message is always and must be confirmed by "OK". The old version of LR had the problem, not only again 5.7.1 (5.5 there)

    In the "Post processing" section at bottom of the export dialog box, change the selection labeled "after export" of blank (no chosen selection) in the selection of actual 'doing nothing '.

    See this thread for more details: error after you have completed the export of JPEG

    Mike

  • When you export to epub, only about 1/3 of my chapters receive page breaks. Each chapter is in its own doc, and I tried to split apart by doc. and H1, without success. Help

    All my styles to paragraphs seem to jive, and no matter what I do, most of my chapters seem to miss their page breaks. I've heard of others having this issue with earlier versions of Indesign, but I'm on CC2014, and I thought that should be fixed now. I really won't need to learn HTML code and go break the doc epub to fix it manually, because it still doesn't work across all devices either.  I know others have this problem before racing. What I am doing wrong?

    Make sure that the paragraph style applied to the chapter title (if it is the first line of each chapter) is the tag. Open the paragraph style and go to the export of marking and Split Document (epub only). Then, when you export (assuming you are using recomposable) under general > check Split Document based on paragraph Style tags export. Try it and tell us if it helps.

  • When you export to PDF from Word, 5th level indent pdf as an image, and not as searchable text.  How can I fix it?

    Is it a setting in Adobe, in Word?  Result is the same as I print to PDF or save - as pdf.

    Thank you

    TM

    It seems to be a known issue with Adobe PDFMaker in Word 2007; more specifically there are problems when you export header 7, 8 and 9.

    It seems that the PDF file is published correctly when you use:

    File > export > "Create a PDF/XPS Document" with "ISO 19005-1 compliant (PDF/A)" radio button checked.

  • "Non-rectangular objects will not display correctly when you export with the help of CSS."

    I use Ind CC 2014 export a document to an epub recomposable.  The document contains a picture .ai.  The image export correctly in some parts of the the.epub, but not others, when it is deformed. There is a warning on export: "Non-rectangular objects will not display correctly when you export using CSS."  Any suggestion is appreciated.

    Hello

    For these objects, the best option is to 'rasterize container"to preserve appearance of the page layout setting in the Options of the Export Object dialog box and then export to EPUB recomposable.

    Kind regards

    POOJA

  • How to use DPS as Folio overlays when you export to SWF format?

    I create an interactive magazine in InDesign, it is decided that the magazine is exported to SWF format and downloaded on the website of our company for viewing by the public. I want things like blocks of text scrolling and slideshows. I knew InDesign had an update to include DPS features such as overlays in Folio, so I applied a superposition of slideshow and a floating frame, but none of them is not working after that I exported to SWF format. I always want to have slideshows and scrolling frames how can I have them again when you export to SWF format?

    Features DPS are only for DPS. SWF is about as dead as dead can be at this point.

    If you want to use some of these types of features on the web, I suggest to look in in5 by ajar Productions. http://ajarproductions.com/pages/products/IN5/?ref=footer

  • Nonprinting buttons appearing in the wrong order when you export to interactive PDF!

    I am a customizable holiday gift certificate creating generic view on our website for download. I create using InDesign CS6. The idea is that the interactive PDF can be opened in the reader, one of the six charts of certificate can be selected (via the radial buttons that hide/show graphics that have been converted into buttons), and various text fields can be filled in. Then, the certificate can be printed and cropped. I have all the interactive elements, works very well, including the "print" key. The interactive PDF looks like this:

    Waste_Free_Certificates_correct.jpg

    However, when printing, I would ONLY the certificates and the fields of text to print and not the instructions, header, or radial buttons selection certificate or full color, background. The point of this is so that the user doesn't lose the ink. I want to print like this:

    Waste_Free_Certificates_printed.jpg

    At first I tried to make nonprinting objects, but which also shows them not when exported to interactive PDF. I then tried the same thing by putting on another layer and uncheck "print layer" (but check "show layer"), but I came across the same result. After searching the forums, I discovered that the only way to make these nonprinting elements, yet still visible in the interactive PDF, is to convert each object to a button and then uncheck the "Printable" box in the window buttons and forms. I did, and now everything seems to work fine...

    Except that when you export, export buttons in order of stacking poorly, like this:

    Waste_Free_Certificates_wrong.jpg

    This color background continues to go on in front of all the rest. Even if I put it on it's very own layer under layer with all other charts (converted to buttons) on this subject, he always appears in front of all the other buttons. It is the same whether or not I have check the box create Acrobat layers. What the devil I'm doing wrong?

    http://InDesignSecrets.com/stacking-order-bug-exporting-interactive-PDF.php

  • Why when you export to adobe pdf, it appears as a blank document when saved icon

    It worked once and then could do with the same procedure.

    Hello

    I think that you rename the file name when exporting the document. In this case add ".pdf" extension when you export after the file name.

    Please let me know if this does not solve your problem.

    Thank you

    GR - Adobe Story team

  • Can CS5 - I get the progress bar to show when you export to PDF?

    Hello

    Working on Mac OSX 10.5.8, CS5.

    I miss the progress bar when you export to PDF, it's annoying not knowing how long something has go when that's all you're waiting on that.

    No one knows how to get to show once again!

    See you soon!

    If you go to the title of the window > utilities > background tasks, you can check on the status of a PDF export.

  • lines green and pink when you export film 10.1.2

    Hi, I use iMovie 10.1.2 (OS El Capitan 10.11.6)

    I get the Green and pink lines when I export a movie - no idea why, his sporadic... it worked in previous versions

    Maybe a problem with the library? Help, please

    https://www.dropbox.com/s/lgubwt5frq5urg6/screenshot%202016-08-29%2021.58.02.PNG? DL = 0

    This problem was reported previously in the forum and I do not believe that a solution was already posted. Your project consists of all the video clips or a mixture of video and photos? Just noticed you said you see this, when exporting. Means that it is ok in the timeline?

  • How do I change the format when you export music files to thubdrive?

    I don't know if this has been posted.  I had a very enigmatic comment when I tried that I didn't understand.  Yet once, can I export music in lossless format file to a USB key and change its format to mp3 or aac? during the transfer?

    Roll T,

    When you add files to a USB drive, you simply make a copy.  If you want a different format, first to make the new version of iTunes and copy the new file on the disk.

Maybe you are looking for

  • 15.0.1 Firefox does not load disqus even in safe mode

    It is the site of NPR. I cleared my cache, deleted all cookies and restarted in safe mode. Disqus loads still constantly without never get there. Is what do you think?

  • DeskJet 1010: Deskjet 1010 will not be printed, but said there

    Hello Recently, I replaced the black cartridge in my printer HP Deskjet 1010. Subsequently, the printer would not print. Specifically, can I order a print job and it appears in my queue for a few moments, but then he quickly said that the job is done

  • How to open a file of mail.dat victory in Pages?

    When I received messages with attachments from users not Apple, I can't open the attachment because it is in a format of winmail.dat.  How can I open it?

  • AS3 reference site/document

    Hi guys Real newbie to AS3 here (currently, I'm a C++ programmer to research in the writing of the Adobe Air applications... my wife has some ideas for apps lol). My stupid question: where can I find a reference for *.AS projects library? I looked at

  • Cisco ASA with OSPF

    Hello Can an ASA cause internal and external interface in the same area 0, the same instance of OSPF? If I place the SAA in transparent mode OSPF works OK through the ASA? Thank you very much Wayne