How to observe document setup changes

Hi everybody,
I'd like to observe any change on document setup (anything you can do in menu "File" -> "Document setup..."), such as orientation, document size, etc.
The first and only way I can see is, even I know this is not the good one, is intercepting the command kSetPageSetupPrefsCmdBoss (using
ICommandInterceptor).
But I'd prefer to use the clean way, I mean Observer. But I can't find what is the subject to observe :
Here's the signature of the method in ISubject
    void AttachObserver(IObserver* observer,
                                      const PMIID& interestedIn,
                                       const PMIID& asObserver = IID_IOBSERVER);
I know observer mechanism. I just can't find what I should observe to get what I am interested in.
And in a general manner, what is the best way to find the subject I am interested in (not only for document) ?

I finally found the solution:
Implement an IObserver:
IObserver documentObserver = InterfacePtr<IObserver>(::CreateObject2<IObserver>(kMyDocumentObserverBoss)) ;
Get the workspace UIDRef, and then the subject to observe:
UIDRef documentWorkspaceRef = document->GetDocWorkSpace();
InterfacePtr<ISubject> documentWorkspaceSubject(documentWorkspaceRef, UseDefaultIID());
Attach the observer when needed :
documentWorkspaceSubject->AttachObserver(documentObserver, IID_IPAGEPREFERENCES, IID_IOBSERVER);
The value I was looking for was initially IID_IPAGEPREFERENCES. I found it with spy in the debug version of InDesign.

