Cs sdk: copying an item from one document to another

is there a way to copy any item from one ai document to the other ?

I'm not one for bumping old threads, but this problem is really giving me a headache...
I'm having the same exact problem with copying groups from one document to another.  It doesn't seem to matter if it's a top-level group or not; any group that gets copied over results in the copied art not showing up in the layer list and gives errors when trying to click on it.
If my source document looks like this:
Layer 1
  <path 1_1>
  <path 1_2>
  Layer 2
    <path 2_1>
If I DuplicateArt on the GetFirstArtOfLayer(Layer 1), Layer 1 gets copied into the new document, but it doesn't show up in the layer list and I get errors trying to click on any of the art.
If I iterate over the children/siblings of Layer 1 and duplicate them all separately, <path 1_1> and <path 1_2> will show up correctly in the new layer list and are clickable, but Layer 2 will not, and clicking on <path 2_1> results in the error.
At this point, the only solution I can think of is to recursively iterate over the source tree, manually creating the destination groups, and then copying the art work into them.
Very frustrating!

Similar Messages

  • Copy a page from one Document to another

    Can anyone help
    In Pages '08 we had the ability to copy a page from one document to another.
    In Pages '09 this does not seem possible.
    Does anyone have anwser....
    Thanks
    Message was edited by: AJCUR
    OK my bad
    I just realized that I was in Word Processing in one document and Page Layout in another and you cannot do the copy between the two. Changed the Blank documentto word processing and voila it worked.

    I think this might help. Go to the document you want to copy the page from and go to the "View" menu and choose "page thumbnail" so you can see the thumbnails on the side of the document. Right click (or control click) on the thumbnail of the page you want to copy and choose "copy.
    Go to the document you want to paste the page into and make sure you have the "View thumbnail" option turned on. If you already have some pages click on the page you want the new page to follow and then right click and paste the page where you want it. (you have to do this in the thumbnail view area, not in the actual document itself.) If you have inserted the page in the wrong spot, just drag it to the right location. note: I have tried dragging the thumbnail from one document to another and it does not work. Too bad because it works that way with a PDF documents in "Preview" app.

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Copy/Move Layerset From One Document To Another Without Flattening

    Hello,
    Does anyone know how to move a layerset from one document to another using JavaScript ExtendScript, but without having to flatten the layers first as I still need to edit them after the move.
    Many Thanks,
    James

    This requires that you have the the two documents open the first document open is the one you are copying from with the layer/layers selected.
    activeDocument=documents[0];
    dupLayers();
    function dupLayers() {
        var desc15 = new ActionDescriptor();
            var ref12 = new ActionReference();
            ref12.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc15.putReference( charIDToTypeID('null'), ref12 );
            var ref13 = new ActionReference();
            ref13.putName( charIDToTypeID('Dcmn'), documents[1].name );
        desc15.putReference( charIDToTypeID('T   '), ref13 );
        desc15.putInteger( charIDToTypeID('Vrsn'), 2 );
        executeAction( charIDToTypeID('Dplc'), desc15, DialogModes.NO );

  • Copy an Image from one document to another

    Is there an easy way to copy a rectangle containing an image (not a link to an image) from one document to another?
    Thanks.
    Chris.

    I can now copy-paste text frames and linked graphics from one document to another using snippets, but embedded images still don't work.
    If I embed an image from a pdf file it works but not for jpeg images. When I open the new document (for which I placed the snippet) in InDesign, there is a frame (with a dark grey background and a diagonal cross) shown, but no contents. The place() method did not throw an exception. What am I doing wrong?
    Chris.

  • Javascript help to copy selected items from one list to another list on same site

    Hello,
    So I have a request that I am not sure how to handle. I have created a page with a list view webpart that displays all the items from one list.
    The user is then supposed to select off multiple list items and click on a button (most likely a ribbon button) that will take the selected items and copy them to another list on the same SharePoint site.
    I would like to do this with JavaScript, but have only found an example that copies library items to another library.

    Hi KansaiKel,
    According to your description, my understanding is that you want to copy selected list items to another list.
    I suggest you can use JavaScript Client Object Model to achieve it.
    Here is a code snippet for your reference:
    <script type="text/javascript">
    var context = SP.ClientContext.get_current();
    var siteUrl = 'http://sp2013sps/sites/test';
    var clientContext = new SP.ClientContext(siteUrl);
    var web = context.get_web();
    context.load(web);
    var sourceId = SP.ListOperation.Selection.getSelectedList();
    var source = web.get_lists().getById(sourceId);
    var oList = context.get_web().get_lists().getByTitle('Copy');
    context.load(oList);
    var selectedItems = SP.ListOperation.Selection.getSelectedItems(context);
    alert('debut');
    for(var i in selectedItems)
    var currentItem = source.getItemById(selectedItems[i].id);
    context.load(currentItem);
    context.executeQueryAsync(Function.createDelegate(this,test),Function.createDelegate(this,error));
    function test(sender, args){
    var itemCreateInfo = new SP.ListItemCreationInformation();
    var oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', currentItem.get_item('Title'));
    oListItem.update();
    oList.update();
    alert('done');
    function error(sender, args){ alert('error');}""
    </script>
    Here is a detailed article for your reference:
    Complete basic operations using JavaScript library code in SharePoint
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

  • Copying an object from one document to another in CS4

    When more than one document is open in CS4 (for example document 1 and document 2), and the documents are arranged with tabs at the top, it should be possible to drag an object from document 1 to the tab of document 2, have the tab of document 2 automatically come to the top, and then drop the object onto a page in document 2. Is this a bug or is it just me?

    You're right, it SHOULD be, but it isn't. I filed a feature request as soon as CS4 was released, but add your voice at http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    In the meantime you need to either use copy/paste or switch to a tiles view.
    Peter

  • Swatch palette becomes full of unused colors when copy and paste from one document to another!!

    sometimes (i haven't found a pattern yet of when) when i copy and paste an object that is solid black (for example) into another Illustrator document, a bunch of unused swatches copy into the swatch palette for no reason! lots of "default global colors" and PMS swatches. i then have to 'select all unused' and delete them all to clean out the palette (which always seems to stall while thinking when selecting or deleting them). often times i get the global swatch warning (always 2x, not just once) before placing an object and before the whole swatch palette fills up with unused colors.
    this has only happened recently in the last few months and i have been using Illustrator for years so i'm not sure what's stemming this. a new update? has anyone else noticed this problem and know a solution? is there a preference checked somewhere that i don't know about?
    guess i should mention i'm on CS3 Illustrator running MAC OS 10.5.6
    thanks,
    kim

    I've had this problem before as well and it has to do with a currupt file that your coppying from. It's too complicated to explain here so here is my fix for it.
    I take the file and save it down or up in CS1. Open infected file in CS1. Create a new file in CS1 the same size as the one you've opened. Select all and drag and drop into the new empty file. Don't copy paste, it must be dragged into the file. You can then delete all global colours and save your file. The curruption will be gone. There's a way to check suspect files to see if they have the deleted global colours present. Open your suspect file in a text editor like simple text, scroll down a little way and if you see a bunch of lines of code mentioning "deleted global colours" then you know it's infected and has to be fixed.
    Hope this helps
    Here is another idea from a bit of research I just did. Don't know if this works or not but you might want to give it a try and it explains the issue in more detail
    http://adobe.groupbrowser.com/t177412.html

  • How can I copy a page from one document into another?

    I have produced a document in two separate fils and want to merge them into one.  There are six pages in each file, I need to put them I to one file, turn into a PDF and then mail them.

    Menu > View > Page Thumbnails > click on them > Copy > Paste into Thumbnails of other document
    Peter

  • FW CS5: Copy Page from one document to another without changing layers

    Hi,
    how can I copy a Page from one document to another without changing the layers?
    Drag-and-drop isn´t possible and by Copy-Paste all elements are placed in the same layer.
    Greetings,
    toho

    Use File > Import.
    Open the File, then navigate to the page you want to import
    Be sure to select Insert after current page, or FW will just import the content into the current page itself.

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

    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.

    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.

  • How to copy-paste frames from one document to other with there respective layers intact?

    Hi All,
         I am facing an issue while copy paste frames from one document to other. I have a 3 frames in first documents each one on different layer. First document has 3 layers. The second document too have 3 layers , I am copying frames from first document to scrapdata using 'ICopyCmdData ' and 'kCopyCmdBoss'. I have 'Paste Remembers Layers' menu 'Checked' on Layer panel. I am using following function to copy frames to scrapdata.
    bool16 copyStencilsFromTheTemplateDocumentIntoScrapData(PMString & templateFilePath)
         bool16 result = kFalse;
        do
            SDKLayoutHelper sdklhelp;
            PMString filePathItemsToBeCopiedFrom(templateFilePath);  //("c:\\test\\aa.indt");
            IDFile templateIDFile(filePathItemsToBeCopiedFrom);
            UIDRef templateDocUIDRef = sdklhelp.OpenDocument(templateIDFile);
            if(templateDocUIDRef == UIDRef ::gNull)                 
                break;
            ErrorCode err = sdklhelp.OpenLayoutWindow(templateDocUIDRef);
            if(err == kFailure)                 
                break;
            InterfacePtr<IDocument> templatedoc(templateDocUIDRef,UseDefaultIID());
            if(templatedoc == nil)               
                break;
            InterfacePtr<ISpreadList>templateSpreadUIDList(templatedoc,UseDefaultIID());
            if(templateSpreadUIDList == nil)                  
                break;
            IDataBase * templateDocDatabase = templateDocUIDRef.GetDataBase();
            if(templateDocDatabase == nil)                  
                break;
            UIDRef templateDocFirstSpreadUIDRef(templateDocDatabase, templateSpreadUIDList->GetNthSpreadUID(0));
            InterfacePtr<ISpread> templateSpread(templateDocFirstSpreadUIDRef, IID_ISPREAD);
            if(templateSpread == nil)                 
                break;
            UIDList templateFrameUIDList(templateDocDatabase);
            if(templateSpread->GetNthPageUID(0)== kInvalidUID)                  
                break;      
            templateSpread->GetItemsOnPage(0,&templateFrameUIDList,kFalse,kTrue);  
            InterfacePtr<ICommand> copyStencilsCMD(CmdUtils::CreateCommand(kCopyCmdBoss));
            if(copyStencilsCMD == nil)                
                break;
            InterfacePtr<ICopyCmdData> cmdData(copyStencilsCMD, IID_ICOPYCMDDATA);
            if(cmdData == nil)                 
                break;
            // Copy cmd will own this list
            UIDList* listCopy = new UIDList(templateFrameUIDList);
            InterfacePtr<IClipboardController> clipboardController(gSession,UseDefaultIID());
            if(clipboardController == nil)              
                break;
            ErrorCode status = clipboardController->PrepareForCopy();
            if(status == kFailure)                  
                break;
            InterfacePtr<IDataExchangeHandler> scrapHandler(clipboardController->QueryHandler(kPageItemFlavor));
            if(scrapHandler == nil)                 
                break;
            clipboardController->SetActiveScrapHandler(scrapHandler);
            InterfacePtr<IPageItemScrapData> scrapData(scrapHandler, UseDefaultIID());
            if(scrapData== nil)                
                break;
            UIDRef parent = scrapData->GetRootNode();
            cmdData->Set(copyStencilsCMD, listCopy, parent, scrapHandler);
            if(templateFrameUIDList.Length() == 0)       
                return kFalse;      
            else      
                status = CmdUtils::ProcessCommand(copyStencilsCMD);    
            if(status != kFailure)
              result = kTrue;
            sdklhelp.CloseDocument(templateDocUIDRef,kFalse,K2::kSuppressUI, kFalse);
        }while(kFalse);
        return result;
    After this I need to close first document. Now I am opening the second document from indt file which has same number of layers as first document. I am trying to paste frames from scrap data to second document using '' 'ICopyCmdData ' and 'kPasteCmdBoss' as shown in follwoing function
    bool16 pasteTheItemsFromScrapDataOntoOpenDocument(UIDRef &documentDocUIDRef )
        bool16 result = kFalse;
        do
               InterfacePtr<IClipboardController> clipboardController(gSession,UseDefaultIID());
                if(clipboardController == nil)
                    break;
               InterfacePtr<IDataExchangeHandler> scrapHandler(clipboardController->QueryHandler(kPageItemFlavor));
               if(scrapHandler == nil)               
                    break;
               InterfacePtr<IPageItemScrapData> scrapData(scrapHandler, UseDefaultIID());
                if(scrapData == nil)
                   break;
                     //This will give the list of items present on the scrap
                UIDList* scrapContents = scrapData->CreateUIDList();
                if (scrapContents->Length() >= 1)
                    InterfacePtr<IDocument> dataToBeSprayedDocument(documentDocUIDRef,UseDefaultIID());
                    if(dataToBeSprayedDocument == nil)
                       break;
                    InterfacePtr<ISpreadList>dataToBeSprayedDocumentSpreadList(dataToBeSprayedDocument,UseDef aultIID());
                    if(dataToBeSprayedDocumentSpreadList == nil)
                         break;
                    IDataBase * dataToBeSprayedDocDatabase = documentDocUIDRef.GetDataBase();
                    if(dataToBeSprayedDocDatabase == nil)
                         break;    
                    UIDRef spreadUIDRef(dataToBeSprayedDocDatabase, dataToBeSprayedDocumentSpreadList->GetNthSpreadUID(0));               
                    SDKLayoutHelper sdklhelp;
                    UIDRef parentLayerUIDRef = sdklhelp.GetSpreadLayerRef(spreadUIDRef);
                    InterfacePtr<IPageItemScrapData> localScrapData(scrapHandler, UseDefaultIID());
                    if(localScrapData == nil)
                        break;
                    if(parentLayerUIDRef.GetUID() == kInvalidUID)
                        break;
                    InterfacePtr<ICommand> pasteToClipBoardCMD (CmdUtils::CreateCommand(kPasteCmdBoss));
                    if(pasteToClipBoardCMD == nil)
                        break;
                    InterfacePtr<ICopyCmdData> cmdData(pasteToClipBoardCMD, UseDefaultIID());
                    if(cmdData == nil)
                        break;
                    if(scrapContents == nil)
                        break;               
                    PMPoint offset(0.0, 0.0);
                    cmdData->SetOffset(offset);
                    cmdData->Set(pasteToClipBoardCMD, scrapContents, parentLayerUIDRef );
                    ErrorCode status = CmdUtils::ProcessCommand(pasteToClipBoardCMD);
                    if(status == kSuccess)
                        CA("result = kTrue");
                        result = kTrue;
                }//end if (scrapContents->Length() >= 1)       
        }while(kFalse);
        return result;
         Here in above function its required to set Parent Layer UIDRef and because of this all frames are getting paste in one layer.
    Is there any way we can paste frame in there respective layers?
         Also I need to work this code with CS4 server and desktop indesign.
    Thanks in advance,
    Rahul Dalvi

    Try,
    // dstDoc must be FrontDocument
    InterfacePtr<ILayoutControlData> layoutData(Utils<ILayoutUIUtils>()->QueryFrontLayoutData());
    InterfacePtr<ICommand> createMasterFromMasterCmd(CmdUtils::CreateCommand(kCreateMasterFromMasterCmdBoss));
    createMasterFromMasterCmd->SetItemList(UIDList(srcMasterSpreadUIDRef));
    InterfacePtr<ILayoutCmdData> layoutCmdData(createMasterFromMasterCmd, UseDefaultIID());
    layoutCmdData->Set(::GetUIDRef(layoutData->GetDocument()), layoutData);
    CmdUtils::ProcessCommand(createMasterFromMasterCmd);

  • AppleScript copy alpha channel from one document to a second document

    I have two documents. One with Alpha Channels, the other with none. I am trying to copy the alpha channels from one document into the second.
    When I use the following in PS 6, the action duplicates the channels in the same document, not in the second document. I am using PS 6 with both documents open in tabs. Any help appreciated.
    tell application "Adobe Photoshop CS6"
      set x to document 1
      set y to document 2
      set cc to number of channel of current document
      repeat with i from 5 to cc
      duplicate channel i of x to y
      end repeat
    end tell

    I can now copy-paste text frames and linked graphics from one document to another using snippets, but embedded images still don't work.
    If I embed an image from a pdf file it works but not for jpeg images. When I open the new document (for which I placed the snippet) in InDesign, there is a frame (with a dark grey background and a diagonal cross) shown, but no contents. The place() method did not throw an exception. What am I doing wrong?
    Chris.

  • How to copy a folder from one document library to another document library ?

    How to copy a folder from one document library to another document library by programmtically?
    Samarendra Swain
    Team Sharepoint
    www.manuhsolutions.com

    You can use the SPFolder.CopyTo method.
    public static void CopyFolder()
    SPFolder folder = null;
    using (SPSite site = new SPSite("http://basesmcdev2/sites/tester1"))
    using (SPWeb web = site.OpenWeb())
    folder = web.GetFolder("shared%20documents/newfolder");
    folder.CopyTo("tester4/newfolder");
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfolder.copyto.aspx
    certdev.com

  • Is it possible to copy formats and styles from one document to another?

    Is it possible to copy formats and styles from one document to another?
    Or use a commen styledocument as a masterdocument?

    Only by creating a template with what you want.
    Apple has removed the ability to import styles inPAges 5 along with almost 100 other features.
    Peter

Maybe you are looking for