I want to create a simple document with 2 pages?

I want to make my plugin to create a simple document, as soon as my Plugin is loaded into Indesign. I have my IStartupShutdownService derived class so that it is called on startup.

But this fails to line 23 below.

What else should I include in my .fr file?

class LTestStartupShutdownServiceImpl : public CPMUnknown<IStartupShutdownService>
{
public:
    LTestStartupShutdownServiceImpl(IPMUnknown* boss);
    virtual ~LTestStartupShutdownServiceImpl();
    virtual void Startup();
    virtual void Shutdown();
};


CREATE_PMINTERFACE(LTestStartupShutdownServiceImpl, kLTestStartupShutdownServiceImpl)


LTestStartupShutdownServiceImpl::LTestStartupShutdownServiceImpl(IPMUnknown *boss):CPMUnknown<IStartupShutdownService>(boss)
{
    do
    {
        const PMReal width=612, height=792;
        const int32 numPages=5, numPagesPerSpread=1;


        // Create the command.
        InterfacePtr<ICommand> newDocCmd(Utils<IDocumentCommands>()->CreateNewCommand());  //<-----this is coming null and failing
        ASSERT(newDocCmd);
        if (newDocCmd == nil)
            break;
        // Set the command's parameterised data.
        InterfacePtr<INewDocCmdData> newDocCmdData(newDocCmd, UseDefaultIID());
        ASSERT(newDocCmdData);
        if (newDocCmdData == nil)
            break;
        newDocCmdData->SetCreateBasicDocument(kFalse); // Override the following defaults.
        PMPageSize pageSize( width, height);
        newDocCmdData->SetNewDocumentPageSize(pageSize);
        bool16 bWide = kTrue; // landscape orientation.


        newDocCmdData->SetWideOrientation(bWide);
        // Size margin proportional to document width and height.
        PMReal horMargin = width / 20;
        PMReal verMargin = height / 20;
        newDocCmdData->SetMargins(horMargin, verMargin, horMargin, verMargin);
        newDocCmdData->SetNumPages(numPages);
        newDocCmdData->SetPagesPerSpread(numPagesPerSpread);


        // Create the new document.
        CmdUtils::ProcessCommand(newDocCmd);


    }
    while (false);
}


LTestStartupShutdownServiceImpl::~LTestStartupShutdownServiceImpl()
{}
void LTestStartupShutdownServiceImpl::Startup()
{}
void LTestStartupShutdownServiceImpl::Shutdown()
{}

Here's the file .fr:

/* 
 * Boss class definitions.
 */
resource ClassDescriptionTable(kSDKDefClassDescriptionTableResourceID)
{{{


 Class
  {
  kLTestStartupShutdownServiceBoss,
  kInvalidClass,
  {
  // Implementation of IStartupShutdownService
  IID_ISTARTUPSHUTDOWN, kLTestStartupShutdownServiceImpl,
  // Implementation to IK2ServiceProvider to identify the service type as startup-shutdown
  IID_IK2SERVICEPROVIDER, kLTestStartupShutdownServiceImpl,
  }
  };
}}};

I think that it is not possible to document related handling during the power on/off. You can try kLazyStartupShutdownProviderImpl for IK2SERVICEPROVIDER?

Tags: InDesign

