1 Reply Latest reply on Jul 22, 2014 5:12 AM by A. Patterson

    How do I copy an art object from one document to another using illustrator API(C  )

    MIsmael

      Hi, I'm trying to copy text and graphic elements from one document into another, does anybody has an idea how to do it using Illustrator SDK(C++)?

      Thanks in advance.

        • 1. Re: How do I copy an art object from one document to another using illustrator API(C  )
          A. Patterson Level 4

          If you call AIArtSuite::ReorderArt() giving the layer group handle from the target document and using art from the source document, it will move art between documents. That said, there are all sorts of caveats that come along with that -- some things move over automatically (graphic styles, symbols) while others cause problems. E.g. copying art that contains a swatch can cause a crash when you shut down the source document because it may keep the style reference to the swatch in the source document -- which goes away when the document is closed. Gradients in particular are a problem I believe. Straight up colours are (I think) fine. I've had to write a lot of workarounds for various headaches caused by moving art between documents.

           

          Bottom line: its very doable, but there are a lot of edge cases. This was clearly not an intended use of the SDK, though it is possible.