Crop a picture object selected by the user

Hello

maybe is a simple question , but I can not understand how resolve the situation...

I need (with a Javascript script) crop an image selected by the user.

I try to use geometricBounds, without success.

Thanks for the help and best regards!

Just remembered that I do this kind of things in some of my scripts as well... Really sorry for missleading you.

Select a rectangle with an image inside and play with a script like the one below, and I'm sure that you will be able to adapt it to your needs:

// Test file path
jpgFileName = 'c:/temp/test.jpg';

// Export the visible area of a selected image container (errors will occur unless valid object)
var newFile = app.selection[0].exportFile(format=ExportFormat.JPG , to=jpgFileName);

// Relink the selected image to the exported, new image
app.selection[0].images[0].itemLink.relink(new File(jpgFileName));

// Fit the newly linked image proportionally inside the selected object.
app.selection[0].fit(FitOptions.FILL_PROPORTIONALLY);

You can use the settings like these as well:

app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high;
app.jpegExportPreferences.exportResolution = 72;

Best regards

Andreas

PS. "InDesign is not capable of this" was me quote me, and there was an effect blocked on this entire sentence, which did not display... GSM

PPS. The image quality deteriorates of course if you export in jpg format. GSM

Tags: InDesign

Similar Questions

  • How to get zone selected by the user in the Managed bean code

    Hello

    In our project, we use af:inputDateto to get details about the information of Date, time, and time zone.

    < af:inputDate label = "#{bundle." LABEL_1}.
    autoSubmit = 'true '.
    value = "#{pageFlowScope.attributeValuesBean.DateTime} '"
    valueChangeListener = "#{pageFlowScope.resourceCreateEditBean.pageValueChangedListener} '"
    ID = "id3" >
    < af:convertDateTime type = "both" timeStyle = timeZone = "#{"long"pageFlowScope.resourceCreateEditBean.preferredTimeZone}" / > "
    < / af:inputDate >

    the value attribute of date. MinValue is mapped with pageFlowScope.attributeValuesBean.dateTime which is a java.util.Date.

    for specific details, I used following code

    SimpleDateFormat sdf = new SimpleDateFormat ("dd MMM yyyy hh: mm: z");
    String s = sdf.format (date);

    which returns the date in the format "dd MMM yyyy hh: mm: z". However, this API will always return timezone of server, and in accordance with our project we need the details of the user selected time zone.

    is it possible to get the time zone selected by the user on the dateTime picker?

    Ajay,

    When LOV TimeZone is active on the date picker, it is not possible to retrieve the time zone selected by the user. There is an enhancement request filed for this feature.

    Since this is a known issue, there is a way to accomplish what you want:

    (1) the date picker does the conversion of the local time zone to UTC (GMT) time and provides a Java Date object.
    In order to bypass this conversion, you can use one of the techniques is:

    It's basically asking for the date picker to convert time UTC time UTC (no conversion) :-)

    (2) separate the zone LOV the date picker. You can use the function af:getCommonTimeZoneSelectItems() for this purpose.

  • Is it possible to export objects created by the user who is in system schema?

    Legends of dear,

    I need your help which is at - it a way to export the user objects created in the schema of the SYSTEM? Sorry I hope the question is silly, but unfortunately one of our user created all their objects in the SYSTEM schema.

    Oracle 11g XE Windows environment

    1. we try to identify objects created by the user of the SYSTEM.

    2. check the number and names of objects with tables, procedures, functions, triggers, and sequences.

    Thank you

    Knockaert

    karthiksingh_dba wrote:

    Legends of dear,

    I need your help which is at - it a way to export the user objects created in the schema of the SYSTEM? Sorry I hope the question is silly, but unfortunately one of our user created all their objects in the SYSTEM schema.

    Oracle 11g XE Windows environment

    1. we try to identify objects created by the user of the SYSTEM.

    2. check the number and names of objects with tables, procedures, functions, triggers, and sequences.

    Thank you

    Knockaert

    Search the object created recent & owned by SYSTEM.

    Since duhveloper object creation, then would have same DDL to repeat once again, in different schema.

    It is a professional organization that maintains the source code in the code repository?

  • HW 2 get the value to select only one option selected by the user in the bean support

    IAM using the select only one option button that is filled during execution.

    I want to get the value selected by the user of a choice selection in the bean to support for other operations of... .IAM using this method, but I got a null pointer exception.

    Public Sub test (ValueChangeEvent tokenChange)
    {
    Integer tokenIndex = (Integer) tokenChange.getNewValue ();
    DCIteratorBinding tokenListIter is getBindings1 () .findIteratorBinding ("TokenIDVOIterator");. in this line null pointer exception
    Token of the line = tokenListIter.getRowAtRangeIndex (tokenIndex.intValue ());
    currenttoken = (Number) token.getAttribute ("TokenId");
    System.out.println ("token ID selected:" + currenttoken);

    }

    I want to know if there is any method to get the value of the value selected by the user to select a choice...

    pls help? //

    3 words:

    "research on the forum.

    asked and answered countless times.

  • Cannot crop a picture in paint. The button is gray.

    The button is gray.  I can make any other changes to the image, but I can't click on the function of the harvest.  Any help?

    You are running Win Vista or Win 7?

    FWIW... Windows Live Photo Gallery is a cropping tool.

    If_Vista_try the following...

    Left click "Select" in the tool pane.

    Left click or drag a rectangle around the section that you want to crop...

    Reach... Edition/copy or type... CTRL + C

    Reach... File / new...
    (Save changes?-no)

    Reach... Edition and paste or type... CTRL + V...

    Now save your cropped picture... File / save as...

    (If your saved photo includes a part of the white wing
    canvas in the background... reduce the size of it
    before cropping by going to... Image / attributes...
    and a very small number enter the width and
    Height fields)

    If_Win 7_see the following article:

    Windows 7 - crop a Photo with Paint
    http://Windows.Microsoft.com/en-us/Windows7/crop-a-picture-using-paint

    FWIW... has the FastStone Image Viewer freeware
    a very useful tool of harvest...

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    FastStone Image Viewer
    http://www.FastStone.org/FSViewerDetail.htm

    The following tutorial is to create a culture square
    apply for a passport photo, but the steps are the same
    for other reports.

    To create a square without distorting picture
    You must crop. The following freeware has
    a good cropping tool:

    FastStone Image Viewer
    http://www.FastStone.org/FSViewerDetail.htm

    First, you will need to download and install the
    program.

    Now, open the program and select (highlight)
    the image you want to change.

    According to... to... Edit / crop Panel (or type... (X)

    Click on the button 'Set Ratios of paper'.
    (it's just to the right of the proportion of paper
    fall of window)

    Click on the 'Add' button and enter... 2 x 2 "
    Click on... OK / OKAY... (this will give you the square
    format you need)

    You can resize the selection frame by dragging
    reposition by dragging corner handles
    the arrow of the 4 channels. At the end... Click on the 'culture '.
    button.

    Now... to... File / save as...
    Choose a backup location, enter a new name for
    the photo and choose a format to save in...
    Left click on the Save"" button.

  • value of the item in the list, Select when the user places the cursor on it

    Hi all

    I have a requirement where the user place cursor on an element of a form page list selection. All options should appear without clicking. I also have a selection list that is created dynamically.

    I use Apex 4.2

    Thank you

    Shaz

    Not tested, but something like below might work.

    DECLARE
    v_item varchar2(20);
    Cursor c1 is
    SELECT Item_name FROM APEX_APPLICATION_PAGE_ITEMS
    WHERE  lower(display_as_code) = 'native_select_list' AND lower(region) = 'region_name' ;
    
    BEGIN
    
    FOR item_rec IN c1
    LOOP
    v_item := item_rec.item_name;
    
    htp.script('$(''#'||v_item||''').hover(function(){
        var count = $(this).children().length;
    $(this).attr(''size'', count);
    },function(){
        $(this).removeAttr(''size'');
    });','Javascript');
    
    END LOOP;
    END;
    

    BR,

    Patrick

  • Print the quick selection of the user on the production of the report

    Is it possible to print settings the user has selected on the report output? Example of

    Prompt: Select date
    Fast: Select the end Date


    Printing output (results)

    Date: 01/01/2011
    To date: 01/01/2012

    Field1 Field2 Field2
    XXX XXX XXXX

    Try adding view person narrative to describe quick values by column positions or well using the presentation variable reference view of filters on the compound available otherwise.

    If brand pls help

  • How to display the object selected in the current view?

    I have a file in illustrator with hundreds of layers and objects. If I select an object for targeting in the layers panel, is it possible that I can get the items to display in the center of the workspace. I currently have zoom and pan the document to see the object.

    Similarly, if I select an object in the document, is there a way to have this object appear in the center of the layers panel? I have currently to scroll the layers panel to find the parent layer and then down through the layers of the child until I found my selected object.

    Thank you!

    1. it's a feature request that has often been mentioned here. There may be scripts which do.

    2 see the command to locate an object in the palette menu layers.

  • Add Classes of objects before creating the user?

    Hello

    I have a requirement where in I need to add classes of objects to the user during the commissioning of Sun Directory Server. Exactly how should I implement my task of process for the same thing. I might add the object after the task of creating class is complete or until the user creating the task fires?

    Thank you
    PETREA

    Are you talking about adding classes of object customized for users? It would be a schema change and must be done before adding users since that would fail without the correct schema in place. To add new classes of objects you need to either manually create the admin Department page or import the definitions of objects and attributes of an ldif file. Once it is, you can then configure the workflow commissioning and add classes of objects when the user was created so that the system knows what classes of objects associated with each entry of the user.

  • TextArea - insert an image to the position selected by the user

    I am developing a feature where I can insert a picture at a specific position in the text box to help ActionScript .
    I can get the position of the cursor of the user using the selectionAnchorPosition property.
    I can create the image using InlineGraphicElement I can add to the method addChild TextFlow text box, but that adds the image at the end of the content.
    It is also addChildAt method allows me to add the paragraph with this image in TextFlow to a specific index. But to do this, you must know the index.
    How can I find the index of the child to the location of the cursor? In addition, addChildAt to add a paragraph. How can I add this image within an existing paragraph?
    Please help... Thank you!

    Your code can be simplified as follows. Pay attention to * addImageButton_clickHandler *.


    <>
    "xmlns:FX ="http://ns.adobe.com/mxml/2009"
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx".
    minWidth = "955" = "600" minHeight
    creationComplete = "application1_creationCompleteHandler (event)" "
    >
       
           
       

       
       
       
       
            <>
    horizontalAlign = "center".
    paddingTop = "20".
    />
       

       
        <>
    ID = 'richText '.
    Width = "800".
    Height = "300".
    horizontalCenter = "0".
    Red = '0 '.
    textFlow = "{textFlow}.
    />
        <>
    ID = "addImageButton".
    label = 'add images '.
    Click = "addImageButton_clickHandler (Event)" "
    />
       
       
       
       
            Import flashx.textLayout.edit.IEditManager;
    Import flashx.textLayout.elements.InlineGraphicElement;
    Import flashx.textLayout.elements.ParagraphElement;
    Import flashx.textLayout.elements.TextFlow;
    Import flashx.textLayout.formats.WhiteSpaceCollapse;
               
    Import mx.events.FlexEvent;
               
    Import spark.utils.TextFlowUtil;
               
               
               
    [Bindable]
    private var inputString:String = "the Dow Jones industrial average lost more than 100 points Tuesday, after the Japan raised the seriousness of the nuclear crisis and Alcoa Inc. said disappointing sales. A decline in the price of oil fell by stocks of energy. « ;
    [Bindable]
    private var textFlow:TextFlow;
               
    [Embed(source="assets/images/math.png")]
    [Bindable]
    public var imgCls: Class;
               
               
    protected function application1_creationCompleteHandler(event:FlexEvent):void {}
    textFlow = TextFlowUtil.importFromXML (XML (inputString), WhiteSpaceCollapse.PRESERVE);
    }

    protected function addImageButton_clickHandler(event:MouseEvent):void {}
    var editManager:IEditManager = textFlow.interactionManager as IEditManager;
    editManager.insertInlineGraphic (imgCls, 174, 44, null, editManager.getSelectionState ());
                   
    }
    ]]>
       

  • Selection of the user command grayed out

    I just realized that I can't sort the photos by order of the user on some files. The problem seems random. Some files work and some don't. On those who do not work the user command selction is gray on the view menu. Someone at - he never seen elsewhere or have any ideas how to fix? John

    Why don't you use a regular collection combined with filter metadata instead of a smart collection? This should give you the same capabilities as a collection of smart filter.

    Gossweiler beat

    Switzerland

  • Object defined by the user in the email button?

    LiveCycle Designer 8.2.

    How do you define a button e-mail such as the information entered by the user, referenced from a field of text may appear in the subject or body when you click the button, instead of a pre-programmed message?  Is this possible?

    Here is the example updated the... In this example, I'll put the To Email and CC Email directly in the preSubmit event code...

    The user will enter the subject and Message in the form...

    I use the preSubmit event code to send email...

    https://Acrobat.com/#d=HouRLov3lOntSbqAfsr5Hg

    Let me know if you need help...

    Thank you

    Srini

  • Error - object selected on the stage

    In the past, that I didn't problems coding navigation button in ActionScript 3.0, but for some reason I seem to have forgotten the process.

    I created a button to get the scene 1 scene 2.

    I have two layers, the lower layer is where is the button. The top layer is where is the ActionScript code.

    My button is on stage and is (it is a button symbol) a called "go_1" and is an instance of the name "NTF".

    When I select "Click to go to the scene and play" (snippets), and I get a message saying 'this action requires an object to be selected on stage. "

    What I am doing wrong?

    Looks like you don't have the selected button when you select the command.  Click the button to select it before clicking on this command.

  • Moving objects selected with the arrow keys

    I often position objects by selecting them and moving them with the arrow keys. However, increasing the default value is often too large. I know the Illustrator has a setting in preferences to change the increment. Is there a similar parameter in FreeHand? I have not found one. Thanks for any information.

    > I often position objects by selecting them and moving them with the arrow keys.
    > However, the default increment is often too big. I know that Illustrator
    > has a setting in the preferences to change the increment. Is there a
    > similar parameter in FreeHand? I have not found one. Thanks for any information.

    Main menu: file > Document settings > remote cursor

    Oddly enough named but more Freehand this other feature before many started programs "pushing".

    If the parameter "will not stick' open the default page (see Preferences / Document /"New Document Template") make the frame and save, as for example MyDefaults.ft11 preference.

    Jukka

  • Selection problem.  I imported a piece of vector art: a guy in a t-shirt and jeans.  I want to change the color of the t-shirt but when I "select", the whole picture gets selected including the head, arms and jeans.  How to isolate the t-shirt?

    I imported a piece of vector art that shows a man wearing a t-shirt and blue jeans.  I want to change the color of the t-shirt, but, when I 'select', not only the GET selected shirt made from the head, arms and blue jeans guy.  How do I isolate the image so I am just by selecting the t-shirt?

    Gabriel,

    What happens if you click the fill with the direct Selection tool, and then try?

    Or try to locate T shirt in the layer in the layers palette and select there, then try? You may need to click one or more arrows to look in under/groups/cutting masks / whatever.

Maybe you are looking for

  • Close the vi reference does not not on reentrant vi

    I have a reentry vi which will not close its reference. My program work experience, and once the experiment is complete, I use the FP. Open the property node (w / a fake wired to her) and a reference to close to automatically close the VI and referen

  • Skype works only on windows vista

    I use windows vista. Whenever I try to open Skype, I get reviews - Skype has stopped working. A problem caused the blocking of the program works correctly. Windows stops the program and advise if a solution is available. Kind regards Cedrick.

  • Error code: 80070026 (cannot update Windows Power Shell 2.0 and WinRM 2.0)

    having problem doing the last update for windows PowerShell 2.0 and winrm 2.0 code error 80070026 please help he is unable to update my laptop.

  • Vista SP2 unknown error: Code 8024200d

    Try to install the Vista SP2 stops the same 8024200d error code.  OK installed on other mobile home network 2. Same or different - question other 2 laptops, when I right click, properties, compatibility, they show that this compatibility cannot be de

  • IPSEC VPN DMZ HOST NAT

    Hello world First of all thanks for the invaluable information this community offers technicians everywhere... I'm newish to IPSEC VPN and I have a question. I have a DMZ PATed host to a public IP address. I've set up an IPSEC tunnel (with an externa