public InDesign.Document GetReportDocument(string templatePath) { InDesign.Application app = (InDesign.Application)COMCreateObject("InDesign.Application"); // get a reference to the current active document return((InDesign.Document)app.Open(templatePath)); }
/// <summary> /// Creates the InDesign Application Class and sets the default web options /// (UTF-8, optimize for browser, etc.) /// </summary> private void CreateInDesignAppClass() { if (m_inDesignApp == null) { object obj = COMCreateObject(INDD_COM_STRING); m_inDesignApp = (InDesign.Application)obj; InitializeFontTable(); m_log.Log("Create the " + INDD_COM_STRING + " successfully."); } }
public void CloseInDesignApp() { if (m_inDesignApp != null) { if (HasInDesignAppWindow()) { m_inDesignApp.Quit(InDesign.idSaveOptions.idYes); } else { m_inDesignApp = null; } } }
public void InitializeProvider() { var appType = Type.GetTypeFromProgID(InDesignProgId); application = appType != null ? (InDesign.Application)Activator.CreateInstance(appType) : null; }
public void ReopenInDesignApp() { m_inDesignApp = null; fontTable = null; CreateInDesignAppClass(); }