Page setting with kSetPageCmdBoss crash InDesign when two docs open...

Hello

I have a strange problem here - I have a function to make a page in the page document, I use the kSetPageCmdBoss here. I think the code is from a sample, or on the forum and I use it for a long time. I call this function of my plugin and it works very well if only one document is open.

Now, I found a problem when multiple documents are open. I am using our plugin as usual, I use the function to activate the pages and when I close my InDesign document crashed. I searched already a day to find that the problem is in this function and another day to understand why this happens. But at the moment I have no idea...

The source code of my function is less to-when I don't call this function, it works with more than one document. When I call, InDesign has crashed.

Anyone see the problem I do not see?

Or y at - it another way to make a page in the page document active?

Thank you

Klaus

// ----------------------------------------------------------------------------------------------------------
// active an page in the active document
UIDRef activatePage( IDocument* pDocument , int32 page ) {
     UIDRef UIDRefPage;
     if( pDocument != nil ) {
          IDataBase* db = ::GetDataBase( pDocument );
          if( db != nil ) {
               InterfacePtr pageList(pDocument, IID_IPAGELIST);
               if( pageList != nil ) {
                    //Get UID of Pagenumber 
                    UID UIDPage=pageList->GetNthPageUID( page ); 
                    if( UIDPage != 0 ) {
                         //Get UIDRef of Pagenumber 
                         UIDRef newRef(db, UIDPage); 
                         UIDRefPage = newRef;
                         if( UIDRefPage != 0 ) {
                              //Get Pages Layer 
                              InterfacePtr pageHierarchy(UIDRefPage,UseDefaultIID());
                              if( pageHierarchy != nil ) {

                                   InterfacePtr spread(db,pageHierarchy->GetSpreadUID(),UseDefaultIID());

                                   // create the command 
                                   InterfacePtr setPageCmd(CmdUtils::CreateCommand(kSetPageCmdBoss)); 

                                   // get UIDRef of the document 
                                   UIDRef documentUIDRef = ::GetUIDRef((IPMUnknown*) pDocument); 
                                   setPageCmd->SetItemList(UIDList(spread)); 

                                   // create layoutcmddata and get parameters 
                                   InterfacePtr layoutCmdData(setPageCmd, UseDefaultIID()); 
                                   InterfacePtr layoutControlData(Utils()->QueryFrontLayoutData(), UseDefaultIID()); 
                                   layoutCmdData->Set(documentUIDRef, layoutControlData); 

                                   // create the uidData 
                                   InterfacePtr uidData(setPageCmd, UseDefaultIID()); 
                                   uidData->Set(UIDRefPage); 

                                   // process command 
                                   CmdUtils::ProcessCommand(setPageCmd);
                              } // pageHierarchy != nil
                         } // UIDRefPage != 0
                    } // UIDPage != 0
               } // pageList != nil
          } // db != nil
     } // pDocument != nil
     return UIDRefPage;
}

Hi Klaus,

you call QueryFrontLayoutData(), but the given document may be another. It is best to call QueryLayoutData() with the presentation before most of the document, as you can get with IDocumentUIUtils.

Markus

Tags: InDesign

