Export a selection to jpg (JS)

Is it possible to export a selection to jpeg with Javascript? There are only exportRange and exportAll enumerations available in the jpeg export preferences. I know that the "long cut" is to resize page to match the size of the selection, center selection in the page and export page. Setting Showing options to true is no option.
Many thanks in advance!

Hi,
Notice that you call exportFile() method with some target.
An object (group) can be a target as well.
So:
     app.activeDocument.exportFile(ExportFormat.JPG, mFile)
uses a target set in preferences (page range or all pages)
but
     textFrame.exportFile(ExportFormat.JPG, mFile)
has target set already to a textFrame.
Jarek

Similar Messages

  • Export PDF file  to JPG file

    I was able to export PDF file to JPG file so that it can be imported to iPhoto.   Suddenly, I found on the DPF File drop down menu I do not find the Export except top Ecel or Word.  Anybody can help ?

    Not a direct answer to your question, but an alternative way to go from .pdf to .jpg.
    Open the .pdf in Preview, then select "Save as" in the File menu, and select .jpg for the format:

  • Help with exporting gradient background as jpg

    Hi there! I'm totally new to this forum & very new to
    fireworks, so go easy on me!
    I am designing for QVGA smartphone/PPc screens & find
    that when I create a gradient in fireworks MX (version 6) &
    then export it as a jpg, on the phone/PPC screen the gradient is
    filled with big blocks of colour rather than smooth transitions
    between them, making the overall effect more like lines or blacks
    of colour than a smooth gradient. I am exporting the jpgs at the
    highest quality settings (100%).
    Can someone help? Is it just my lack of technique when
    blending colours? If so is there a tutorial somewhere? Or can I
    export in a different format? The screens I design are controlled
    by an xml layout file, & will accept .jpg, .gif & .bmp
    Thanks!

    Yes, as I mentioned earlier in this thread, the bit depth
    could be the
    issue. Try setting your monitor to 16 bit and experiment with
    gradients
    at that bit depth. Keep the color range and the tonal range
    less extreme
    (light blue to dark blue for example, rather than white to
    dark blue)
    similar an you might be able to get something a little more
    pleasing.
    Jim Babbage - .:CMX:. & .:ACE:.
    Extending Knowledge, Daily
    http://www.communityMX.com/
    CommunityMX - Free Resources:
    http://www.communitymx.com/free.cfm
    .:Adobe Community Expert for Fireworks:.
    news://forums.macromedia.com/macromedia.fireworks
    news://forums.macromedia.com/macromedia.dreamweaverdrblow
    wrote:
    > Thanks again for the replies y'all!
    >
    > As far as I can gather from web sources, the PPI of my
    smartphone QVGA screen
    > is 96ppi. Setting the canvas PPI does not seem to affect
    the quality of either
    > jpg, gif or bmp formats on export, once they are on my
    phone screen. It would
    > appear form web sources that the phone screen displays
    16 bit colour depth.
    >
    > I have tried to make the gradient as smooth as possible
    & on my laptop screen
    > it looks really good. Any more suggestions?
    >
    > Thanks.
    >

  • [SOLVED] How to export a selection in a PDF file as PDF ?

    I tried a lot of PDF readers, but none of them supports exporting a selection as PDF. Okular have a similar function, but it can only save selections as JPEG or PNG. Alternatively, I can take a screenshot of a selection in one PDF reader, but still JPEG. I want to use this function to crop a selection such as formulas, vector graphics inside a PDF file. I know Preview.app in OS X works great for me. I am wondering if there is any alternatives for Linux. Thank you so much.
    Last edited by mssun (2015-03-20 08:34:20)

    Maybe take a look at: https://aur.archlinux.org/packages/gpdfx/ or maybe one of PDF's editors like MasterPDFEditor (free for non-commercial use), pdfeditor etc. Or one of converters like pdf2html and after conversion plug html (or the other format) into LaTeX document. Or... make OCR on PDF and then plug document saved in even plain txt format. Also, there is this utility: http://www.ctan.org/tex-archive/macros/ … b/pdfpages (and in AUR: https://aur.archlinux.org/packages/latex-pdfpages/) - maybe it will be helpful for you (I don't use LaTeX).

  • In bridge i select a jpg image with cntrl r to open in camera raw but get "camera raw not avail"

    In bridge i select a jpg image with cntrl r to open in camera raw but get "camera raw not available"  camera raw editing requires that a qualifying product has been launched at least once to enable this feature.  I can open nef. in camera raw with no problem.

    Hm, what I suggested might actually be a possibility then...
    Close whatever version you have open first...
    I think Adobe installs shortcuts for both 32 and 64 bit Photoshop in the start menu.
    If you can't find the 32 bit Start menu entry, look for the 32 executable here (changing the CS version number to whatever yours is):
    C:\Program Files (x86)\Adobe\Adobe Photoshop CS5\Photoshop.exe
    -Noel

  • How to export only selected columns of WD ALV to excel

    Hi,
    I have WD ALV report with EXPORT button (since standard button was not working properly i just hide that and added custom one) & standard dropdown to choose layout. Out of 20 columns user may choose n number of columns, the same number of columns i need to transfer to xls. How to export only selected columns to xls. Any method or FM to filter number of columns being transfer to xls. please advise
    Rgds
    sudhanshu

    Hi,
    Where exactly we are (or going to be) using this reference i.e., CL_SALV_WD_CONFIG_TABLE. Im passing contents, filename & MIME type as:
    call function 'SCMS_STRING_TO_XSTRING'
        exporting
          TEXT   = TEXT
        importing
          BUFFER = XTEXT.
    WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
    **path to the word file
        I_FILENAME = 'WDP.xls'
    String Variable
        I_CONTENT =  XTEXT
    File Type
        I_MIME_TYPE = 'EXCEL' ).
    In CL_SALV_WD_CONFIG_TABLE we have few methods related to column settings however not sure where exactly we will be using this class reference. can you please give some idea so that i can do some r&d in that.
    Rgds
    Sudhanshu

  • Export Indd to EPS/JPG and set the file name  for EPS/JPG file

    Hi,
       When I export the INDD to JPG/EPS, I want to set the file name with pageNumber  for JPG/EPS files using javascript.
    For Example
    If I set the file name as EPSFile.eps, after exporting the indd(with 2 pages) to eps
    ,files are generating in the following name EPSFile_1.eps, EPSFile_2.eps.
    but I want to set the file name as EPSFile_001.eps and EPSFile_002.eps using javascript.
    anyone knows please reply for this.
    Regards,
    Mubeen

    Hi,
      I tried the following code.
    var JPGe = new File("Applications/PDF/JPG/file.jp");
    app.activeDocument.exportFile(ExportFormat.jpg, );
    when I use this code ,exported jpg file names are
    file.jpg, file1.jpg,file3.jpg.
    but ,I want the output file names as file_001,file_002,file_003,
    Thanks,
    Mubeen

  • Acrobat X Pro - Export multiple PDFs to JPG

    In Acrobat 9 Pro I am able to export multiple pdfs to jpg using file--->export multiple....   In Acrobat X I can't seem to find this funtionality.  Any ideas?
    Thanks.

    I tried this script and it did work but I needed to export to PNG rather than JPG. I could not see a way to do that without actual scripting, which I don't know how to do. So I opened the script linked here in Textpad and just changed "jpg" to "png" and it worked - happy day for me! If anyone would like to download this action, you can find it here: http://ccl.rutgers.edu/~lindaeve/acrobatx/Export_to_PNG.sequ
    Linda

  • Is there way to export a selection to JPEG through script (CS3)

    Hi all,
    Is there way to export a selection to JPEG through script (CS3).
    CS2 has possible method to export a selection to JPEG using the method
    Application.JPEGExportPreferences.ExportingSelection = True. But this method is not supported in CS3.
    Regards,
    Hemi

    Hi Hem,
    http://forums.adobe.com/thread/424774?tstart=30
    regards,
    sudar

  • Export specified pages as jpg at defined resolution

    Hello inDesign Community -
    I have a script that allows me to export pages specified from a dialog prompt as jpgs at a specific resolution (500px wide).
    This is great for making thumbnails, however It uses the dimensions of the active document page to set the resolution formula.
    This works unless there are different sized pages, at which point you get different sized jpg.
    How can use the page dimensions of each page that is being exported individually.
    I assume there is a way to get an array from jpegExportPreferences.pageString that can then be looped through.
    Thanks in advance
    // which pages to export
    var pagesToExport
    // final jpg demensions
    var myLargeWidth = 500;
    var myLargeHeight = 500;
    // create a variable for current active document
    var docRef = app.activeDocument;
    // remove ententions from end of file path
    myFilename = docRef.name.replace(/\.[^\.]+$/, '');
    // set variable to save file in same directory as active document
    myFolder = docRef.filePath;
    // set document measurments to points and reset ruler orgin
    docRef.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    docRef.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
    docRef.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
    docRef.zeroPoint = [0,0];
    //bounds    Array of Measurement Unit (Number or String)    readonly    The bounds of the Page, in the format [y1, x1, y2, x2].
    // find width of page
    var myCurrentWidth = app.activeWindow.activePage.bounds[3]-app.activeWindow.activePage.bounds[1];
    // find height of page
    var myCurrentHeight = app.activeWindow.activePage.bounds[2]-app.activeWindow.activePage.bounds[0];
    function exportJPG() {
      // export large jpg
                if (myLargeWidth > 0) {
                    // Calculate the scale percentage
                    var myResizePercentage = myLargeWidth/myCurrentWidth;
                    var myExportRes = myResizePercentage * 72;
                    // exportResolution is only accurate to 1 decimal place, so round
                else {
                    // Calculate the scale percentage
                    var myResizePercentage = myLargeHeight/myCurrentHeight;
                    var myExportRes = myResizePercentage * 72;
                // use caluclated percentage as resolution
                app.jpegExportPreferences.exportResolution = myExportRes;
                // export jpg in myfolder add .jpg to end.
                docRef.exportFile(ExportFormat.JPG, File(myFolder+"/"+myFilename+"-500px.jpg"));
                // reset back to inches
                docRef.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;
                docRef.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;
    var myName = myInput ();
    // rest of the script
    function myInput ()
      var myWindow = new Window ("dialog", "Pages to export as JPG");
      var myCommentGroup = myWindow.add ("group");
      myCommentGroup.add ("statictext", undefined, "export some jpgs", {multiline:true});
      //myCommentGroup.maximumSize.width = 200;
      var myInputGroup = myWindow.add ("group");
      myInputGroup.add ("statictext", undefined, "Pages: (1-3,8,10)");
      var myText = myInputGroup.add ("edittext", undefined, "1");
      myText.characters = 20;
      myText.active = true;
      var myButtonGroup = myWindow.add ("group");
      myButtonGroup.alignment = "right";
      myButtonGroup.add ("button", undefined, "OK");
      myButtonGroup.add ("button", undefined, "Cancel");
      if (myWindow.show () == 1)
      return myText.text, pagesToExport = myText.text;
      else
      exit ();
    // jpg export preferences
    app.jpegExportPreferences.exportingSpread= false;
    app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.HIGH;
    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.EXPORT_RANGE;
    app.jpegExportPreferences.pageString = pagesToExport;
    app.jpegExportPreferences.embedColorProfile = false;
    app.jpegExportPreferences.jpegColorSpace= JpegColorSpaceEnum.RGB;
    app.jpegExportPreferences.antiAlias = true;
    exportJPG();
    // run function

    Hi,
    1. You need to insert myCurrentWidth & Height calculation into function exportJPG() and execute it for each page;
    2. This function supposes to be run with each chosen page and different exportPreferences;
    3. So  you need split a string variable pageToExport into array collecting separate pages.
    Like this:
    // which pages to export
    var pagesToExport;
    // final jpg demensions
    var myLargeWidth = 500;
    var myLargeHeight = 500;
    // create a variable for current active document
    var docRef = app.activeDocument;
    // remove ententions from end of file path
    myFilename = docRef.name.replace(/\.[^\.]+$/, '');
    // set variable to save file in same directory as active document
    myFolder = docRef.filePath;
    // set document measurments to points and reset ruler orgin
    docRef.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    docRef.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
    docRef.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
    docRef.zeroPoint = [0,0];
    function exportJPG(cPage) {
    // export large jpg
    //bounds    Array of Measurement Unit (Number or String)    readonly    The bounds of the Page, in the format [y1, x1, y2, x2].
    // find width of page
    var myCurrentWidth = cPage.bounds[3]-cPage.bounds[1];
    // find height of page
    var myCurrentHeight = cPage.bounds[2]-cPage.bounds[0];
    if (myLargeWidth > 0) {
    // Calculate the scale percentage
    var myResizePercentage = myLargeWidth/myCurrentWidth;
    var myExportRes = myResizePercentage * 72;
    // exportResolution is only accurate to 1 decimal place, so round
    else {
    // Calculate the scale percentage
    var myResizePercentage = myLargeHeight/myCurrentHeight;
    var myExportRes = myResizePercentage * 72;
    // use caluclated percentage as resolution
    app.jpegExportPreferences.exportResolution = myExportRes;
    app.jpegExportPreferences.pageString = cPage.name;
    // export jpg in myfolder add .jpg to end.
    docRef.exportFile(ExportFormat.JPG, File(myFolder+"/"+myFilename + "_" + cPage.name + "-500px.jpg"));
    // SUI Dialog      
    myInput ();
    // jpg export preferences
    app.jpegExportPreferences.exportingSpread= false;
    app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.HIGH;
    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.EXPORT_RANGE;
    app.jpegExportPreferences.embedColorProfile = false;
    app.jpegExportPreferences.jpegColorSpace= JpegColorSpaceEnum.RGB;
    app.jpegExportPreferences.antiAlias = true;
    // run function (loop through chosen pages)
    var b, c, d, stop;
    b = pagesToExport.split(",");
    while (c = b.shift() ) {
      d = c.split("-");
      stop = parseInt(d[0]);
      while (stop <= parseInt(d[d.length-1]) ) {
           exportJPG(docRef.pages.item(stop-1));
           stop++;
    // reset back to inches
    docRef.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;
    docRef.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;
    // rest of the script
    function myInput ()
      var myWindow = new Window ("dialog", "Pages to export as JPG");
      var myCommentGroup = myWindow.add ("group");
      myCommentGroup.add ("statictext", undefined, "export some jpgs", {multiline:true});
      //myCommentGroup.maximumSize.width = 200;
      var myInputGroup = myWindow.add ("group");
      myInputGroup.add ("statictext", undefined, "Pages: (1-3,8,10)");
      var myText = myInputGroup.add ("edittext", undefined, "1");
      myText.characters = 20;
      myText.active = true;
      var myButtonGroup = myWindow.add ("group");
      myButtonGroup.alignment = "right";
      myButtonGroup.add ("button", undefined, "OK");
      myButtonGroup.add ("button", undefined, "Cancel");
      if (myWindow.show () == 1)
      return pagesToExport = myText.text;
      else
      exit ();
    Notice that different page sizes can lead to different width/height proportions.
    In this case JPGs will still differ. (by height)
    Jarek

  • Export Data Sets as jpgs?

    Is there a way to export data sets as jpgs instead of psd? The whole point is fast file creation and having a folder full of new psds which I then have to convert to jpg is kinda a silly step. Am I missing something?

    I think because of the way variables work (at least the data set part), they need layers
    ( files that are not flattened) and jpegs don't support layers.
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7417a.h tml
    If your intention is saving different variations of your opened
    file, you could use layer comps.
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7870a.h tml
    Then use export layer comps to files under the scripts menu.
    MTSTUNER

  • LR4 - Anyone notice slower export times - RAW to JPG?

    I read through the "Lightroom 4 is slow" thread - very good reading. I have noticed many of the same issues & hope Adobe is paying attention to that thread!
    No one mentioned a slowdown in exporting RAW files to JPG. My average time for exporting Canon 7D CR2 files to full sized 300dpi JPGs in LR 3 is about 5.3 seconds per file. The same exports in LR 4 are about 8 seconds per file.
    I can learn to live with this increased exporting time. I'm curious as to whether anyone else is experiencing this.

    Yes.  For me, Canon G12 & 40D RAW files are taking twice as long to export under LR4 than under 3.6 - 16 secs vs 8 secs after the same processing.  But I am also seeing the same general latency problems identified in other threads here.  I've reverted back to 3.6 after trying every possible workaround posted so far - LR4 is unusable for me.
    Dave

  • "Unavailable master images cannot be exported.The selected master image is either offline or not found. Please reconnect it and try again."

    I have imported my iPhoto library onto Aperture, and then deleted the iPhoto library so not to have any duplicates. Now, the images on Aperture are pixelated and when I try to export them the following message appears: "Unavailable master images cannot be exported.The selected master image is either offline or not found. Please reconnect it and try again."  What does this mean? How can I get my photos "online" so that I can see them as they used to be?

    How did you import your iPhoto Library? I assume, you used "File > Import > iPhoto LIbrary", but how did you set the "Store Files" pop-up menu?
    If you chose to "Store Files in their current location", then you did not actually import the master image files into Aperture, but referenced them inside the iPhoto Library. In that case, you just deleted all your images, when you deleted the iPhoto Library. And if you did that, and your iPhoto Library is still sitting in the Trash, put it back; then your Aperture Library should work again. Or restore the iPhoto Library from your most recent backup and put it into the exactly same location where it used to be.
    If you used a different "Store Files" setting, please explain where you have chosen to store the master image files. This will help to track down your images.
    After restoring your master image files you may need to reconnect them to the versions. Post back, if you need help with that.
    Regards
    Léonie

  • Exporting photoshop selection/path as CSV

    Hi
    Is it possible to export a selection or path as a list of coordinates? I know you can export to Illustrator but that doesn't help me in this case.
    Thanks
    Andy

    Certainly with a script, but that's just the same dance like saying "you can do it in Illustrator" when you don't seem to have it. if not some very kind person can throw it together in 5 minutes, you can wait forever, if you get my meaning, so looking into that AI thing would be smart.
    Mylenium

  • Hi, Haven't used bridge in a while. How to you export a selected group of images to a contact sheet?

    Hi, Haven't used bridge in a while. How to you export a selected group of images to a contact sheet?

    Exact version?  Platform?
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers: 
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

Maybe you are looking for