How can we chnage ArtBoard rectangle by programatically?

Hello ,
I want to change the ArtBoard rectangle left, top, right and bottom values.
I found the AIDocumentSuite::SetDocumentCropBox( ) API and set it like below
AIRealRect cropBox = {0, 850, 1700, 0}; //left, top, right, bottom
error = sAIDocument->SetDocumentRulerUnits(kCentimetersUnits);
error = sAIDocument->SetDocumentCropBox(&cropBox);
error = sAIDocument->RedrawDocument( );
After this, the document is shown like in ArtBoard.jpg file (attached here).
So, from this .jpg file what Im guessing is, a new art is created instead of changing the values of already presented ArtBoard.
I dont want to create a new ArtBoard, I just need to change the ArtBoard rectangle values. How can I do this?

SetDocumentCropBox will do exactly what it is supposed to - crop the document - not change the ArtBoard.
One look at the AiDocument documentation tells you everything you need to know. Do you have the documentation? I would suggest downloading it if you don't.
You need to use something like (I just wrote this; not tested):
AIDocumentSetup docSetup;
error = sAIDocument->GetDocumentSetup(&docSetup);
//UNITS are in POINTS
docSetup.width = 850;
docSetup.height = 1700;
error = sAIDocument->SetDocumentSetup(&docSetup);