Similar Questions

  • Creating a PDF document with visible bookmarks

    Hello.

    I use VB to create a PDF document with bookmarks. I have no problem with that part.

    What I want to do, however, is to program the document so that the Bookmarks pane is visible when I open the document.

    Any ideas?

    All the best,

    Ethan

    I found the answer to the Communication monitor QAnywhere:

    Dim SetPageMode as Boolean = PDDoc.SetPageMode (nPageMode),

    where nPageMode is the possible values:

    0: leave the display mode is

    1: display without bookmarks or thumbnails

    2: display using thumbnails

    3: display using bookmarks

  • If I have a document with 3 pages and I just want to save page # 2 How can I do?

    If I have a document with 3 pages and I just want to save page # 2 How can I do?

    Need you the full version of Adobe Acrobat (not not to be confused with Acrobat Reader) extract pages.

  • HP Officejet 6500 a how to scan a document with several pages in a single file?

    HP Officejet 6500 a Plus e-All-in-One - E710n

    Windows 7 (64-bit)

    How to scan a document with several pages in a single file?  After each scan, my old printer (psc 2110) asked if I wanted to scan another page.  In the end, I got a PDF with multiple pages.

    This new creates a file for each page, and I can't find a way to create a PDF with multiple pages.

    Hi mpw101,

    You must press the Add/Remove button, to add pages additionla scanned to the existing file. If you do not see this button try decreasing the analysis DPI setting. Let me know if this helps you?

  • How do scan you a document with several pages using Lexmark printer/scanner

    I have problems I scan a document with multiple pages. I want to scan to open in a single document and not having to open each page.
    Thank you

    You will need to consult the documentation for the printer.

  • How to create a new project with other page with the new version of Muse layouts?

    Hello
    If someone would continue to operate as before with the inadmissible Muse version... is - this posible to have both versions installed? or how to create a new project with other page with the new version of Muse layouts?
    Or how to download third party) 3 different configurations (desktop/tablet/mobile) under the same url with a clean result, like up yet with the Muse does not?

    Thanks for any help,

    Patrick

    Use the new version! What you want to achieve, will work! Go to the 'Page' menu and choose 'Add another Layout' and the missed buttons are in plan view.

  • How can I scan a document with mutiple pages into a single file?

    Hello

    I have a HP 3070 and Windows Vista. The printer and scanner are properly configured. But there's something that intrigues me:

    How can I scan a document with mutiple pages into a single file?

    I start the HP scanning software and choose pdf or tif format. The analysis of the option of single file for each page is unchecked. Once I scanned the first page it has no option to scan additional pages? I got back, save and

    Thanks in advance

    Hello

    The HP software disables scanning multipage when the resolution is greater than 300 dpi. The resolution of the issue is to reduce equal to or less than 300 dpi scanning resolution.

    Thanks and greetings

  • I want to create an iPad app with several issues of the magazine even inside

    I want to create a digital magazine for iPad. With Digital Publishing Suite, I know that I can create apps for iPad.

    But there is a problem. Is not clear in the website if with simple editing, I can create an app that contains all issues of the magazine, or if I need to create a new application for each issue of the magazine I want to publish.

    Could you please get out me of doubt?

    Please, I need a quick answer. Thanks in advance!

    This should help:

    http://boblevine.us/Digital-Publishing-Suite-101-single-Edition-vs-multi-Folio-apps/

  • It is possible to create a simple paint with common tools CC Flash application?

    Tools:

    Aligns,

    Shadow

    BUR...

    Create the object

    Transformation tool?

    Geometric design.

    Painting surfaces with a texture

    Alpha...

    Effects of images.

    Export to the format of many

    Just the right things, we can find another Flash animation thing.

    No timelime.

    No interpolation.

    No video editing.

    A tool for everyone. Much better than MS Paint with a minimum of tool and affordable to a wide audience.

    I am now using Flash CC just to make images, such as Photoshop and illustrator, it's too much for my little use. And Flash is pretty simple if you do not use the features of Action Script or animations.

    Yes, it is possible to create a simple drawing program, but...

    1. you would not be able to save your work (unless it's an Air application).

    2. why? There are already many free paint there, programs of MS Paint to Paint.NET.

  • I want to create a new document in Illustrator that I can use for Print and Web - using 2 different colourspaces.

    Is it possible to do?  I need to create a document so that I can export under a high quality CMYK to print and export the same file in RGB jpeg / pdf for web and e-mail use.  What I do need to create the document with 2 different colourspaces, or can I edit / convert the colourspace after that I created and finished the document?  or is it possible simply to select a RGB / CMYK option during export record?

    looking forward to your response!

    Tom

    Tom,

    The best way is to creat and finish the document CMYK for printing, and then save a copy (or avoid something similar and safe save them on the original of the document CMYK) and turn that into a separate RGB for the web and other document.

  • Ilustrator freezes creating a new document with web profile.

    Hello

    I have the instalation of membership cloud creative Illustrator and whenever I create a new document and in the drop profile, select 'web', Illustrator is frozen forever.

    I'm using the mac version in a macbook pro 13 "corei7 with 8gigs ram.

    http://forums.Adobe.com/message/4505464#4505464

    Solved!

  • Creating a new document from existing pages

    It must be a feature in InDesign that allows you to create a new document using the selected pages in an existing document without having to remove unwanted, pages as when you create a document "save under".  And also the possibility to create existing master pages.

    It is already there. At least somehow.

    Create a new document of the same dimensions of the former, with a blank page. Then, in the old document, select them pages you want and in the Pages menu, choose move Pages.  You can then select the new document to move pages to and make sure to remove Pages after that moving is not selected.

  • latest version of Adobe Muse 2015.1:can use scroll effects (parallax scrolling) to create sensitive political sites with flexible page width?

    Greetings! Tell me please, when new, the latest version of Adobe Muse 2015.1 can use the scroll effects (parallax scrolling) to create sensitive political sites with a flexible page width?

    Re: Effects of scrolling in Muse CC 2015

  • How can I create a 'master' document with multiple variations?

    I designed a card that will be displayed to the few dozen intersections with a symbol 'you are here '.  Everyone will be identical except for this symbol.  I don't know if there is a way to do everything while preserving a 'master' card which can be changed at a time.  For example, maybe I need to change the location of the paths, and it would be a real time saver if I didn't have to edit files 20 + (each with an arrow in another spot but otherwise the same) separately.  Also, I'll send the file by e-mail to a professional printer, so I am very uncertain about what would be a standard way to format something like that and don't really want to clog their e-mail.

    I was not able to determine an easy way to do it.  I wonder if it involves the use of several work plans, a feature that I'm not very familiar with, or if it is easiest to have a layer for each location of the symbol and just save twenty records (phew) and send to the printer in the form of separate documents - which seems super awkward.

    I tried to copy the plan of work several times.  It was my best attempt of editing at the same time: I created what I needed on a workplan, dragged to the symbols Panel, then cut, then went to edit > paste on all work plans.  However, this does not simply play with a trace or an object that already exists and I can't understand how I would delete the same object of all work plans.

    If anyone has some ideas, I'm pretty novice, so please keep in simple terms. Also, I'm in a bit of a lack of time, so quick responses are much appreciated!  Thank you!

    If you save a PDF file, you can include layers (just check the box in the second save dialog box) that can be turned on or off allowing a single file in order to have all the data. You are going to have these printed in a professional manner?

  • Want 5300: Printing does not print this document with several pages

    I had a printer Envy 5530 for Christmas last year. It has worked fine until recently and now when you try to print a multiple-page document or excel spreadsheet to my laptop, it will no print some pages and then stops mid page and springs and incomplete page and a Virgin. I tried to uninstall and reinstall the print, I used the HP Print & Scan doctor but still have the same problem. Sometimes, when you try to print a single page it will stop in half way through and pull the incomplete page printing. I use the wireless on the computer laptop and printer.

    Any suggestions on why it does this and how to solve the problem?

    Hi BKP513,

    I would suggest the following steps in the following order:

    I hope this works!

    "Please click the Thumbs up icon below to thank me for having responded."

Maybe you are looking for

  • Speed of CPU on XP-implementation to date 7020CT

    Hello; I managed to install XP - Pro on a Portege 7020CT but the CPU runs at half speed (190 MHz) unless I have change the BIOS to the performance setting. Problem is that the fan, then stay on continuously which is very annoying. Changing the settin

  • Download pdf files open in wordpad and can not be read

    After downloading some files open in wordpad and they cannot be read.they appear as a sort of code.this that happens with both text and photo files.i can't find another application to try to open them in.

  • How to remove the account from microsoft answers

    How can I delete my account Microsoft Answers? Is there a way ? I just need to ask a question (it is now the second issue), and I no longer need! Please answer if you know the answer, or if you have an idea how you can delete it. Thank you!

  • I'm not able to access the help and support on my xp based computer.

    I have Windows XP Home Edition. I deleted some old programs using Add / Remove button in the control settings.  Also installed an antivirus program.  I noticed that the I help support button is unresponsive and I'm not able to access the system resto

  • Cannot install software HP7310 for Windows 7 - error: unable to extract the files

    Hello I want to reinstall the software for my Officejet HP7310 on my Windows 7 Ultimate 32 of company laptop computer bits. I download the software from HP.com site: AIO_CDB_Net_Full_Win_WW_130_141.exe. Try to install it, the extraction of files stop