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;
        SDKLayoutHelper sdklhelp;
        PMString filePathItemsToBeCopiedFrom(templateFilePath);  //("c:\\test\\aa.indt");
        IDFile templateIDFile(filePathItemsToBeCopiedFrom);
        UIDRef templateDocUIDRef = sdklhelp.OpenDocument(templateIDFile);
        if(templateDocUIDRef == UIDRef ::gNull)                 
        ErrorCode err = sdklhelp.OpenLayoutWindow(templateDocUIDRef);
        if(err == kFailure)                 
        InterfacePtr<IDocument> templatedoc(templateDocUIDRef,UseDefaultIID());
        if(templatedoc == nil)               
        if(templateSpreadUIDList == nil)                  
        IDataBase * templateDocDatabase = templateDocUIDRef.GetDataBase();
        if(templateDocDatabase == nil)                  
        UIDRef templateDocFirstSpreadUIDRef(templateDocDatabase, templateSpreadUIDList->GetNthSpreadUID(0));
        InterfacePtr<ISpread> templateSpread(templateDocFirstSpreadUIDRef, IID_ISPREAD);
        if(templateSpread == nil)                 
        UIDList templateFrameUIDList(templateDocDatabase);
        if(templateSpread->GetNthPageUID(0)== kInvalidUID)                  
        InterfacePtr<ICommand> copyStencilsCMD(CmdUtils::CreateCommand(kCopyCmdBoss));
        if(copyStencilsCMD == nil)                
        InterfacePtr<ICopyCmdData> cmdData(copyStencilsCMD, IID_ICOPYCMDDATA);
        if(cmdData == nil)                 
        // Copy cmd will own this list
        UIDList* listCopy = new UIDList(templateFrameUIDList);
        InterfacePtr<IClipboardController> clipboardController(gSession,UseDefaultIID());
        if(clipboardController == nil)              
        ErrorCode status = clipboardController->PrepareForCopy();
        if(status == kFailure)                  
        InterfacePtr<IDataExchangeHandler> scrapHandler(clipboardController->QueryHandler(kPageItemFlavor));
        if(scrapHandler == nil)                 
        InterfacePtr<IPageItemScrapData> scrapData(scrapHandler, UseDefaultIID());
        if(scrapData== nil)                
        UIDRef parent = scrapData->GetRootNode();
        cmdData->Set(copyStencilsCMD, listCopy, parent, scrapHandler);
        if(templateFrameUIDList.Length() == 0)       
            return kFalse;      
            status = CmdUtils::ProcessCommand(copyStencilsCMD);    
        if(status != kFailure)
          result = kTrue;
        sdklhelp.CloseDocument(templateDocUIDRef,kFalse,K2::kSuppressUI, 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;
           InterfacePtr<IClipboardController> clipboardController(gSession,UseDefaultIID());
            if(clipboardController == nil)
           InterfacePtr<IDataExchangeHandler> scrapHandler(clipboardController->QueryHandler(kPageItemFlavor));
           if(scrapHandler == nil)               
           InterfacePtr<IPageItemScrapData> scrapData(scrapHandler, UseDefaultIID());
            if(scrapData == nil)
                 //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)
                InterfacePtr<ISpreadList>dataToBeSprayedDocumentSpreadList(dataToBeSprayedDocument,UseDef aultIID());
                if(dataToBeSprayedDocumentSpreadList == nil)
                IDataBase * dataToBeSprayedDocDatabase = documentDocUIDRef.GetDataBase();
                if(dataToBeSprayedDocDatabase == nil)
                UIDRef spreadUIDRef(dataToBeSprayedDocDatabase, dataToBeSprayedDocumentSpreadList->GetNthSpreadUID(0));               
                SDKLayoutHelper sdklhelp;
                UIDRef parentLayerUIDRef = sdklhelp.GetSpreadLayerRef(spreadUIDRef);
                InterfacePtr<IPageItemScrapData> localScrapData(scrapHandler, UseDefaultIID());
                if(localScrapData == nil)
                if(parentLayerUIDRef.GetUID() == kInvalidUID)
                InterfacePtr<ICommand> pasteToClipBoardCMD (CmdUtils::CreateCommand(kPasteCmdBoss));
                if(pasteToClipBoardCMD == nil)
                InterfacePtr<ICopyCmdData> cmdData(pasteToClipBoardCMD, UseDefaultIID());
                if(cmdData == nil)
                if(scrapContents == nil)
                PMPoint offset(0.0, 0.0);
                cmdData->Set(pasteToClipBoardCMD, scrapContents, parentLayerUIDRef );
                ErrorCode status = CmdUtils::ProcessCommand(pasteToClipBoardCMD);
                if(status == kSuccess)
                    CA("result = kTrue");
                    result = kTrue;
            }//end if (scrapContents->Length() >= 1)       
    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

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