Similar Messages

  • How can i creat several rectangles with one draw rect.vi

    how can i creat several rectangles with one draw rect.vi? thanks
    Solved!
    Go to Solution.

    You can call it in a for loop, with an array of the rectangle coordinates you want to draw. Is this what you mean?
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    rectangle.png ‏11 KB

  • How can we draw Round Rectangle Border

    how can we draw Round Rectangle Border for example, just like XP's Task Manager( under "performance tab" )

    HI,
    Check MacTopia's support area for Word. http://www.microsoft.com/mac/help.mspx?product=Word&app=4
    I would think you need graphics software for that....
    Carolyn

  • How can I reshape a rectangle sign into a polygon shape?

    I have made a sign that looks like a license plate.  to make it more interesting, I'd like to transform the rectangle into a polygon by lifting the top line from the center and dropping the bottom line from the center.  How can I do this?

    You are short on replies because your question is ambiguous.  You'll need to be clearer about what you want to achieve, but I've made a guess.
    polygon
    noun
    Geometry 
    noun: polygon; plural noun: polygons
    a plane figure with at least three straight sides and angles, and typically five or more. 

  • How can I hide a menu options programatically in Forms 6i?

    Hi folks:
    I am using a customized menu. Called AEMS001. I have four options: File, Maintenance, Operations, Administration.
    Inside Maintenance, I have 15 different options and I need to hide five of them (Fees, Documents, Legal, Recors, Others) depending of the user role assined.
    How can I do that?
    I try to use set_menu_item_property('FEES', Visible, property_false)
    but it give me an error: FRM-41067: Cannot find menu item: invalid Id
    What do I did wrong?
    thanks a lot.
    Abdel

    hi,
    it might be that there is an initialization error in your code...
    try something like this (you can use visible or enable property).
    tell me your email and i will send you sample form and menu with the following code ...
    declare
    menu_item_name     varchar2(40) := 'MENU2.ITEM23';
    menu_item_id     MenuItem;
    begin
    menu_item_id := find_menu_item(menu_item_name);
    /*if (not id_null(menu_item_id)) then
    if (GET_MENU_ITEM_PROPERTY(MENU_ITEM_NAME, visible)='TRUE') then
         set_menu_item_property(menu_item_id, visible, property_false);
    else
         set_menu_item_property(menu_item_id, visible, property_true);     
    end if;
    else
    message(' cannot find menu item!');          
         raise form_trigger_failure;
    end if;     
    if (not id_null(menu_item_id)) then
    if (GET_MENU_ITEM_PROPERTY(MENU_ITEM_NAME, enabled)='TRUE') then
         set_menu_item_property(menu_item_id, enabled, property_false);
    else
         set_menu_item_property(menu_item_id, enabled, property_true);     
    end if;
    else
         message(' cannot find menu item!');          
         raise form_trigger_failure;
    end if;     
    end;

  • How can I create a Development Distribution Programatically?

    Hello,
    I want to use the Save with Options Dialog in a LabView Program.
    My LabVIEW Program can save the Whole Hierarchy of the Top-Level vi with all needed SubVis, but I need the Controls also, otherwise
    my LabVIEW Program can not run.
    Is there a possibility to use the Option "Save for Application Distribution" programatically?
    Thanks for help.

    hi
    2 suggestions:
    - change all of your controls to TypeDefs or Strict TypeDefs. Then the control will appear in the list of the callees of a vi.
    - add a Custom Runtime Menu to your App. Add the Application Item "Save with Options.." to the RTM. By doing so the Dialog Appears when the menu item has been selected.
    best regards
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • How can I export artboard color in SVG?

    Hi Expert,
    My question is if I apply any background color in artboard then I'm not able to convert this in SVG format even If I close and reopen same file then background color makes white.
    So Is there any way I can convert illustrator file in SVG ( with applying background color by artboard) ?
    I have to apply every time background color in artboard in same file.
    Thanks,
    Rakesh

    Oh, BTW, it technically is not a white background either. It is a transparent background. But the grid is hidden to make it easier to design. For new users this can be deceiving since almost any other app is a white background unless you see the grid like in photoshop. In Illustrator, to fill you are required to have an object.

  • How can I transform a rectangle to a heart with Premiere Pro CS5?

    Hello, is there a way to transform / morph a rectangle to a heart with PPro CS5 or do I need special software / plug in?

    Yes, animating paths is relatively easy in After Effects.
    If you have questions, bring them to the After Effects forum.

  • How can I change Fieldpoint input ranges programatically?

    Hi everybody,
    I'm using several FP-AI-110 (8ch AI module) and FP-SG-140 (8CH strain
    gauge module) with FP-1001 as RS-485 communication device, driven by
    LabVIEW.
    Now I need to implement a autoranging feature, to adapt the channel
    input ranges to track the input voltages for best possible resolutions.
    Since there are no VIs to do this, I guess I have to use the Extended
    FieldPoint Command Descriptions for >>Set Attributes<< and >>Get
    Attributes<<, described in Fieldpoint Programmers Reference Manual.
    I looked there and found settings for all kinds of FielPoint modules,
    but not for the FP-SG-140, which is most important for me. I also did
    not find a more recent manual on the NI-site, which contains the
    nessesary d
    escriptions.
    Questions:
    #1.
    Has anybody done this before for any modules and can give me some hints
    (or VIs)?
    #2.
    Is there a way to use the VIs, supplied with the fieldpoint software. I
    guess they are for use with ethernet-fieldpoints, because they need a
    IP-adress.
    Bye,
    Rainer

    Rainer,
    1) You can do this using the Optomux VI's which are located at: ftp://ftp.ni.com/support/fieldpoint/LVFPOpto/
    Please note, that after changing the range of a channel, you must wait for a period of time that is greater than or equal to the All Channel Update rate of the module prior to reading the channel that you just changed the range on. This is necessary to avoid scaling data acquired on the old range setting with the scale of the new range.
    2) The configuration VI's are ethernet based and do not work with serial modules. Instead, you should use the FieldPoint Optomux VI's that I reference above. The FieldPoint Optomux VI's are instantiations of each of the commands in the FP-1000/1001 Programmers Reference Manual.
    3) The FP-SG-140 is a ne
    wer module and has not yet made it into the FP-1000/1001 Programmers Reference Manual. I will post the proper range/attribute/command settings for the module later today or early tomorrow.
    Regards,
    Aaron

  • How can I move a rectangle with key?

    I try to control a rectangle with left and right key to move, but failed and need help to make it work. thanks!
    var cx:Number;
    var cy:Number;
    var fang:Rectangle=Rectangle{
         x:bind cx  y:bind cy
         width:50  height:50
         fill:Color.BLUEVIOLET
         onKeyTyped: function( e: KeyEvent) : Void {
                    if(e.code==KeyCode.VK_KP_LEFT){
                             cx++;
                             println("left pressed!");
                    if(e.code==KeyCode.VK_KP_RIGHT)
                              cx--;
    Stage{
        width:200
        height:400
        scene:Scene{
             content:[fang]
    }Edited by: Phoenix2006 on Sep 14, 2009 8:18 PM
    Edited by: Phoenix2006 on Sep 14, 2009 8:21 PM

    You will have to invoke requestFocus() on Rectangle so as to gain focus. You may try below code..
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.input.KeyCode;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Rectangle;
    var cx:Number;
    var cy:Number;
    var fang = Rectangle {
        x:bind cx
        y:bind cy
        width:50
        height:50
        fill:Color.BLUEVIOLET
        onKeyReleased: function(e) : Void {
            if(e.code == KeyCode.VK_LEFT) {
                cx--;
            } else if(e.code == KeyCode.VK_RIGHT) {
                cx++;
            } else if(e.code == KeyCode.VK_UP) {
                cy--;
            } else if(e.code == KeyCode.VK_DOWN) {
                cy++;
    Stage{
        width: 200
        height: 400
        scene: Scene {
            content: [ fang ]
    fang.requestFocus();

  • I would like to go to firefox to send emails automatically. for example, to reply to an oline item for sale, my system takes me to safri eamil. how can i chnage my settings to go to firefox. thanks. tim

    not too sure what else that I could add to give you more info.

    Firefox doesn't do email, it's a web browser.
    See this to change the email program or webmail provider that Firefox uses for '''mailto''' hyperlinks on webpages. <br />
    http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox

  • How can I change the name of our podcasts

    In the podcst directory ours is listed as:  liberty-baptist-church-sermons/id719265104
    How can I chnage that to read the real name of the program:  The Liberty Pulpit
    Frank Chyz
    Media Director
    Liberty Baptist Church
    Ellenboro, NC

    You have created your feed in WordPress; you need to change the title wherever you originally entered it in WordPress, but I can't advise on specifics. Once done, just republish the feed. The Store will take a couple of days or so toe catch up.

  • HELP---How can i save pics ???HELP

    I have a problem.
    i drwa e.g. a rectangle in green. how can i save this rectangle?
    has anyone examples?
    thanks thomas

    Do you mean save an image to file, or save it in memory for later use?
    If to file, does it have to be a specific format (jpg/gif), or would a proprietory format do?

  • How can reload pkcs#11 (digital signature) ?

    Hi Iam working on DigitalSignature.
    Iam using Aladdin eToken pro32k
    Initially Iam able to load usb tokens through application and sign the pdf documents.
    1) Iam giving right password and able to do sign on pdf document through crypto usb token.
    After this i didn't disconnected my usb token and try to sign another pdf doc but at this time
    Iam giving wrong password(PIN) to usb token but it is going to sign successfully.
    Here is the code for load a usbtoken through application.
    // The cfg file contains name = GNFCeToken
    //library = c:\WINDOWS\system32\eTpkcs11.dll
    String configName = "C:/pkcs11.cfg";
    Provider provider = new sun.security.pkcs11.SunPKCS11(configName);
    Security.addProvider(provider);
    KeyStore keyStore = null;
    keyStore = KeyStore.getInstance("PKCS11",provider);
    keyStore.load(null,tokenPassword);
    provider = keyStore.getProvider();
    For signing a pdf doc second time I need to reload the usb token every time.
    So how can I reload usb token through programatically?
    Any replys will appriciate greatly.

    "Registering" the credentials is something that is vendor middleware specific. It has nothing to do with Java code. An example of a passing mention of it is on this page: http://www.bestoken.com/support.html - "But the main function for it is that it can detect plug/unplug of
    hardware, and automatically read the certificates in hardware and
    register it to certificate storage section of the system." Some middlewares can do it automatically if you enable the option, some you must do it manually all the time.
    Well, it looks like the MSCAPI support works a little smoother with software-based credentials. I wrote the following test:
    import java.security.KeyStore;
    import java.security.PrivateKey;
    import java.security.cert.X509Certificate;
    import java.util.Enumeration;
    public class CAPITest {
      public static void main(String[] args){
        try {
          KeyStore ks = KeyStore.getInstance("Windows-MY");
          ks.load(null, null) ;
          Enumeration en = ks.aliases() ;
          while (en.hasMoreElements()) {
            String alias = (String) en.nextElement();
            X509Certificate c = (X509Certificate) ks.getCertificate(alias);
            PrivateKey key = (PrivateKey) ks.getKey(alias, null);
            if (key != null) {
              System.out.println(c.getSubjectDN().getName() + " has private key");
            else {
              System.out.println(c.getSubjectDN().getName());
        } catch (Exception ex) {
          ex.printStackTrace();
    }When I ran it I got a listing of 9 certs, 4 having private keys. No password popups or anything. 3 of the certs were on a currently inserted smartcard. When I removed the smartcard and ran it again I got a dialog belonging to my middleware asking me to insert my smartcard but even after I did, the OK button was disabled and I couldn't proceed.
    You've mentioned eToken a few times. If that is the only hw token you are supporting then I would reccommend using the SunPKCS11 provider directly rather than letting Microsoft CAPI get in the way. Using the SunPKCS11 provider will sidestep the certificate registration issue.
    You mention " The problem i am facing is say a system is used by 1000 user with there own eToken" as a possible use situation. Is this some sort of kiosk machine with a single shared account or each user has their own user account? If each user has their own account then their credentials won't mix. If they're all using the same account then again, I think you're better off using the SunPKCS11 provider and going directly to the eToken pkcs11 interface. That way you limit the list of certs to whatever is on the currently inserted token (which you should further inspect and limit to ones that have the digitial signature key usage bit set).

  • How can I get  the part image from a rectangle region?

    hi,
    I'm trying to draw a rectagle region on a picture with mouse and crop it. but the rectangle is not vertical along x-axis.that is to say, there is a angle between x-axis and the base of the rectangle. I don't know , how can I do it. Can someone give me some tip or some java-code. Thank you very much in advance.

    I completely misunderstood your question. As I read it again it seems clear and straight-forward. I'm sorry. Let's see if this is closer.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class CropImage
        BufferedImage original;
        CropPanel cropPanel;
        CropSelector selector;
        public CropImage()
            original = getImage();
            cropPanel = new CropPanel(original);
            selector = new CropSelector(cropPanel);
            cropPanel.addMouseListener(selector);
            cropPanel.addMouseMotionListener(selector);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(getUIPanel(), "North");
            f.getContentPane().add(new JScrollPane(cropPanel));
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
        private BufferedImage getImage()
            String fileName = "images/coyote.jpg";
            BufferedImage image = null;
            try
                URL url = getClass().getResource(fileName);
                image = ImageIO.read(url);
            catch(MalformedURLException mue)
                System.err.println("url: " + mue.getMessage());
            catch(IOException ioe)
                System.err.println("read: " + ioe.getMessage());
            return image;
        private JPanel getUIPanel()
            final JButton
                mask    = new JButton("mask"),
                crop    = new JButton("crop"),
                restore = new JButton("restore");
            ActionListener l = new ActionListener()
                public void actionPerformed(ActionEvent e)
                    JButton button = (JButton)e.getSource();
                    if(button == mask)
                        selector.mask();
                    if(button == crop)
                        selector.crop();
                    if(button == restore)
                        cropPanel.restore(original);
            mask.addActionListener(l);
            crop.addActionListener(l);
            restore.addActionListener(l);
            JPanel panel = new JPanel();
            panel.add(mask);
            panel.add(crop);
            panel.add(restore);
            return panel;
        public static void main(String[] args)
            new CropImage();
    class CropPanel extends JPanel
        BufferedImage image;
        Dimension size;
        GeneralPath clip;
        Point[] corners;
        Area mask;
        boolean showMask;
        Color bgColor;
        public CropPanel(BufferedImage bi)
            image = bi;
            setSize();
            clip = new GeneralPath();
            showMask = false;
            bgColor = getBackground();
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int w = getWidth();
            int h = getHeight();
            int x = (w - size.width)/2;
            int y = (h - size.height)/2;
            g2.drawImage(image, x, y, this);
            if(showMask)
                g2.setPaint(getBackground());
                g2.fill(mask);
            else
                g2.setPaint(Color.red);
                g2.draw(clip);
        public Dimension getPreferredSize()
            return size;
        public void setClip(Point[] p)
            corners = p;
            clip.reset();
            clip.moveTo(p[0].x, p[0].y);
            clip.lineTo(p[1].x, p[1].y);
            clip.lineTo(p[2].x, p[2].y);
            clip.lineTo(p[3].x, p[3].y);
            clip.closePath();
            repaint();
        public void clearClip()
            clip.reset();
            repaint();
        public void setMask(Area area)
            mask = area;
            showMask = true;
            repaint();
        public void setImage(BufferedImage image)
            this.image = image;
            setSize();
            showMask = false;
            clip.reset();
            repaint();
            revalidate();
        public void restore(BufferedImage image)
            setBackground(bgColor);
            setImage(image);
        private void setSize()
            size = new Dimension(image.getWidth(), image.getHeight());
    class CropSelector extends MouseInputAdapter
        CropPanel cropPanel;
        Point start, end;
        public CropSelector(CropPanel cp)
            cropPanel = cp;
        public void mask()
            Dimension d = cropPanel.getSize();
            Rectangle r = new Rectangle(0, 0, d.width, d.height);
            Area mask = new Area(r);
            Area port = new Area(cropPanel.clip);
            mask.subtract(port);
            cropPanel.setMask(mask);
        public void crop()
            Point[] p = cropPanel.corners;
            int w = p[2].x - p[0].x;
            int h = p[1].y - p[3].y;
            BufferedImage cropped = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = cropped.createGraphics();
            g2.translate(-p[0].x, -p[3].y);
            cropPanel.paint(g2);
            g2.dispose();
            cropPanel.setBackground(Color.pink);
            cropPanel.setImage(cropped);
        public void mousePressed(MouseEvent e)
            if(e.getClickCount() == 2)
                cropPanel.clearClip();
            start = e.getPoint();
        public void mouseDragged(MouseEvent e)
            end = e.getPoint();
            // locate high and low points of rectangle from start
            int dy = end.y - start.y;
            int dx = end.x - start.x;
            double theta = Math.atan2(dy, dx);
            double spoke = start.distance(end)/2;
            double side = Math.sqrt(spoke*spoke + spoke*spoke);
            Point[] corners = new Point[4];           // counter-clockwise
            corners[0] = start;                       // left
            int x = (int)(start.x + side * Math.cos(theta + Math.PI/4));
            int y = (int)(start.y + side * Math.sin(theta + Math.PI/4));
            corners[1] = new Point(x, y);             // bottom
            corners[2] = end;                         // right
            x = (int)(start.x + side * Math.cos(theta - Math.PI/4));
            y = (int)(start.y + side * Math.sin(theta - Math.PI/4));
            corners[3] = new Point(x, y);             // top
            cropPanel.setClip(corners);
    }

Maybe you are looking for