Similar Messages

  • Document Setup size change-frame defaults to centering

    In ID CS3, by default I have my Reference Point set to the upper left. I often get a repeat layout that may have a size change. If I originally had a 3"x5" ad and the repeat calls for a 4"x7", I reset the document setup. The frame goes to the left (0 x coord) but centers itself vertically (0.5" y coord). In QuarkXPress, the frame (box) would go to the 0 x and y coordinates. This is how i'd like InDesign to behave. Any way to do that?

    Hi Chinna, thank you for this - this is great - apologies if i didn't make it clear but this displays the info as an alert, and i needed it to appear in the "PageSize" text variable field as per the text in my post. However i think I've managed to work it out (pasted below if you're interested), and it works a treat now, so thank you ever so much for all your help.
    var doc = app.activeDocument; 
    doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters; 
    doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters; 
    for(var i =0;i<doc.pages.length;i++)
        pagesize = app.activeDocument.textVariables.itemByName("PageSize"); 
    pagesize.variableOptions.contents = doc.pages[i].bounds[2] + "mm x " + doc.pages[i].bounds[3] + "mm"

  • When opening a pdf document in Adobe Reader the font of the original document is changed....It becomes a mix of the original font and a new different font. How can i fix this

    When opening a pdf document in Adobe Reader the font of the original document is changed....It becomes a mix of the original font and a new different font. How can i fix this

    This issue occurs with most of the PDFs that I open up. I am using the latest version of adobe reader on my windows based machine and it is a general PDF. I saw a similar post online stating that if you look at the fonts used in the document and it doesn't say (Embedded) next to it, then Adobe Reader will try to pull the font(s) from your computer and if it doesn't find that font then it will replace it which makes it look funny.

  • How do I make a change in a PDF document

    How do I make a change in a PDF document

    FYI
    Hi Marolyn Green,
    Thanks for subscribing to Acrobat Pro subscription (one-year). Here's a
    snapshot of your order and steps for getting started.    Subscription
    order details: Acrobat Pro subscription (one-year)Acrobat Pro
    subscription (one-year) (Mac/Win,Multiple Languages)  Subscription
    priceUS$19.99/mo TaxUS$1.77/mo TotalUS$21.76/mo   
    For complete details, just click your order number (AD016014360
    <http://www.adobe.com/go/account_orders_us> ) and log in with your Adobe
    ID ([email protected] <http://www.adobe.com/go/account_orders_us>
    ) and password.     Here's how to get started: Sign in to your Acrobat
    Pro subscription (one-year)  <https://cloud.acrobat.com/> account with
    your Adobe ID
    I did all of that but still I couldnot edit the document.
    I was prompted to subscribed to a program in order to do the editing in
    the PDF doument. I have adobe.  I paid $ 19+ and followed the
    instructions to download the program of which I did, but I just could
    not edit anything in the document.
    Please inform.

  • How to split the IDOCS based on document number change whit out BPM

    Hi all,
    Thanks,for giving the responce..
    Scenario:File to IDoc.
    Problum1 : How to Split the IDocs based on document number change in the source file with out BPM.My file contains document numbers like
    20000092
    20000092
    20000092
    50000050
    50000050
    50000065
    I want 3 IDocs in target system.i.e 1 for 20000092,20000092,20000092
                                                       2 for 50000050,50000050
                                                       3 for 5000006
    By using external definations i am getting 6 IDOCs insted of 3.
    Problum 2:Is there any chnges/modifications in Directory when we are using external definations.
    Could u plz provide me the step by step process(Repository/Directory) with using of external definations.
    Thanks in advance.
    Regards,
    KP

    HI,
    for this no need of BPM.
    You can think of Idoc bundling concept to acheive this-just you need to do the external definition to change the idoc occurence
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    to achieve for each document no, one idoc, you can write small user defined function in the mapping with context handling you an achieve this.
    For this e.g
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6bd6f69a-0701-0010-a88b-adbb6ee89b34
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
    Regards,
    Moorthy

  • If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    >my indesign file is a web file
    Pardon?
    Or do you mean that, when you created a new document, you choose Web as intent maybe?

  • Cannot change units in "Preferences" panel or "Document Setup"

    PC, Windows 7, AI CC
    I have a document that displays units in points, and when I change the unit type to inches in the preferences panel and the Document Setup panel, the change won't apply.
    I've tried saving as a new document, restarting, etc. I even tried setting the units to other units... doesn't matter what I have the units set to in preferences, it's always displaying points.
    Any thoughts?

    alpinemice,
    What happens if you create a new document and try to use inches in that?
    If it works, what happens if you copy everything from the troublesome one into the new one (you may need to tick Paste Remembers Layers in the Layers palette first, and untick afterwards)?

  • InDesign crashing when changing Document Setup

    Hi
    I have an 75 page InDesign file with some text and placed files
    When I make any changes in the Document Setup dialog, (Pg Sz, Facing Pages etc) InDesign crashes with the following message:
    I exported to IDML, but that didn't help either
    Any suggestions?
    I'm running CS6 on Mac OSX Mountain Lion
    This only happens to this file - other files are ok
    Thanks
    David

    I think maybe the style itself is corrupt. The next thing I would try is creat a new file (blank) and in that file define a new style with the exact same name (case sensitive) and then import the style into the other file using Load All Text Styles from the paragraph styles panel menu.
    I'm not certain that's going to work though, so be prepared to export the text to InDesign Tagged Text, then make yet another new file. Recreate (or load from that other new file) any styles that are causing a problem, then place the tagged text. You can work from there in the new file, or you can go back to the original, delete the offending style (leaving the text without a style), then copy the newly placed text in the new file and paste it into the original to replace what's there and restore the style assignments. You might want to do all of that on a copy, by the way, just for safety.

  • How can I stop Firefox 4 from displaying "The document cannot change while Printing or in Print Preview" from appearing every time I click on File/Page Preview?

    Clicking on File/Page Preview in Firefox 4 brings up a warning dialog "The document cannot change while Printing or in Print Preview" every time. How can I stop this from happening? It is very annoying, and it is necessary to click "OK" on this dialog twice before it will go away. Thank you.

    Does it behave that way in [[Safe Mode]] ?
    If it doesn't, then one of your add-ons in the culprit.

  • How to download a web document and change to pdf format

    i have tried downloading a web form which requires printing but in order to print, i need to download it and change it to a pdf format for my printer, but when i try downloading the web form, it downloads as a picture. How do i download it as a document and change it to pdf?

    Generally all you should have to do is select what you want to copy (and copy it) and paste it into Pages.

  • Change document setup by adding 1/2 inch on the left

    Hi,
    I am working on a 8 1/2 X 11 document  (36 pages) and I would like to add 1/2 inch but only on the left side. Of course, I could just change my document set up for 9 X 11 but then, I have to reposition my elements to the right wich I would like to avoid.
    Is there a way to do that?

    Yo don't say if this is a facing pages document, but I'd guess not if you only want to add to one side. You should change the document setup, but it would be possible to do this by adjusting the bleed settings at output, which I really don't recommend as it's likely to be forgotten at some point.
    If your text frames are snapped to the margin gides this should be relatively painless. Before making any adjustments go to Layout > Layout Adjudtment... and turn it on. With Layout Adjustment active frames that are snapped to guides should resize or reposition to match the new guide positions. You can now change the page size, then go the the master page to adjust the margins to where you want them to restore the text block to the original size.

  • How can i view track changes in an emailed document?

    ihave been trying all means that i know of in my meagre knowledge of ssoftwares to try and view a document having changes made to it that was emailed to me,but have failed miserably.will someone be kind enough to shed some light on this issue,and whether its even possible or not to do the above on the ipad2.if not i seem to have bought a toy and not a business tool......................

    This sounds like an issue with the app and compatibility so this would need to be directed to the developer
    For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.   Richard P. Feynman

  • How do I center the header in document setup?

    I write books and want the title of my book to appear automatically on each page and centered.  When I go to Document Setup I don't find an option for centering.  I shouldn't have to force with spaces my book title to the center.  Where are the setup features with font style, size, center, left, right, etc?

    Ok.  I figured it out.  The problem had to do with the fact that I started the book using an older version of Pages on my Mac Pro and sent it to myself then added it to my iPad.  Once there I update, edit, add-to the story then iDisk the update so I have the most current version.
    To solve the problem I went into the iPad and called up the story in Pages, copied it into memory then created a new blank document.  There I went to the Page Settings and the header/footer were quite visible, including the three cells.  In the header I added the title of the book.  In the footer I added the Page 1 of X, hit Done and returned to the blank page.  I then pasted in the entire book. 
    Now all are fine.  The title header is centered and I have very nice page numbers.
    Thanks for the tip!

  • I back up my iphone onto itunes on my laptop. I've now got a new laptop, which counts at two locations. This new laptop had to be setup again. Apple says this is three locations. How can I get it changed to two locations?

    I backup my iphone onto itunes on my laptop. Recently I got a new laptop, so that counts at two itunes locations.
    Unfortunately this new laptop was faulty and had to be set up again from scratch.
    Apple now says that's three itunes locations when in fact it's two.
    How can I get this changed back to two locations?

    If by locations you mean "authorized computers" then one of your computers (apparently the new laptop) may be using multiple authorizations.
    To check on this and correct see here: http://support.apple.com/kb/HT1206

  • How to get value of MA attributes on Contract Document phase change script

    Hi,
    I need to get value of Master Agreement attributes on Contract Document phase change.
    When Contract document phase changes to Supplier Draft, I want values of Master Agreement - Publish date, vendor visible, email.
    But I am unable to retrieve the same.
    I wrote IBean code to get but was not working.
    Please help me resolve this issue.
    Thanks,
    Saloni

    Hi Saloni,
    There is nothing different that you should do for this script.
    Use the getParentIBean() function on Contract Document to get the parent MA/SA. From there on it is as simple as using the correct getters to fetch the values.
    Hope this helps.
    Thanks
    Devesh

Maybe you are looking for

  • Reinstall

    I'm trying top reinstall Office Home and Student 2010 following a loss of program after a clean boot.  I'm told Outlook is not updated.  An attempt to install Outlook was unsuccessful.  I do have Live Mail.  Help

  • Broadcom 802.11ac Windows 8.1 won't connect to wifi router

    I'm using a asrock z87E-ITX with Broadcom 802.11ac wireless adapter, and windows 8.1 my wireless adapter won't connected to my zte f660 wireless router, but it's connected to any mobile phone thetered device. The problem is when i try to connect, the

  • IPod classic - Wheel doesn´t react???

    Use possible only with the control of my stereo dock. Reset and a new installation doesn´t work. The wheel ist dead..... Something else I can try??? Best from Berlin

  • User Accerss to InfoView Folder Structure

    I have a general question on InfoView. I have an installation that will have 30 folders containing standard reports for 30 different groups. I need to allow users to view only the folder that pertains to their group and not any other. I donu2019t wan

  • Oracle reports 6i Bug

    Hello, In Oracle Reports Builder : suppose you have two queries, Department and employe thus two groups DEPT_GROUPE and EMP_GROUP. If you link the two queries using DEPT_ID : The link will be well generated between the queries (the linked columns are