Create Image programatically

Hi,
I am using JDeveloper Studio 11.1.1.6.0
how i need to create the image programatically in managed bean and i need to attach it to popup.
and need to add image dynamically.
pls suggest you have any idea.

Do you have the static image in your project and just need to show it up ?
Then you can use the following -
UIComponent parent=uiComponent.getParent(); // where this might be the popup id in which you need to show the image or a component inside the popup
        UIComponent oldImg=parent.findComponent("img1");
        RichImage img=new RichImage();
        img.setId("img1");
        img.setSource(/images/strong.png);  // have an image called strong.png stored in public_html/resources/images
        parent.getChildren().add(img);
        AdfFacesContext.getCurrentInstance().addPartialTarget(parent);

Similar Messages

  • Unable to create image buffer after RAM preview

    Running into an odd and frustrating error. Built a comp using the new Ray-traced 3D renderer and now I'm regretting being an early adopter big time with all the problems I've been encountering with it. The latest comes whenever I do a longer RAM preview in an attempt to watch the whole duration of my comp. It will get to about 170 frames or so, at which point I've interrupted by pressing spacebar because I don't need to see all the way to the end of my work area (around 220 frames). It'll play the RAM preview back fine, and even loop it, but as soon as I stop playback, I get this error message: "After Effects warning: Unable to create image buffer." There's only one button: "okay" and as soon as I click it the same error pops up again and it will never go away, forcing me to close AE from the task manager. I've taken to saving before every RAM preview like I used to do with Flash before previewing my buggy swfs for fear I'll lose all my work after previewing. Any ideas about what might be causing this?
    Some more details about my comp:
    1920x1080 @ 29.97
    Ray-traced 3D
    About 70 3D layers (I'm guessing this is my downfall - new renderer not designed for this many layers?)
    Running Windows 7 Professional
    i7 2600K
    32GB RAM
    2x GTX 570 video cards running latest driver (301.42, CUDA 4.2.1)
    508GB free on my 2TB internal drive where the project and cache lives
    From my GPU info window in case it's useful:
    Fast Draft:
    Available
    Texture Memory:
    600.00 MB
    Ray-tracing:
    GPU
    OpenGL
    Vendor:
    NVIDIA Corporation
    Device:
    GeForce GTX 570/PCIe/SSE2
    Version:
    3.0.0
    Total Memory:
    1.20 GB
    Shader Model:
    4.0 or later
    CUDA
    Driver Version:
    4.2
    Devices:
    2 (GeForce GTX 570, GeForce GTX 570)
    Current Usable Memory:
    1.04 GB (at application launch)
    Maximum Usable Memory:
    1.25 GB

    Yeah, some buffer is very likely not flushing when you interrupt the preview and then there is no more memory on the graphics hardware. Consider setting the work area and your preview options to use only the work area. if it finishes the preview "correctly", it may not suffer the issue. Beyond that - raytracing doesn't/ shouldn't care about the number of items. The math is such, that it makes no difference whether you render a million polygons or just one. Of course there are still limitations due to the GPU dependency, but I doubt you ever truly exhaust the cards' geometry buffers. Compared to pixel data that is a small amount...
    Mylenium

  • How to create Image as Custom Property Type used in Configurable Web Part?

    I wanted to create custom configurable web part property for Image.
    Example - the screenshot of Image property used in Image web part is shown below:
    My goal is to create as many images as possible in custom configurable web part.
    I tried to write the code:
    [WebBrowsable(true),
    WebDisplayName("Example Photo"),
    WebDescription("Example Photo of the user"),
    Category("Custom User Profile"),
    Personalizable(PersonalizationScope.Shared)]
    public Image ExampleUserPhoto { get; set; }
    However, the result does not display Image configurable web part property.
    I wonder why the data type Image does not cause the custom web part to have Image configurable web part property.
    Other data types such as Boolean, Enum, Integer, String and DateTime can be used.
    How can I create Image as Custom Property Type used in Configurable Web Part?

    I have examined that context node __00 has been enhanced,and  has a class name  z___00. But  when I created a new attirubute by right click " Attributes" with wizard under context node __00.There is still  a error message "view is not enhaced or copied with wizard".
    But  when  I created a method  "getvaliation "  in the class of context node zcl__00, the attribute  'valiation' automatically created(at the same time the method "getvaliation' automatically  created for the attribute 'valiation') and I need not to create attibute 'validation' by wizard .  It seemed as if the problem is resloved. But when I make test for it in web ui .There is a runtime erro message.
    Do I need to make some configurations in  the business object layer  for the checkbox? but  the checkbox is only used as a flag  to decide whether a backgoud job is needed to be executed.
    Edited by: samhuman on Jun 22, 2010 10:31 AM

  • Disk Utility fails to create image from double layer DVD

    I burned a double-layer DVD using iDVD. It plays fine on the mac and on set-top DVD players. However, when I try to create an image of the DVD using Disk Utility, I get "Can't create image 'name.cdr' (input/output error)". I've tried re-burning the original disk, but it gets the same error when trying to create an image. I've also tried each of the image types, all with the same result.

    I was having similar problems, although I don't think my issues was related to a double-layer DVD. What worked for me was selecting File > New > Disk Image from Folder. Select the DVD in the file open/save dialog with the same options you used before (e.g., DVD/CD master, etc).
    HTH
    - Dave

  • Error creating //image file

    I don't know if anyone out there is still getting this error message, but I have found that by simply removing the "/" in the FTP dialog box under "host directory" your problem is solved. Apparently Muse adds the "/" and if you have one in the dialog box, there will be two instead of one causing the error. I am not a tech and just discovered this fix. Hope it helps!

    Hi Hollie, and welcome to the forums!
    Have you created images before successfully?
    Is this to/on your boot drive, or an external drive?
    Have you done any Disk/OS maintenance lately?
    We might see if there are some big temp files left or such...
    How much free space is on the HD, where has all the space gone?
    OmniDiskSweeper is now free, and likely the best/easiest...
    http://www.omnigroup.com/applications/omnidisksweeper/
    WhatSize...
    http://www.macupdate.com/info.php/id/13006/
    Disk Inventory X...
    http://www.derlien.com/
    GrandPerspective...
    http://grandperspectiv.sourceforge.net/

  • Can anyone explain how to create lov programatically?

    Hi to all,
    Can anyone explain to me how to create lov programatically?.
    Actually i created a region and items usig code and i want to know how to create lov and mapping also.
    Suppose anyone knows plz let me know. its urgent one.
    Thanks in Advance.
    by
    senthur

    Hi,
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean); OAMessageLovInputBean lovInput =
    (OAMessageLovInputBean)createWebBean(pageContext, LOV_TEXT, null,"inputTest");
    webBean.addIndexedChild(lovInput);
    // Specify the path to the base page.
    lovInput.setAttributeValue(REGION_CODE, "/oracle/apps/dem/webui/Basic");
    // Specify the application id of the base page.
    lovInput.setAttributeValue(REGION_APPLICATION_ID, new Integer(20001));
    // Specify the LOV region definition.
    lovInput.setLovRegion("/oracle/apps/fnd/framework/toolbox/tutorial/webui/EmployeesLovRN", 0);
    // Validation should be enabled for LOVs unless it's essential for the field to allow a partial value (in a "Search" region, for example).
    lovInput.setUnvalidated(false);
    // Configure the LOV mappings.
    // Note that you must call this method after you add the messageLovInput item
    // to the web bean hierarchy.
    lovInput.addLovRelations(pageContext, "inputTest", // base page item
    "Empname", // lov item
    LOV_RESULT, // direction
    LOV_REQUIRED_NO);
    lovInput.addLovRelations(pageContext, "inputTest", // base page item
    "Empname", // lov item
    LOV_CRITERIA, // direction
    LOV_REQUIRED_NO);
    Read more in Dev Guide. Chapter List of Values & Search forums.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Shared Components Images Create Image does not work

    I am using oracle XE on Windows XP.
    Uploading an image for an application does not work.
    Home>Application Builder>Application 105>Shared Components>Images>Create Image
    It goes wrong when I try to upload the image:
    - Iexplorer gives an error 404 after pressing the Upload button.
    - Firefox just gives an empty page.
    When I try to refresh the resulting page (do another post) I get the following error:
    Expecting p_company or wwv_flow_company cookie to contain security group id of application owner.
    Error ERR-7621 Could not determine workspace for application (:) on application accept.

    Hi Dietmar,
    After setting the language to English (USA) [en-us] it works for +- 50 % of the uploads.
    Below is my tracefile.
    Dump file e:\oraclexe\app\oracle\admin\xe\bdump\xe_s001_2340.trc
    Wed Nov 23 19:03:17 2005
    ORACLE V10.2.0.1.0 - Beta vsnsta=1
    vsnsql=14 vsnxtr=3
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Beta
    Windows XP Version V5.1 Service Pack 2
    CPU : 2 - type 586
    Process Affinity : 0x00000000
    Memory (Avail/Total): Ph:267M/1014M, Ph+PgF:1431M/2444M, VA:1578M/2047M
    Instance name: xe
    Redo thread mounted by this instance: 1
    Oracle process number: 15
    Windows thread id: 2340, image: ORACLE.EXE (S001)
    ------ cut ------
    *** 2005-11-23 19:50:44.718
    *** ACTION NAME:() 2005-11-23 19:50:44.718
    *** MODULE NAME:() 2005-11-23 19:50:44.718
    *** CLIENT ID:() 2005-11-23 19:50:44.718
    *** SESSION ID:(26.18) 2005-11-23 19:50:44.718
    Embedded PL/SQL Gateway: /htmldb/wwv_flow.accept HTTP-404 ORA-01846: not a valid day of the week
    *** SESSION ID:(27.19) 2005-11-23 19:50:51.937
    Embedded PL/SQL Gateway: /htmldb/wwv_flow.accept HTTP-404 ORA-01846: not a valid day of the week
    *** 2005-11-23 19:50:59.078
    *** SERVICE NAME:(SYS$USERS) 2005-11-23 19:50:59.078
    *** SESSION ID:(27.21) 2005-11-23 19:50:59.078
    Embedded PL/SQL Gateway: Unknown attribute 3
    Embedded PL/SQL Gateway: Unknown attribute 3
    Strange error... there is nothing in my form that is related to dates...
    Kind regards,
    Pieter

  • Trying to create images to be used in my game

    Here's my situation. I have 3 main parts of the game.
    0 - in play
    1 - level up
    2 - buy screen
    each one has its own basic images/text that don't change. I want to create Images with all that background stuff already on it to improve the efficiency of the drawing. So here's what I tried:
    private Image          back, shipImage, ship2Image;
    private Graphics     backG;
    private Graphics2D     g2d;
    private Image[]          gameStateBackGround = new Image[3];
    private Graphics2D[]     gameStateGraphics2D = new Graphics2D[3];
    //In init.  I know these graphics objects work because this is what I
    //started with but now I'm wanting to improve
    back = createImage(mapWidth,mapHeight);
    backG = back.getGraphics();
    g2d = (Graphics2D) backG;
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    shipImage = Toolkit.getDefaultToolkit().getImage(getClass().getResource("ship.png")).getScaledInstance(20, 30, Image.SCALE_SMOOTH);
    ship2Image = Toolkit.getDefaultToolkit().getImage(getClass().getResource("ship2.png")).getScaledInstance(55, 35, Image.SCALE_SMOOTH);
    //In a method called in init() to create the Images I desribed
    gameStateBackGround[in_play] = createImage(mapWidth,mapHeight);
    drawStarField(gameStateBackGround[in_play].getGraphics());
    gameStateGraphics2D[in_play] = (Graphics2D) gameStateBackGround[in_play].getGraphics();
    starBase.draw(gameStateGraphics2D[in_play]);
    //In my draw method
    gameStateBackGround[in_play] = createImage(mapWidth,mapHeight);
    drawStarField(gameStateBackGround[in_play].getGraphics());
    gameStateGraphics2D[in_play] = (Graphics2D) gameStateBackGround[in_play].getGraphics();
    starBase.draw(gameStateGraphics2D[in_play]);now before I just had that main stuff drawing to the graphics objects used for the whole applet, and it worked fine. What I want is to pre-draw them, and just slap that whole single image of the constant stuff to my area of gameStateBackGround[]. Am I off to the right start?
    Now my drawStarField method asks for a Graphics object, and that draws, and that actually shows. Now for the stuff that's using Graphics2D objects, that is NOT showing. So I think where my main problem is is in creating the Graphics2D objects correctly. This whole concept I'm using for creating objects may be horrid, but hey, that's where you guys come in :) Tell me where I've screwed up hehe. Thanks for the help!          

    oops I screwed up. After:
    //In my draw method
    [/code
    comesbackG.drawImage(gameStateBackGround[gameState], 0, 0, this);

  • Using Cap6, need to create menu screen that allows user to click a button, branch to other screens, and return to main menu. When returning to the main screen the button that was clicked will be grayed out or inactive.  How do I do this?  I created image

    I am trying to emulate a piece of equipment.  I need the user to be able to click on specific buttons that will take the user to another screen(s).  After viewing those screens the user will be directed back to the main screen where the user would know which buttons had been pressed and which still needed to be pressed.  I create image buttons with the 3 states - that worked except when the user returns the slide is reset and so the user does not see the 3rd state of the button.  How can I get that 3rd state to stay after user returns to the main screen? 

    Hi Elizabeth,
    Since I just did this morning what you are currently attempting to do, I thought I'd share my method.  I must provide a disclaimer and tell you that I am not an expert in Captivate advanced actions--like you, I am still figuring them out.  However, I am happy to share here anything I have learned thus far.
    First, here is what my initial slide looks like (see interaction slide below).  I created all of the icons (including the 'grayed out' icon on the second screenshot) in a few minutes using Adobe Illustrator. The icons have been imported as custom multi-state buttons so that I could have the desired effect when the user hovers over the image--the yellow 'explore' flag appears only when the mouse is over the icon. When the learner click either image, they are sent to the corresponding slide.  Once both slides are viewed, a 'continue' button will appear at the base of the screen (something I've not figured out--I sent an email to Lieve begging for some guidance). 
    The initial slide (interaction slide):
    Second, here is a depiction of what happens when the learner returns to the interactive slide from the content slide (see image below):  Once the learner visits the 'Battery Content' slide and then returns to the interaction slide, the images have changed.  The multi-state button is hidden (through the advanced action), the replacement image (the image with the completed banner over it) is shown, and a hidden click box to allow the user to return to the previously visited page (just in case they desire to do that) is "shown" to allow navigation since the button is no longer there (because it is magically hidden).
    Content Slide 1:
    Remember, there may be an easier way to do this in Captivate.  I am using Cp6 for this module.
    1. I created two user variables as follows
    Name: v_batteryExplore
    Value: 0
    Name: v_fuelExplore
    Value: 0
    2. I created an advanced action for each as shown below (showing only one--duplicate the first and change the names to match the content):
    Credit: I learned these steps from @Lilibiri and Dr. Pooja Jaisingh!
    I have also noticed that it matters where the buttons are located on the timeline.  It seems best to have buttons above all other content.  Not sure why, but I have had images not appear when I have not done this.
    And the last step you do not want to forget; you need to remember to tell Captivate to use the action.
    As a final note, remember that the elements you do not want to appear on the initial screen must not be initially visible.  Make sure to set them to invisible by removing the checkmark in the 'Visible in output' box located next to the button name.  In my case, the image of the completed battery and the invisible button to allow a revisit of content was initially hidden.  Here is a final screenshot of my timeline for this interaction.  I hope this information helps you!

  • Creating iViews Programatically

    Hi all,
    I have got a requirement to create iviews programatically.
    The detailed requirement is :
    Intially an excel file which is placed in clients pc will have all the information related to the kind of iViews required, like the name, properties, PCD , of which type etc., Now from portal we need to have the facility to access this excel file and read the information mentioned and create appropriate iViews.
    If anyone has already implemented such a kind of requirement or has got any bit of idea on the same can pls share.
    Thanks In Advance,
    Vipin.

    Hi Vipin,
    You could instead create an excel sheet with macros which use the data in the excel sheet to create an XML file and then upload that file into the portal to create PCD Content.
    Refer to this document, it talks about "How to Automate Content Creation via XML (XML Content and Actions) (NW 7.0)"
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/207a2141-c870-2910-e080-90c920b24f47
    Thanks,
    GLM

  • What is the best compatible graphics software to create images in ibook author?

    What is the best compatible graphics software to create images in ibook author?

    What you choose may depend on your budget, skills, etc.
    Preview comes with OS X.
    GifConverter and Pixelmator are in the (Mac) App Store and work well.

  • SIU fails to create images

    Using SIU 10.6.7 on a machine updated to 10.6.8, trying to create a NetInstall image of a 10.6.3 Retail disc. SIU fails consistently, even after a reinstall of the server admin tools.
    This is what I get from the console log:
    12/8/11 1:12:37 PM          System Image Utility[154]          Assistant - Selected source:"NetInstall of OS X 10.6.3 Installer".
    12/8/11 1:12:58 PM          [0x0-0x13013].com.apple.server.SystemImageUtility[154]          objc[154]: Class SIUDiskUtility is implemented in both /Applications/Server/System Image Utility.app/Contents/MacOS/System Image Utility and /Applications/Server/System Image Utility.app/Contents/Library/Automator/Define Image Source.action/Contents/MacOS/Define Image Source. One of the two will be used. Which one is undefined.
    12/8/11 1:13:02 PM          System Image Utility[154]          Something didn't really work out here...
    12/8/11 1:13:02 PM          System Image Utility[154]          Failed to create image from script createNetInstall.sh.

    Try setting the debug level to verbose in the SIU preferences. This should give more information about the failure in the run log for the image build.
    You should also be looking for the SIU logs instead of the console. They're in ~/Library/Logs (you access them through Console.app as well.)
    I've never actually seen the "Something didn't really work out here..." message occur. It means that SIU failed to communicate with its helper tool that builds the images.

  • Create images with dynamic width from 3 images each (left/center/right-part)

    Hello,
    i want to employ a script to create images of dynamic width for me. The whole process shall base on different sized sets of images, which contain a left-image, a right-image and a center-image. The desired width for the different cases shall be reached by duplicating the center-image between the two outer images and placing those images next to each other until the image extends to desired width.
    The layers importet into Photoshop shall be importet as smart-layers (which i already solved).
    Has anyone done something similar already and could give me some useful hints on that issue ?
    I have come up to this until now:
    #target Photoshop
    // =========================== Opens a new document and asks for dimensions ============================
    var myLayerset = File.openDialog ("Select the set of images you want to use!", "*.png",true)
    var myName = prompt("How do you want to call the document?"); // askes for document name
    var width =  prompt("Please insert width for the output here!", ""); // askes for desired width
    var height = prompt("Please insert height for the output here!", ""); //askes for desired height
    var docName = myName +".psd"
    var idMk = charIDToTypeID( "Mk  " );
        var desc3 = new ActionDescriptor();
        var idNw = charIDToTypeID( "Nw  " );
            var desc4 = new ActionDescriptor();
            var idNm = charIDToTypeID( "Nm  " );
            desc4.putString( idNm, """Wunschname""" );
            var idMd = charIDToTypeID( "Md  " );
            var idRGBM = charIDToTypeID( "RGBM" );
            desc4.putClass( idMd, idRGBM );
            var idWdth = charIDToTypeID( "Wdth" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idWdth, idRlt, width );
            var idHght = charIDToTypeID( "Hght" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idHght, idRlt, height );
            var idRslt = charIDToTypeID( "Rslt" );
            var idRsl = charIDToTypeID( "#Rsl" );
            desc4.putUnitDouble( idRslt, idRsl, 72.000000 );
            var idpixelScaleFactor = stringIDToTypeID( "pixelScaleFactor" );
            desc4.putDouble( idpixelScaleFactor, 1.000000 );
            var idFl = charIDToTypeID( "Fl  " );
            var idFl = charIDToTypeID( "Fl  " );
            var idTrns = charIDToTypeID( "Trns" );
            desc4.putEnumerated( idFl, idFl, idTrns );
            var idDpth = charIDToTypeID( "Dpth" );
            desc4.putInteger( idDpth, 8 );
            var idprofile = stringIDToTypeID( "profile" );
            desc4.putString( idprofile, """sRGB IEC61966-2.1""" );
        var idDcmn = charIDToTypeID( "Dcmn" );
        desc3.putObject( idNw, idDcmn, desc4 );
    executeAction( idMk, desc3, DialogModes.NO );
    //==============================================save document================================================
    var idsave = charIDToTypeID( "save" );
        var desc4 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
            var desc5 = new ActionDescriptor();
            var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
            desc5.putBoolean( idmaximizeCompatibility, true );
        var idPhtthree = charIDToTypeID( "Pht3" );
        desc4.putObject( idAs, idPhtthree, desc5 );
        var idIn = charIDToTypeID( "In  " );
        desc4.putPath( idIn, new File( "C:\\Users\\ target folder goes here" + docName ) );
        var idDocI = charIDToTypeID( "DocI" );
        desc4.putInteger( idDocI, 308 );
        var idsaveStage = stringIDToTypeID( "saveStage" );
        var idsaveStageType = stringIDToTypeID( "saveStageType" );
        var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
        desc4.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
    executeAction( idsave, desc4, DialogModes.NO );
    //========================================================================================================
    for (var i = 0; i < myLayerset.length; i++) {
    if (myLayerset[i] instanceof File && myLayerset[i].hidden == false) {
    // ======================================================= opens selected images as smart objects====================
    var idOpn = charIDToTypeID( "Opn " );
        var desc1 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
       desc1.putPath( idnull, myLayerset[i]);
        var idsmartObject = stringIDToTypeID( "smartObject" );
        desc1.putBoolean( idsmartObject, true );
    executeAction( idOpn, desc1, DialogModes.NO );
    //===================================duplicates opened layer into created document========================================
    var idDplc = charIDToTypeID( "Dplc" );
        var desc144 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref135 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref135.putEnumerated( idLyr, idOrdn, idTrgt );
        desc144.putReference( idnull, ref135 );
        var idT = charIDToTypeID( "T   " );
            var ref136 = new ActionReference();
            var idDcmn = charIDToTypeID( "Dcmn" );
            ref136.putName( idDcmn, docName); 
        desc144.putReference( idT, ref136 );
        var idVrsn = charIDToTypeID( "Vrsn" );
        desc144.putInteger( idVrsn, 5 );
    executeAction( idDplc, desc144, DialogModes.NO );
    // ======================================================= close tab without saving ==========
    var idCls = charIDToTypeID( "Cls " );
        var desc156 = new ActionDescriptor();
        var idSvng = charIDToTypeID( "Svng" );
        var idYsN = charIDToTypeID( "YsN " );
        var idN = charIDToTypeID( "N   " );
        desc156.putEnumerated( idSvng, idYsN, idN );
    executeAction( idCls, desc156, DialogModes.NO );

    I adapted a Script somewhat, so you may give this a test.
    But it uses the open file so you would have to adapt it further.
    // arranges the selected jpg, tif, psd in line;
    // gutters may be irregular due to rounding effects;
    // thanks to michael l hale and muppet mark;
    // for mac and CS6;
    // 2014, use it at your own risk;
    #target photoshop
    if (app.documents.length == 0) {
              var myDocument = app.documents.add(UnitValue (300, "mm"), UnitValue (50, "mm"), 300, "new", NewDocumentMode.RGB, DocumentFill.TRANSPARENT)
    else {myDocument = app.activeDocument};
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var theArray = [0, 0, myDocument.width, myDocument.height];
    // select files;
    if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}
    else {var theFiles = File.openDialog ("please select exactly three files", getFiles, true)};
    // do the arrangement
    if (theFiles) {placeInLines (myDocument, theFiles, theArray)}
    app.preferences.rulerUnits = originalRulerUnits;
    ////// function to place images in lines //////
    function placeInLines (myDocument, theFiles, theArray) {
    theFiles.sort();
    // fit on screen;
    var idslct = charIDToTypeID( "slct" );
    var desc64 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref44 = new ActionReference();
    var idMn = charIDToTypeID( "Mn  " );
    var idMnIt = charIDToTypeID( "MnIt" );
    var idFtOn = charIDToTypeID( "FtOn" );
    ref44.putEnumerated( idMn, idMnIt, idFtOn );
    desc64.putReference( idnull, ref44 );
    executeAction( idslct, desc64, DialogModes.NO );
    // change pref;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    setToAccelerated();
    app.togglePalettes();
    var check = turnOffRescale ();
    // create the arrangement;
    if (theFiles.length > 0 && theFiles.length == 3) {
    myDocument.activeLayer = myDocument.layers[0];
    // create masked group;
    var theGroup = myDocument.layerSets.add();
    theGroup.name = "arrangement";
    // determine the array’s values;
    var areaWidth = theArray[2] - theArray[0];
    var areaHeight = theArray[3] - theArray[1];
    var theDocResolution = myDocument.resolution;
    var areaRelation = areaHeight / areaWidth;
    // center of placed non-pdf images;
    var centerX = Number(myDocument.width / 2);
    var centerY = Number(myDocument.height / 2);
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    var pdfSinglePages = new Array;
    var nonPDFs = new Array;
    var theDimPDFs = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    var theDimensions = new Array;
    var theLengths = new Array;
    // array to collect both files and placed pdf-pages;
    var theseFiles = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    for (var o = 0; o < theFiles.length; o++) {
        var thisFile = theFiles[o];
              theseFiles.push(thisFile);
              var theDim = getDimensions(thisFile);
              theDimensions.push(theDim);
              theRelativeWidth = 100 / theDim[1] * theDim[0];
              theLength = theLength + theRelativeWidth;
    // reset dialogmodes;
    app.displayDialogs = DialogModes.ERROR;
    // if three files;
    if (theseFiles.length == 3) {
    // create the layers;
    var theNumber = 0;
    var theAdded = 0;
    var y = areaHeight / 2;
    // add placed image’s width;
    var thisLineWidth = 0 + theAdded;
    var theLastFactor = Number (Number(myDocument.height) / theDimensions[2][1] * theDimensions[2][2] / theDocResolution * 100);
    var theLastWidth = Math.round(theDimensions[2][0] * theLastFactor / 100 * theDocResolution / theDimensions[2][2]);
    // place the files;
    for (var x = 0; x < 3; x++) {
    var theNumber = x;
    var thisFile = theseFiles[theNumber];
    var theFactor = Number (Number(myDocument.height) / theDimensions[theNumber][1] * theDimensions[theNumber][2] / theDocResolution * 100);
    var theNewWidth = Math.round(theDimensions[theNumber][0] * theFactor / 100 * theDocResolution / theDimensions[theNumber][2]);
    var offsetX = theNewWidth / 2 + thisLineWidth - centerX + theArray[0];
    var offsetY = y - centerY + theArray[1];
    var theLayer = placeScaleFile (thisFile, offsetX, offsetY, theFactor, theFactor);
    myDocument.activeLayer.move(theGroup, ElementPlacement.PLACEATBEGINNING);
    thisLineWidth = thisLineWidth + theNewWidth;
    // duplicate the middle one;
    if (theNumber == 1) {
              while (thisLineWidth < myDocument.width - theLastWidth) {
                        theLayer = duplicateAndOffset (theLayer, theNewWidth, 0);
                        thisLineWidth = thisLineWidth + theNewWidth;
    // reset;
    app.togglePalettes();
    turnOnRescale (check);
    app.preferences.rulerUnits = originalRulerUnits;
    ////// playback to accelerated //////
    function setToAccelerated () {
              var idsetd = charIDToTypeID( "setd" );
              var desc1 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                        var ref1 = new ActionReference();
                        var idPrpr = charIDToTypeID( "Prpr" );
                        var idPbkO = charIDToTypeID( "PbkO" );
                        ref1.putProperty( idPrpr, idPbkO );
                        var idcapp = charIDToTypeID( "capp" );
                        var idOrdn = charIDToTypeID( "Ordn" );
                        var idTrgt = charIDToTypeID( "Trgt" );
                        ref1.putEnumerated( idcapp, idOrdn, idTrgt );
              desc1.putReference( idnull, ref1 );
              var idT = charIDToTypeID( "T   " );
                        var desc2 = new ActionDescriptor();
                        var idperformance = stringIDToTypeID( "performance" );
                        var idperformance = stringIDToTypeID( "performance" );
                        var idaccelerated = stringIDToTypeID( "accelerated" );
                        desc2.putEnumerated( idperformance, idperformance, idaccelerated );
              var idPbkO = charIDToTypeID( "PbkO" );
              desc1.putObject( idT, idPbkO, desc2 );
              executeAction( idsetd, desc1, DialogModes.NO );
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true
    ////// place //////
    function placeScaleFile (file, xOffset, yOffset, theScale) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theScale );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
    executeAction( idPlc, desc5, DialogModes.NO );
    return myDocument.activeLayer;
    ////// open pdf //////
    function openPDF (theImage, x) {
    // define pdfopenoptions;
    var pdfOpenOpts = new PDFOpenOptions;
    pdfOpenOpts.antiAlias = true;
    pdfOpenOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
    pdfOpenOpts.cropPage = CropToType.TRIMBOX;
    pdfOpenOpts.mode = OpenDocumentMode.CMYK;
    pdfOpenOpts.resolution = 10;
    pdfOpenOpts.suppressWarnings = true;
    pdfOpenOpts.usePageNumber  = true;
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    pdfOpenOpts.page = x;
    var thePdf = app.open(theImage, pdfOpenOpts);
    thePdf.close(SaveOptions.DONOTSAVECHANGES);
    // reset dialogmodes;
    app.displayDialogs = theDialogSettings;
    ////// turn off preference to scale placed image //////
    function turnOffRescale () {
    // determine if the resize prefernce is on;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var appDesc = executeActionGet(ref);
    var prefDesc = appDesc.getObjectValue(charIDToTypeID( "GnrP" ));
    var theResizePref = prefDesc.getBoolean(stringIDToTypeID( "resizePastePlace" ));
    // turn off resize image during place;
    if (theResizePref == true);{
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc12 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref4 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref4.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref4.putEnumerated( idcapp, idOrdn, idTrgt );
        desc12.putReference( idnull, ref4 );
        var idT = charIDToTypeID( "T   " );
            var desc13 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc13.putBoolean( idresizePastePlace, false );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc12.putObject( idT, idGnrP, desc13 );
    executeAction( idsetd, desc12, DialogModes.NO );
    return theResizePref
    ////// turn on preference to scale plced image //////
    function turnOnRescale (check) {
    if (check == true) {
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc14 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref5.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idcapp, idOrdn, idTrgt );
        desc14.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc15 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc15.putBoolean( idresizePastePlace, true );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc14.putObject( idT, idGnrP, desc15 );
    executeAction( idsetd, desc14, DialogModes.NO );
    ////// convert to so if not one aready //////
    function duplicateAndOffset (theLayer, theXOffset, theYOffset) {
    app.activeDocument.activeLayer = theLayer;
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
        var desc9 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idLyr, idOrdn, idTrgt );
        desc9.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc10 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idHrzn, idRlt, theXOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idVrtc, idRlt, theYOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc9.putObject( idT, idOfst, desc10 );
    executeAction( idcopy, desc9, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// load pdf as smart object //////
    function transformLayer (layer, percentage, xOffset, yOffset) {
    app.activeDocument.activeLayer = layer;
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc4 = new ActionDescriptor();
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc4.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc5 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc4.putObject( idOfst, idOfst, desc5 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idWdth, idPrc, percentage );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idHght, idPrc, percentage );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc4.putBoolean( idLnkd, true );
        var idAntA = charIDToTypeID( "AntA" );
        desc4.putBoolean( idAntA, true );
    executeAction( idTrnf, desc4, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// function to get file’s dimensions, thanks to michael l hale //////
    function getDimensions( file ){
    function divideString (theString) {
              theString = String(theString);
        var a = Number(theString.slice(0, theString.indexOf("\/")));
        var b = Number(theString.slice(theString.indexOf("\/") + 1));
        return (a / b)
    // from a script by michael l hale;
    function loadXMPLibrary(){
         if ( !ExternalObject.AdobeXMPScript ){
              try{
                   ExternalObject.AdobeXMPScript = new ExternalObject
                                                                ('lib:AdobeXMPScript');
              }catch (e){
                   alert( ErrStrs.XMPLIB );
                   return false;
         return true;
    function unloadXMPLibrary(){
       if( ExternalObject.AdobeXMPScript ) {
          try{
             ExternalObject.AdobeXMPScript.unload();
             ExternalObject.AdobeXMPScript = undefined;
          }catch (e){
             alert( ErrStrs.XMPLIB );
    ////// based on a script by muppet mark //////
    function dimensionsShellScript (file) {
              try {
    // getMetaDataMDLS;
    if (File(file) instanceof File && File(file).exists) {
              var shellString = "/usr/bin/mdls ";
              shellString += File(file).fsName;
    //          shellString += File(file).fullName;
              shellString += ' > ~/Documents/StdOut2.txt';
              app.system(shellString);
    // read the file;
    if (File('~/Documents/StdOut2.txt').exists == true) {
        var file = File('~/Documents/StdOut2.txt');
        file.open("r");
        file.encoding= 'BINARY';
        var theText = new String;
        for (var m = 0; m < file.length; m ++) {
                        theText = theText.concat(file.readch());
              file.close();
              theText = theText.split("\n");
    // get the dimensions;
              var dim = new Array;
              for (var m = 0; m < theText.length; m++) {
                        var theLine = theText[m];
                        if (theLine.indexOf("kMDItemPixelWidth") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemPixelHeight") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionWidthDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionHeightDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
    // remove file and hand back;
              File('~/Documents/StdOut2.txt').remove();
    catch (e) {
              if (File('~/Documents/StdOut2.txt').exists == true) {File('~/Documents/StdOut2.txt').remove()};
              return dim
              try{
                        loadXMPLibrary();
                        var xmpf = new XMPFile( file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );
                        var xmp = xmpf.getXMP();
                        xmpf.closeFile();
                        var resolutionUnit = xmp.getProperty( XMPConst.NS_TIFF, 'ResolutionUnit', XMPConst.STRING);
                        var resFactor = 1;
                        if (resolutionUnit == 2) {
                                  var resFactor = 1;
                        if (resolutionUnit == 3) {
                                  var resFactor = 2.54;
                        var dim = [xmp.getProperty( XMPConst.NS_EXIF, 'PixelXDimension', XMPConst.STRING),
                        xmp.getProperty( XMPConst.NS_EXIF, 'PixelYDimension', XMPConst.STRING),
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'XResolution', XMPConst.STRING)) * resFactor,
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'YResolution', XMPConst.STRING)) * resFactor];
                        unloadXMPLibrary();
                        if(dim[0]=="undefined" || dim[1]=="undefined"){
                var dim = undefined;
                var res = undefined;
                var bt = new BridgeTalk;
                bt.target = "bridge";
                var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+file.toSource()+");");
                bt.body = myScript;
                bt.onResult = function( inBT ) {myReturnValue(inBT.body); }
                bt.send(10);
                        function myReturnValue(str){
                                  res = str;
                                  dim = str.split(',');
                        function psRemote(file){
                                  var t= new Thumbnail(file);
                                  return t.core.quickMetadata.width+','+t.core.quickMetadata.height;
        }catch(e){unloadXMPLibrary()};
              if (String(dim[2]).indexOf("\/") != -1) {
                        var a = divideString(dim[2]);
                        var b = divideString(dim[3]);
                        dim = [dim[0], dim[1], a, b]
    // if dimensions are missing as might be the case with some bitmap tiffs for example try a shell-script;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var array = dimensionsShellScript(file);
                        dim = array;
    // if shell-string failed open doc to get measurements;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var thisDoc = app.open (File(file));
    // close ai without saving;
                        if (file.name.slice(-3).match(/\.(ai)$/i)) {
                                  thisDoc.trim(TrimType.TRANSPARENT);
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.DONOTSAVECHANGES)
                        else {
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.PROMPTTOSAVECHANGES)
    return dim;

  • CS4-created and CS6-created images

    My images created with CS4 print on my Epson R2880, using CS4, faithfully.  I have the monitor and paper profiles calibrated.  CS6-created images also print faithfully using CS6.  But images created with CS4 when printed using CS6 have an appalling dirty green cast.  How can I get CS6 to print CS6 and CS4 images faithfully?  Help, please.

    My images created with CS4 print on my Epson R2880, using CS4, faithfully.  I have the monitor and paper profiles calibrated.  CS6-created images also print faithfully using CS6.  But images created with CS4 when printed using CS6 have an appalling dirty green cast.  How can I get CS6 to print CS6 and CS4 images faithfully?  Help, please.

  • Creating Image "photography_chris.dmg" Unable to create , resource busy

    I have re-started the mac but to no avail, this appears in the console log. I haven't a clue. Thankyou.
    Creating Image “photography_chris.dmg” Unable to create “photography_chris. Resource busy.
    Have searched google but everyone is is giving complex answers to what should be so lego basic!

    oh for pity's sake, have you ever seen that cartoon with dastardly and mutley (mutley being the dog) in wacky races? Well i feel like that dog right now. All this time I was clicking on NEW image in the disc utilities instead of the drop down menu DISK image - it's actually misleading for non tech guys you know, they really should put NEW image in the dialogue box so that it is PLAINLY obvious to all that there are two very different processes here. Because in the help information it constantly refers to new images and disc images interchangeably....

Maybe you are looking for

  • XI 3.1 with HP Neoview 2.4

    Hello: I'm at a client using XI 3.1 Fp 1.3 on HP64 connecting to HP Neoview 2.4. They would like to know with the ODBC drivers that we support HP ODBC 2.3.1...and 2.3.2... which Driver Manager is provided with XI 3.1 FP 1.3? On my workstation using t

  • Registration Settings Missing- even after reinstall

    iTunes keeps showing the error message of "The registration settings used by the iTunes drivers....are missing....Please reinstall iTunes." I have tried the fix for this issue in this location http://docs.info.apple.com/article.html?artnum=302976 but

  • Linking to files on a network. How can I get Contribute to NOT upload a copy?

    This is killing me! In Dreamweaver, when I put in a crazy URL that goes to a file on someones computer on my local network, and hit Upload, I get a nice popup asking if I want to copy the file in question to the web server. I say no, and all is well.

  • Has anyone else had problems returning items using TNT?

    Long story short, returned my iPad to apple last week.  Contacted apple today (a week after the courier collected the iPad) to ask why the status hadn't changed.  Apparently the courier TNT delivered apple an empty box, so at the moment i am £460 out

  • Changing ISE hostname with application reset-config ise - license question

    Hello,I need to change the hostname of our ISE install.  TAC stated I need to use the command of application reset-config ise to do so.  I was wondering if my old license files can be reused or do I need to get new ones from Cisco.  I have a case ope