Similar Messages

  • How to copy master spread from one document to other

    I've used kNewMasterSpreadCmdBoss command and IMasterSpreadCmdData interface but it copies master spread with empty master page.
    Should I setup some additional parameters for command? Or should I use different mechanism?

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

  • 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

    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");

  • How to best take sections from one document to merge with another Indesign document

    I am looking for most efficient way to take a section from one document to merge with a section from another document?  We have a book that needs updating, taking a section from one document to merge into another.  We have typically copied and paste each page, but there are 20+ pages involved.  Does anyone have a better way?

    Open both documents.
    With source document active, In pages panel, select pages that are to be copied to the destination document
    Right Click (or use panel menu) and select Move Pages ...
    Double check that correct page range is noted
    Select destination document
    select where in document pages should appear (beginning, end, after or before page X)

  • How to copy a plugin from one application to another,  is there an export possibility?

    I am using Apex 4.2.2 with 10g and OHS.
    There is a Gantt chart plugin in the Sample Calendar packaged application. I couldn't find that plugin for download.
    When I open it (Application Builder>Application 76373>Shared Components>Plug-ins>Create / Edit)
    it states:
    *Name (Value Required)    Gantt Chart
    *Internal Name (Value Required)    COM.ORACLE.APEX.GANTT_CHART
    Reference Master Plug-in From: 65708911358321918
    It refreshes without an error when I press the 'Refresh Plugin' button.
    I can copy the SQL code, can dowload the .css file,  etc., but I guess it is not enough.
    The Information section brings me the page, but there is no Gannt plugin.
    Is there any possibility to use this plugin in the same workspace in another application?
    Or sharing it? Or export and then import it?
    Thanks in advance.

    In Application Builder ->  Application XXXX -> Shared Components -> Plug-ins, click on plug-in name which will take you to plug-in details page. Here, on right hand side, you should see "Export Plug-in" under "Tasks". Click this link and follow the wizard.

  • How to copy the variants from one user to other user?

    Hi all,
    I have a list of variants(nearly 10 variants) for a report named 'ZONEORDER'. I need to copy all the variants to another user. Is it possible?
    If so, could anyone suggest the solution?
    Thanks in advance.

    Hello Vijay,
    I need to copy all the variants to another user.
    What does " copy to another user" mean?
    You can attach the variant to a Transport through prog. RSTRANSP and move to subsequent systems.

  • I have two ipads under the same name/account. How do I airplay content from one to the other if there is not a distinguishing difference between the two or use face chat?

    I gave my 2yr old my 16gb ipad 2 when I upgraded to a 64gb ipad 3. They are on the same account so that I can share certain apps between them, but because they consider themselves one in the same I can't use airplay or face chat with my daughters ipad. How do I do these things?

    Airplay doesn't work between two iPads so you don't need to worry about that, however, you can change the name of an iPad in Settings > General > About > Name.

  • How to copy a node from one dom document to another?

    I have one dom document that I have to split up into multiple dom documents. I am able to get the inividual nodes that I want to put into seperate documents.
    My problem occurs when I create a new dom document and try to add the node from the parent document. I get an exception saying (copied from api: WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. )
    How can I make it so that I can copy a node from one document and add it to another.

    Have you checked out the API called importNode in the DOM Document. It lets you move nodes between different documents.
    This api lets you simply copy the existing node from one document into another. without creating any new nodes for it.
    I have done a small example please have a look.
    <?xml version="1.0"?>
        <name>Inside Corba</name>
        <name>Inside RMI</name>
    <?xml version="1.0"?>
        <name>Core Java </name>
        <name>Core JINI</name>
    </books>------------------- (copies nodes from doc2 into doc1)
    import javax.xml.parsers.*;
    // structures
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class MoveNode
      public static void main(String[] args)
        // step1. create a factory and configure it
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        // step2. set various configurations
        factory.setValidating(false); // do not need validation at this time.
        factory.setIgnoringComments(false); // do not ignore comments
        factory.setIgnoringElementContentWhitespace(false); // do not ignore element content whitespace.
        // step 3 create a document builder
        DocumentBuilder builder = null;
          builder = factory.newDocumentBuilder();
        catch(ParserConfigurationException e)
          Document doc1 = builder.parse(new File("book.xml"));
          Document doc2 = builder.parse(new File("book2.xml"));
          if (doc1 == null || doc2 == null)
            System.out.println("doc1 is null or doc2 is null");
          } // if
          // fetch books from doc2
          NodeList list = doc2.getElementsByTagName("book");
          System.out.println("number of books found " + list.getLength());
          Node node1 = list.item(0);
          Node node2 = list.item(1);
          // get the root node of doc1
          Node root = (Node) doc1.getDocumentElement();
          root.appendChild(doc1.importNode(node1, false));
          root.appendChild(doc1.importNode(node2, false));
          //now doc1 should have 4 nodes
        } // try
        catch(SAXException se)
        catch(IOException ie)
    hope this helps.

  • Unable to paste frame from one animation into another

    Hi, I'm currently working to make a set of GIFs. I'm using PS CS6 64-bit on a Windows 7 PC. This is my first time encountering this error. I am attempting to select a batch of frames from one animation (in the frame animation mode) then select "Copy Frames" in the drop down window of the workflow menu, then move to the other animation, which is also in frame animation mode. However, when I go to that animation's drop down menu I'm unable to select "Paste Frame" - it's grayed out. I've attempted to rest my tools and preferences, and reopened PS several times, but still can't copy and paste frames from one animation to another. (I'm still able to copy and paste frames within a single animation.) As I said, this is my first time encountering this error after making numerous GIF sets this way -- any troubleshooting tips?

    That copy and paste you describe does not work in ASO -- it does in BSO. AFAIK, it has been that way forever.
    Sorry, because it is a very nice bit of functionality in BSO.
    Cameron Lackpour

  • 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....
    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.

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

    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,

    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.
    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 );

  • How to copy OVD configuration from one machine to another?

    We have two machines with OVD servers on them. The configurations should be identical from one machine to the other. We suspect there is a problem with the configuration on one of them. We need to know how to copy OVD configuration from one machine to another.
    Can you tell us how to do that?

    well i have this in mind which may help you.
    You would need to have a public ip address to the machine you have consoled to and on internet.
    Download the tftp software from below link.
    This software does not only act as the tftp server but also you can select the interface of you ethernet card as tftp server ip address.
    For ex if you are connected to a console and have a wireless card which is connected to internet also you connect you eth lan card to the eth or fast eth of the router.
    you can select which ever interface you want to act as the tftp server.
    you will need to add ip addres for you lan card and also config the router port as same if needed.

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

    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:
    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]



    Hi Tina,
    To copy either a Script or a Smartform fron one client to another client i.e from reference client 000 to any client say 010  follow instructions as given below:
    Go to Tcode SE71->Give Form name MEDRUCK then go to Menu path Utilities->Copy From Client, give
    Form Name: MEDRUCK
    SOURCE:000 (it will be already there)
    Target Form: Zmedruck(here give ur form zname)
    It will be copied into all languages.
    Then come back to SE71
    Give your form name Zmedruck
    Language:: de then goto change mode
    then menu path->utilities->convert original languge to En and enter you will get a message original language of form zmedruck converted from de to en,
    now  change language de to en in se71 main screen and then do what ever changes you want to do , this is how you can copy a script or smartform from one client to another client.
    If this answer is useful reward points any queries revert me back.

  • How to move BCS data from one box to other

    Hello Expert,
    Dose any one know how to move BCS data from one box to other box ?
    Thanks & Regards,

    1) The best is to do the test. In my case, my customer was just doing this transfer (in full) to perform tests on the BEX reportings. Actually, they never raised any issue regarding document number when they did additional postings in test system... I would also say that during the transfer, the number counter in Qual gets not synchronized with the one in Prod. So, I think the system will just take the next number available in Qual. Should not be an issue.
    2)  As explained in answer 1), in my case, the purpose was not to perform data migration from one system to the other one. Thus, my customer never performed a subsequent consolidation in the target system. But, basically, the transfer copies all data : posting levels 00 to 30, for all periods you have selected + Additional financial data and sequence of activities. Thus, for me, everyhting is available in the target system, including COI documents. In other words, the "picture" regarding the data should be exactly the same between both system. The only thing you need to pay attention to is the customizing : it must be the same in Qual and Prod (example : date of acquisition and divestiture, structure of the group, etc...).
    Another very important thing, is that your export data source must not be enriched due to the BCS Delta load scenario. If it is the case, the system will write the consolidation logic (i-e the consolidation group + reporting mode) when transferring the data from the source Real Time Infocube to the Target Real time infocube, which will lead to inconsistent data in the target system.

