• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Open indd file in c#

New Here ,
May 09, 2018 May 09, 2018

Copy link to clipboard

Copied

Can I open a indd file whitin c# and print/make a pdf of it´s content? I`ve installed VS2010 and InDesign aswell. I have a reference to "Adobe InDesign CC 2018 Type Library" in Visual Studio. My code is asfollows.

using InDesign;

            // Create application instance

            Type type = Type.GetTypeFromProgID("InDesign.Application");

            Application application = (Application)Activator.CreateInstance(type);

Then I get the error message: {System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'InDesign.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{ABD4CBB2-0CFE-11D1-801D-0060B03C02E4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Is it possible to do what I´m trying to do?

TOPICS
Scripting

Views

2.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2018 May 09, 2018

Copy link to clipboard

Copied

Hi Jonas:

I'm going to move this over to the InDesign Scripting forum for you.

~Barb

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2018 May 09, 2018

Copy link to clipboard

Copied

Can I follow the answer in this forum or must I change forum?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2018 May 09, 2018

Copy link to clipboard

Copied

Hi Jonas:

You don't have to do a thing. This is already in the Scripting forum—any responses will appear directly below our exchanges.

~Barb

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 09, 2018 May 09, 2018

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2018 May 09, 2018

Copy link to clipboard

Copied

I feel like I´ve miss something in my installation. Is it correct to just install InDesign CC and VS2010 sp1. Then make a reference in VS2010 to "Adobe InDesign CC 2018 Type Library". Is that all or do I need to install some SDK or CS6 kit???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 10, 2018 May 10, 2018

Copy link to clipboard

Copied

LATEST

I have 0 experience with c# so I can't help with the specifics but I have scripted InDesign as a COM object. You shouldn't have any problem with it.

Did you try regenerating the .tb file?

Try creating the COM object by path and not ID see if that works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines