Increase canvas conditionally and Conditonal copyright logo

Hi,
I want to increase the Canvas size of image conditionally depends on height or width of images. But the script is not giving proper results.
Can Anyone help me in this. And also i have done bold for the text as comments. Even i need help in the comment mentioned line also
Thanks in Advance,
Script goes here:
var cm3_5 = 3.5;
        var cm5 = 5;
        var cm8 = 8;
        var cm12 = 12;
        var cm13 = 13;
        var cm16 = 16;
        var cm17 = 17;
        var cm20 = 20;
        var cm21 = 21;
        var cm24 = 24;
        var cm25 = 25;
        var cm28 = 28;
        var cm28_5 = 28.5;
        var cm30 = 30;
        var cm30_5 = 30.5;
        var cm32 = 32;
        var cm32_5 = 32.5;
        var cm34 = 34;
        var cm34_5 = 34.5;
        var cm36 = 36;
        var doc=app.activeDocument;
            if(doc.width>doc.height)
                 if (doc.width<cm3_5){
                 var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
                doc.resizeCanvas(doc.width + 0.5, doc.height +0.5, AnchorPosition.MIDDLECENTER);
                app.preferences.rulerUnits = originalRulerUnits;
                }else  if (doc.width<cm5){
                 var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
                doc.resizeCanvas(doc.width + 0.75, doc.height +0.75, AnchorPosition.MIDDLECENTER);
                app.preferences.rulerUnits = originalRulerUnits;
                }else  if (doc.width<cm8 && doc.width>cm4){
                 var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
                doc.resizeCanvas(doc.width + 1, doc.height +1, AnchorPosition.MIDDLECENTER);
                app.preferences.rulerUnits = originalRulerUnits;
                }else  if (doc.width<cm12 && doc.width>cm8){
                 var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
                doc.resizeCanvas(doc.width + 1.5, doc.height +1.5, AnchorPosition.MIDDLECENTER);
                app.preferences.rulerUnits = originalRulerUnits;
                }else  if (doc.width<cm20 && doc.width>cm17){
                 var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
                doc.resizeCanvas(doc.width + 2, doc.height +2, AnchorPosition.MIDDLECENTER);
                app.preferences.rulerUnits = originalRulerUnits;
                if (doc.width<cm24 && doc.width>cm20){
                 var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
                doc.resizeCanvas(doc.width + 3, doc.height +3, AnchorPosition.MIDDLECENTER);
                app.preferences.rulerUnits = originalRulerUnits;
//Here the Error getting not able to increase canvas. How i want to write canvas conditionally
        if(doc.height>doc.width)
                 if (doc.width<cm8 && doc.height>cm5){
                 var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
                doc.resizeCanvas(doc.width + 1, doc.height +1, AnchorPosition.MIDDLECENTER);
                app.preferences.rulerUnits = originalRulerUnits;
//Here After the canvas depend on width i should run different waterks. Please  suggest to write conditionally
         if (doc.width<cm8 && doc.height>cm5){
        case1 var fileRef = new File(Folder.desktop + "/Watermark/Logo-8pt.png");//Here width or height is in between 8cm - 12cm i want to run 8pt logo.
        case2 var fileRef = new File(Folder.desktop + "/Watermark/Logo-10pt.png");//Here width or height is in between 13cm - 16cm i want to run 10pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-12pt.png");//Here width or height is in between 17cm - 20cm i want to run 12pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-14pt.png");//Here width or height is in between 21cm - 24cm i want to run 14pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-16pt.png");//Here width or height is in between 25cm - 28cm i want to run 16pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-18pt.png");//Here width or height is in between 28.5cm - 30cm i want to run 18pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-20pt.png");//Here width or height is in between 30.5cm - 32cm i want to run 20pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-22pt.png");//Here width or height is in between 32.5cm - 34cm i want to run 22pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-24pt.png");//Here width or height is in between 34.5cm - 36cm i want to run 24pt logo.
            //Here one more thing also i want to wrie if width in beween 12cm to 13cm(Eg., 12.5, 12.8, 12.6, 12.1). See Case1 & 2.
    var sourceDoc = app.open(fileRef); 
    sourceDoc.activeLayer.duplicate (doc);
    sourceDoc.close(SaveOptions.DONOTSAVECHANGES);

Hi,
Thanks for the reply
Used to work on product images. procedure goes like this:
1. Cut the product
2. Change colour mode
3. Make path
4. Clear background
5. Trim
6. Increase canvas(Relative)
7. Save as tiff
Here i am getting error in No.6 Step (The canvas should increase Conditionally Depend on image size in Cm's. If Width is more than height it should consider Width.  If height is more than width it should consider height.). i have standards like this much width means this much canvas(relative) should increase. So the standards are mentioned as variable at the start of the script. So i want to write Canvas as conditionally.
Script goes here:
        var cm3_5 = 3.5;
        var cm5 = 5;
        var cm8 = 8;
        var cm12 = 12;
        var cm13 = 13;
        var cm16 = 16;
        var cm17 = 17;
        var cm20 = 20;
        var cm21 = 21;
        var cm24 = 24;
        var cm25 = 25;
        var cm28 = 28;
        var cm28_5 = 28.5;
        var cm30 = 30;
        var cm30_5 = 30.5;
        var cm32 = 32;
        var cm32_5 = 32.5;
        var cm34 = 34;
        var cm34_5 = 34.5;
        var cm36 = 36;
                var doc=app.activeDocument;
                var originalRulerUnits = app.preferences.rulerUnits;
                app.preferences.rulerUnits = Units.CM;
            if(doc.width>doc.height)
                 if (doc.width<cm3_5){
                doc.resizeCanvas(doc.width + 0.5, doc.height +0.5, AnchorPosition.MIDDLECENTER);
                }else  if (doc.width<cm5){
                doc.resizeCanvas(doc.width + 0.75, doc.height +0.75, AnchorPosition.MIDDLECENTER);
                }else  if (doc.width<cm8 && doc.width>cm4){
                doc.resizeCanvas(doc.width + 1, doc.height +1, AnchorPosition.MIDDLECENTER);
                }else  if (doc.width<cm12 && doc.width>cm8){
                doc.resizeCanvas(doc.width + 1.5, doc.height +1.5, AnchorPosition.MIDDLECENTER);
                }else  if (doc.width<cm20 && doc.width>cm17){
                doc.resizeCanvas(doc.width + 2, doc.height +2, AnchorPosition.MIDDLECENTER);
                if (doc.width<cm24 && doc.width>cm20){
                doc.resizeCanvas(doc.width + 3, doc.height +3, AnchorPosition.MIDDLECENTER);
//Here the Error getting not able to increase canvas. How i want to write canvas conditionally
        if(doc.height>doc.width)
                 if (doc.width<cm8 && doc.height>cm5){
                doc.resizeCanvas(doc.width + 1, doc.height +1, AnchorPosition.MIDDLECENTER);
//End of canvas
doc.changeMode(ChangeMode.RGB);
//Here again i want to put watermarks depend on size again (If Width is more than height it should consider Width.  If height is more than width it should consider height.). So i need to write here also conditionally
add watermarks kindly suggest. How to write.
//Here After the canvas depend on width i should run different watermarks. Please  suggest to write conditionally
         if (doc.width<cm8 && doc.height>cm5){
        case1 var fileRef = new File(Folder.desktop + "/Watermark/Logo-8pt.png");//Here width or height is in between 8cm - 12cm i want to run 8pt logo.
        case2 var fileRef = new File(Folder.desktop + "/Watermark/Logo-10pt.png");//Here width or height is in between 13cm - 16cm i want to run 10pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-12pt.png");//Here width or height is in between 17cm - 20cm i want to run 12pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-14pt.png");//Here width or height is in between 21cm - 24cm i want to run 14pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-16pt.png");//Here width or height is in between 25cm - 28cm i want to run 16pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-18pt.png");//Here width or height is in between 28.5cm - 30cm i want to run 18pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-20pt.png");//Here width or height is in between 30.5cm - 32cm i want to run 20pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-22pt.png");//Here width or height is in between 32.5cm - 34cm i want to run 22pt logo.
            var fileRef = new File(Folder.desktop + "/Watermark/Logo-24pt.png");//Here width or height is in between 34.5cm - 36cm i want to run 24pt logo.
            //Here one more thing also i want to wrie if width in beween 12cm to 13cm(Eg., 12.5, 12.8, 12.6, 12.1). See Case1 & 2.
    var sourceDoc = app.open(fileRef);
    sourceDoc.activeLayer.duplicate (doc);
    sourceDoc.close(SaveOptions.DONOTSAVECHANGES);
I hope i explained my problems clearly.
Thanks in Advance,
Regards,
Suresh

Similar Messages

  • Increasing canvas size and re-clipping (intentionally)

    Hi,
    So I bolluxed up a little bit while creating my first full-bleed print piece. I used Ps to edit the image, Ai to add some stuff, and ignored Id completely for the printer. Now I have a perfect 8.5 x 11 image that I want to print all the way to the edges without scaling; I left white bleeds 1.8" but apparently that won't suffice.
    I'm trying to go back into photoshop and increase the canvas size (8.75 x 11.25 to include bleeds), and with it, extend the image that was originally clipped when I trimmed the document from a vertical picture (12 x 16 or whatever) to fit the standard letter paper size. When I do that, I get only white areas around the canvas.
    Can anyone provide a solution to create full-color bleeds the way they should have been done originally? I have tried changing the canvas size and re-placing another layer of the image behind the existing one (with the hopes that it would clip automatically), but it didn't work. At this point, should I worry about bringing anything into InDesign?
    Thanks,
    - boda

    The Nish Adeel,
    > i wants to increase my fla canvas size from all sides...
    when we
    > increase the size of a file it increases from right and
    bottom , i
    > want to make it from all four sides like photoshop ...
    is there any
    > way to do this.
    There is a way to do this; unfortunately, it's not an
    automatic feature
    like in Photoshop. The approach you'll need to take is to
    update the
    document dimensions (basically, the canvas size) as desired,
    then use the
    Edit Multiple Frames button on the lower left of the Timeline
    panel to
    manually move all assets on the main timeline. To do this,
    you'll have to
    make sure all layers are unlocked. To do this quickly, click
    the
    Lock/Unlock All Layers button at the top, between the eye and
    the square
    buttons, until you see that all locks have been removed (one
    or two clicks
    will do it). In the Modify Onion Markers button next to the
    Edit Multiple
    Frames button, choose Onion All. Select Edit > Select All,
    then use the
    arrow buttons to move your assets.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • In cursor i have two queries where put the condition and how to print the d

    hi i have 2 tables 1 is emp(empid,empname,dept,grade)
    2 is salary(grade,salary)
    in cursor when ever grade is increased salary automatically increased
    in 2 diffrent queries where i will put the if condition and how to print the output.
    any one can please suggest me.
    finally my required out put is
    empid,empname,grade,salary
    thanks

    It is always helpful to provide the following:
    1. Oracle version (SELECT * FROM V$VERSION)
    2. Sample data in the form of CREATE / INSERT statements.
    3. Expected output
    4. Explanation of expected output (A.K.A. "business logic")
    5. Use \ tags for #2 and #3. See FAQ (Link on top right side) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Difference in price in PO condition and invoice

    Hi,
    The situation is as follows:
    A PO was created, released and GR done. One item in the PO has quantity 200 KG, price Rs. 100 per KG. So the net price is Rs. 20,000. Now, the price of that item has increased to Rs. 110 per KG, so the total net price would be Rs. 22,000. IR needs to reflect this.
    I was going to reverse the GR for that material using MBST, change the price in the PO item condition and repost GR. But, the stock has all been consumed. Since there is no stock, reversal of GR cannot be done.
    What is the standard method of handling such a case? Should the amount be reflected in the invoice in MIR7 / MIRO? Quantity remains the same, amount has changed. When the PO doument reference is given in MIR7 / MIRO, the system proposes Rs. 20,000 as the amount. If this is changed to Rs. 22,000, the document can be posted, but the difference of Rs. 2000 is being posted to a different G/L. Is this ok? What is the impact on finance? Is there a better way of handling this? Help is appreciated, thanks.
    Regards

    The difference will get posted in Invoice in the Price difference account.
    This is the Standard Process for this kind of the case.

  • How can I export an image from Illustrator same canvas size and custom resolution?

    Hey all.  i am using Adobe Illustrator CS5 for creating images for iPhone app icons the size of image 374 px 374 px and 264 ppi. i created an image same size and ppi .the problem after export the image file size changing to  1371px x 1371px and 264 ppi pixel dimension.How can I export same canvas size and same resolution file from illustrator

    10111980,
    If you just forget about PPI and use Save for Web, you will get the 374 x 374 pixel size.
    The 1371 x 1371 pixels is because you somehow increase the resolution by 264/72.
    You should never mix pixel by pixel sizes and PPI.
    The 374 x 374 pixels is the actual image size. At 264 PPI that will be about 1.417 inches. At 72 PPI that will be about 5.194 inches.

  • 4 copies of same form with differnt footers and terms and conditons at back

    Hi Gurus,
    I have a requirement for invoice printing have a standard driver program for that..
    The problem is when we print the form we need 4 copies of the output with 4 different texts at the footer.
    like customer delivery copy, payment copy etc.
    And for cust delivery copy it should print the terms and conditons at the back side similarly a differt terms and condtions for payment copy..
    Please Help.. and provide ur valueable suggestions

    Hi Imran,
    Efficient, easy and perfect solution is here:
    Step-1: Your dynamic/conditional texts in footer should write in a new window. Create a new window and place it in page accordingly. Now, change the type of that window as 'COPIES WINDOW'.
    Step-2: In side this window, create a program-line and get the value of system variable 'SFSY-COPYCOUNT'. This will be either of 001/002/003/004 for different 4 copies.
    Step-3: Now depending on this value, print your footer.
    Hope this will solve your problem.
    Thanks
    Arghya Roy

  • How do I show a copyright logo on Photographs?

    I want to show a copyright logo and company details on my photos. Can't find how to do it. As I understand it Metadata only embeds the information in the file and not on the photo. Any Ideas?

    Hi Flossie64.  What you want is called a "Watermark".  Click the heading below for the User Manual section.
    Adding a Watermark at Export
    A watermark is a visible graphic overlay that is applied to an image. Photographers often use watermarks to indicate that images are protected by a copyright and to discourage others from inappropriately using their images.
    To use the Aperture tools, you must first create you watermark.  It is an image file with a transparent background.  There are some good posts on this forum with directions if you need them.
    The easiest way to do this, though, is simply to install the free Aperture plug-in Border FX.  The bang for the buck is unsurpassable.
    I use Border FX all the time -- but even within Border FX I use a PNG overlay.
    Message was edited by: Kirby Krieger -- the editor is not wysiwyg.

  • How many conditions and exceptions  can be defined in a query?

    hi,
    Can any one tell
    How many conditions and exceptions  can be defined in a query?
    i.e
    How many condtion can be defineon an keyf igure with respective to charecteristics?
    Because if we define more conditions on one keyfigure with respective to different chars,there might be some overlap among the conditons andconditions might not work.
    Am i coorect?
    Similary for the exceptions also.
    Simply to be asked aswhat are the limitations of conditons and exceptions?
    Regards
    Naresh

    Hi Naresh,
    In Query we can no limit for creating Condition & Exception
    but Creating Condition : You can create two condition in a single condition it's work 'OR' Condition.
    You can build different condition it will work "AND' Condition.
    Thanks & Regards,
    Venkat.

  • HT5661 unable to accept Terms and Conditon

    unable to accept Terms and Conditon in iphone 5  of that  ios 7

    Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • Copyright logo

    Hi guys Ive been searching through thr forum without succes ,looking for how to d the copyright logo on motion.
    I am doing some credits and want to get that little c in the circle.
    How can I do this?
    Thanks
    Danny

    Hi Danny,
    If you will again have a problem with some special characters, download this excellent widget:
    http://www.tacowidgets.com/widgets/characterpal/
    It gives you hint's for keyboard shortcuts, for all special characters like ®, ™, etc.
    Michal

  • Increasing canvas size from all sides

    Hello to all,
    i wants to increase my fla canvas size from all sides... when
    we increase the size of a file it increases from right and bottom ,
    i want to make it from all four sides like photoshop ... is there
    any way to do this.
    Thanks in advance

    The Nish Adeel,
    > i wants to increase my fla canvas size from all sides...
    when we
    > increase the size of a file it increases from right and
    bottom , i
    > want to make it from all four sides like photoshop ...
    is there any
    > way to do this.
    There is a way to do this; unfortunately, it's not an
    automatic feature
    like in Photoshop. The approach you'll need to take is to
    update the
    document dimensions (basically, the canvas size) as desired,
    then use the
    Edit Multiple Frames button on the lower left of the Timeline
    panel to
    manually move all assets on the main timeline. To do this,
    you'll have to
    make sure all layers are unlocked. To do this quickly, click
    the
    Lock/Unlock All Layers button at the top, between the eye and
    the square
    buttons, until you see that all locks have been removed (one
    or two clicks
    will do it). In the Modify Onion Markers button next to the
    Edit Multiple
    Frames button, choose Onion All. Select Edit > Select All,
    then use the
    arrow buttons to move your assets.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • Hello, i restored and updated my iphone 4 to the latest version of 5.1.1 and after that when i connect my mobile to i tunes all i see is a big rectangle and a apple logo on left and a small lock on right side please help me fix this problem.

    hello,
    i restored and updated my iphone 4 to the latest version of 5.1.1 and after that when i connect my mobile to i tunes all i see is a big rectangle and a apple logo on left and a small lock on right side please help me fix this problem.

    I sloved this issue by resting my phone from settings>general>reset>reset all settings...the problem will be fixed

  • My iPhone 4s is stuck on a black screen that shows a USB cable connecting to iTunes. The phone will not turn on and the iTunes logo as I described only shows up when I plug the phone into the charger or my computer. I have tried the reset in restore mode

    My iPhone 4s is stuck on a black screen that shows a USB cable connecting to iTunes. The phone will not turn on and the iTunes logo as I described only shows up when I plug the phone into the charger or my computer. I have tried the reset in restore mode as well as the DFU? mode and it still will not work. I have the latest version of iTunes on my Mac. My error code was 2002. I also tried it on my laptop (windows 8.1) and none of the above worked. My error code on my laptop was 02. The phone is through Verizon and it has absolutely no damage. It was working fine up until this and I have been trying to fix it for 2 days. Please help! I am unsure of what version the phone was currently running on before this because I have another iphone that's my primary phone and have not used this one in about a month. I do not believe it was updated to IOS 7.

    Your iPhone is in recoverty mode at the moment so to possibly get it back up and running you would need to do a restore as you have been trying. Follow the steps in the article below for the specific error messages you have been receiving. If after following all steps the issue remains book an appointment at a local Apple Retail Store to have the iPhone evaluated.
    Resolve specific iTunes update and restore errors

  • How to increase dynamically open_cursors and session_cached_cursors

    how to increase dynamically open_cursors and session_cached_cursors
    for Ex. alter system open_cursors = 500

    instane level:
    alter system set session_cached_cursors=200 scope = spfile; or set init.ora file.
    alter system set open_cursors=400;
    More details about open_cursor and session_cached_cursor, refer the below link
    http://www.orafaq.com/node/758
    Regards
    RajaBaskar

  • HT1414 I just tried to update to IOS 7 but after it completed, my iphone screen shows nothing but a USB cord and the iTunes Logo even when connected. Help Please!

    Today I was updating my phone to the newest IOS 7 and after it finished downloading. An error showed up on my screen telling me it was unable to update. So I decided to just unplug my phone and maybe do it later but on my screen I have a USB cord and the iTunes logo asking me to connect. So I hooked it back up and still at this point my iTunes will not connect and when I unplug the phone the screen stays the same. I have tried turning off the phone and restarting and both times the screen goes back to the connect  screen.. How can I fix this?

    I have tried the steps to fix it but no solution! Please someone tell me what to do!

Maybe you are looking for

  • Nikon RAW Files turn purple (while JPEGs unchanged)

    Only recently, not sure if it coincided with an update, my MacBook mis-converts most, but seemingly not all, Nikon (from a D7000) RAW files.  It appears to do it in iPhoto and also in the browser, although all of the thumbnails and JPEGs look correct

  • Some tracks won't play in iTunes anymore

    I have a number of .mp3 files that iTunes used to play, but now no longer will. Nothing happens when I double click on them or press play. Most of my other tracks play fine. When I "get info" about the problem tracks within iTunes, and I click on Sum

  • Validation messages in JSF (when not using ADF faces)

    I've spent some time with JDeveloper 11 and would like to use it on an upcoming project. I have to target IE 6, so I won't be able to take advantage of ADF Faces. Instead I'd like to use the ADF Business Components with a standard JSF interface so it

  • Started a project with the wrong format (plus another problem).  Am I screwed?

    I set up my project in 1080p 24 (23.98). Don't ask me what I was thinking, clearly I wasn't. I should have set it up as 720p 24. Instead of transcoding all my 720p 60 (59.94) work files by log and capture, I just started dragging and dropping them in

  • Xorg.conf (help)

    Got 2 screens on my computer, a 22" Samsung on DVI and a 40" Sony on HDMI. 1. My 40" TV automatically becomes the primary screen. I want my 22" as primary. 2. I want extended desktop configured in the xorg.conf since i need to use the xorg.conf anywa