Maybe you are looking for

  • ERROR while booting

    could any one be of assistance i cant boot my blackberry z3 it gives me this error

  • User Exit/Badi for G/L account assignment in ME21n/ME22n

    Hi All, I need user exit/badi for account assignment in item details for following requirement. If user changes G/L account of the first line item then I have to copy same G/L account to all line items. Please suggest me suitable user exit for this.

  • Macbook is running very slow and pop-ups come up constantly while using both Safari & Chrome.

    My 2008 macbook has a virus on it caused by me accidentally clicking a wrong download while making a mix tape for a friend ( I was using a website that is not illegal btw) and now my computer is running very slow. As well as having pop ups all over m

  • How do I open a new tab? None of the options work for me.

    I've tried: 1. Clicking the "+" icon next to my current tab 2. Going to "File -> New Tab" 3. Using the "Ctrl - T" keyboard shortcut 4. Restarting Firefox 5. Restarting my computer (Windows 7 laptop) 6. Downloading all possible updates -> Restarting m

  • Voice command for Contacts doesn't work after a re...

    Voice command for Contacts doesn't work after a reboot or a contacts restore. Steps to reproduce: 1. Backup contacts. Open Files > Backup & Restore > Select Contact for Backup Contents and select Back up now. 2. Edit/save a contact, press and hold th