Similar Questions

  • How to set the default English indesign when creating text

    How can I configure indesign, when you create a default text for English

    You can set default values by first closing all open documents, and then change what you need in the control panel section, the character Panel, styles to paragraph, character, object, table, color chart, stroke and many more.

    This affects defaults to application , not those already in your document, so new documents will be created with the settings but old documents will remain the same.

    If you must change the default values for an existing document, make sure that nothing is selected and change the settings in one of the panels.

  • Add the new page number with gaps in indesign extension app

    Hi all

    I develop an application for extension adobe indesign with adobe flex 3.4 sdk.

    the application object is to publish the document to a remote server.

    I did well all options.

    now I am facing problems to Polish.

    the problem is,

    (1) adding new page

    Let's say that a particular indesign document (portrait) contains 6 pages.

    Page 1, 2 are spread

    Page 3

    Page 4

    Page 5, 6 are spread

    Now, I will add a new page through the indesign extension.

    When I try to add a new page. It will add to the last page of the spread. (Page 5, 6)

    Finally, he became Page 5, 6 and 7 in propagation.

    What I want is.

    After you have added the new page, the document must have the following structure.

    Page 1, 2 are spread

    Page 3

    Page 4

    Page 5, 6 are spread

    Page 7

    Is my code to add the new page.

    document: var Document = app.activeDocument;

    document.pages.Add ();

    Please suggest me how to add a new page (without extension)

    Thank you

    Malaris

    Try the code below

    document: var Document = app.activeDocument;

    document.spreads.Add ();

    But make sure you use this code on a document that may be the structure of the page that had mentioned you, that is to say it must be created by unchecking the options 'facing Pages' in the dialog box new document. Otherwise, it will add two pages of the document.

    This should solve your problem.

    Manan Joshi

    -InDesign efficient Solutions

    MetaDesign - Solutions

    http://metadesignsolutions.com/services/InDesign-development.php

  • I installed Photoshop and Lightroom a week ago and have problems with Lightroom crash - usually when I select "Develop" and often when I use 'Maps '.  Can someone give me an idea of how solve it/what to check?

    I forgot to mention - I am running Windows 10

    Hi stephenr,.

    It might be because of the graphics processor.

    Go to the Lightroom preferences > performance > uncheck 'use the graphics processor' > restart Lightroom, and then check out.

    Kind regards

    Claes

  • Anyone know of any way to label a SECURE PDF with the current date when it is opened or printed?

    I tried to add the date in a footer, but which is not updated and I tried to use javascript with a form field, but does not have the javascript code in a secure PDF file.  PDF must be secured in such a way that the content may not be copied, changed, etc..

    Thank you

    Dave

    Another post, I found that allowing the filling form security fields will enable the javascript code to execute.

  • Excel crashing, freezing when using the spreadsheet

    Original title: Excel 2013 file size.

    Hello. I'm having a problem with Excel crashing, freezing when using the spreadsheet. I work on a PC with WINDOWS 7 SP1 64-bit, through a server that is running Microsoft SERVER 2013, WINDOWS 7 PRO 64 BIT SP1. We use 5 PC via all current server running the same version of operating system that use the spreadsheet and in most is used only by 3 PCs anywhere, anytime, even if EXCEL is not on the server, it is running locally on the PC.

    My guy TI tell me the spreadsheet while working on too big to 2 k! They keep asking us to reduce the size and to separate the workbook to solve the problem. Personally I don't believe a Word, we do not use formulas etc just cells with digital text and the alphabet.

    Now last year on the advice of our computer SCIENCE company, we have been advised to upgrade our server and our PC because terminals that they were getting their limit of operation which I accepted. These have been updates middle of last year.

    On this basis, I believe that society COMPUTER trying to throw dust on my eyes as I do not think that they provided the wrong material and are unwilling to admit it.

    Counsel on the question worksheet would be great I need to come back with some kind of evidence in support of my way of thinking.

    I hope that makes sense, I know a little but not professional!

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • Problem with Illustrator and InDesign

    Hello, I am facing a problem with Illustrator and Indesign, when I copy a vector object from Illustrator into Indesign, I get the error: "import EPS file: InvalidFileAccess.»

    The file is saved on the pc, but I encounter this situation also files stored on the NAS.

    Any suggestions?

    Thank you to everyone

    InDesign has a preference of Clipboard, have you tried him affecting prefer PDF when pasting?

  • Import Illustrator doc with layers in InDesign

    I'm doing a tutorial on creating a new document in Illustrator or Photoshop and save the doc in InDesign with the layers. When the doc comes in InDesign, it has only one layer. I choose object > object Layer and the layers are all there, but they do not appear in the display. The original doc was created in Illy CS3 in WinXP and put in an empty doc opened in InDesign CS3. Any help?

    I thought I had book Sandee, but I can't put my hands on it. I wonder if you had misinterpreted what she said, that is, you can create different layers with different colors in a single file, then use the layer visibility options to access regardless of the version that you need without having to re - import.

    Actual installation of the imported file must be done in the editor appropriate, sorry.

  • I use view all bookmarks to set up a menu. When I click on something it often becomes hidden behind the menu page. This started to happen with the latest Firefox upward

    I use view all bookmarks to set up a menu. This page is now tagged library.
    When I click on something it often becomes hidden behind the library, rather than to the front where it is supposed to be. It started to happen with the latest update of Firefox.

    Can it be fixed?

    Sometimes, I noticed when I open a link in Firefox that the window that I expect to appear and stay out in front did not stay in front. I have not been able to identify a model, and just try once your script, it's not happened to me.

    If you have a widescreen monitor, another option for the use of bookmarks, in addition to the Library/Organizer and the dropdown menu, is to use the sidebar (press Ctrl + b to open and close).

  • Hi there from Hamburg/Germany. Since the last two updates of the CC, Photoshop crashes 95% when I work with masks. This gets really annoying when you know that I have about 120 photos to retouch to a customer. Any ideas what's happening here? Never

    Hi there from Hamburg/Germany. Since the last two updates of the CC, Photoshop crashes 95% when I work with masks. This gets really annoying when you know that I have about 120 photos to retouch to a customer. Any ideas what's happening here? Never had this problem before. Now, every time I create a layer mask, or try to work on a Photoshop freezes completely, forcing me to restart and (most of the time unless I have record EACH step) start of a scratch. Which is pretty much annoying... any suggestions?

    Move on to the Discussion of Photoshop

  • My problem is that I always get two tabs open when I start firefox. We are the home page, the second is a blank tab which is the one that opens. I don't want the 2nd

    I know how to set correctly in homepage. I'm an experienced user. My problem is when I start Firefox 20.0.1 it always starts two tabs. The first is the correct home page. The second is a blank tab switching to. I want only the first tab that is the home page. How to stop the second tab to open. The homepage is defined only with a URL and is correct.

    Note that you enter the permanent private browsing mode if you select "never remember history".
    In mode PB cookies are session cookies, so you can not keep all the cookies that store settings or other customization through a session.

  • Automated row Fetch failed when two forms on one page

    Hi guys,.

    APEX 4.2

    There are two forms on a single page (page 11) so that I can update two tables at the same time, I'm sure that I transferred a primary key that is appropriate for the two 2 forms.

    and various automated line created, extraction process

    Table1, primary key ID, element contains the primary key: P11_ID

    table 2, primary key ID, element contains the primary key: P11_ID_1

    When I ran to the page, the error occurred

    "ora-01403 no data available.

    in table2 fetch process

    Please help me find the reason, why can not extract the correct line to table2.

    Best regards

    Yong Huang wrote:

    Hi fac586,

    Thanks a lot for your quick response.

    In fact, at the beginning I used the process generated by the wizard to create one, but deleted when the error occurred, then I manually created once again, but still the same error.

    What do you mean by "created once again manually? The process of manipulation of data can be created using the wizard. Do you mean that you copied an existing one?

    Maybe I can repeat what I said above more clearly:

    It is not possible to have more than 1 set of the ARF/ARP process or Manipulation of MRF/MRU data on a page. Form region only one per page can use automatic data handling processes. Line fetch and process DML insert/update/delete for the areas of additional forms must be created manually using PL/SQL.

    Is it now clear?

  • Why is that I lost the ability to export documents with facing of InDesign to PDF pages?

    It's very frustrating because I've never had this problem before in InDesign, but for some reason my document refuses to export to Adobe Acrobat with facing pages. I'm not an A3 spread, just beside pages which I can then export to Word, maintaining of the layout.

    I have tried everything that I can think of export options but nothing works... Help, please!

    InDesign (opposite page) > > > export options > > > Adobe Acrobat (single pages)

    1.jpg2.jpg3.jpg

    On a side note, when I export PDF to Word files, I lose all the transparency settings. Is - this avoidable?

    Jamie, I also have clients who work only in Word. You save a lot of time and frustration by designing simple and good documents that can be created in Word. It is not as fun as in InDesign, but the customer is King, and you are the professional

    You're hitting your head against a brick wall because InDesign is not intended for such use.

    Rather, I complain on the other side, because it looks so limited word in the possibilities for me.

  • In fact, I need help but can't find the answer. Please... Lately when it is open a new tab it does not open with a blank page. I don't want to put my home page as

    In fact, I need help but can't find the answer.
    Please... Lately when it is open a new tab it does not open with a blank page. I don't want to put my home page as empty as when I open Firefox, it automatically load my hotmail page. But then if I open other pages I don't get a blank page. Help, please?
    Thank you.

    [Personal information deleted by the moderator. Please read the guidelines and rules of the Forum, thank you.]

    Hello, please refer to customize the page new tab to turn off the function.

  • How can I get the 'secure site' (padlock) icon to display when you access a web page secured with Firefox 4?

    The "secure" (lock) icon no longer appears on the status bar (or anywhere else I can find) when you go to a secure web page. How can I get the 'secure site' (padlock) icon to display when you access a web page secured with Firefox 4?

    You can add a 'lock' the b-I-S with this extension.

    https://addons.Mozilla.org/en-us/Firefox/addon/padlock-icon/

Maybe you are looking for