65.9K
CodeProject is changing. Read more.
Home

Use Adobe's Indesign COM in asp.net application with automatic publication flow

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.75/5 (9 votes)

Apr 10, 2007

CPOL
viewsIcon

43785

downloadIcon

1025

This Article represents that .net based application which is used in web based publication work flow with the use of XML and indesign file

Introduction

This code is use ful for automatic publication flow with the use of desing and xml templte with the support of Indesing (An Adobe's tool).

Background

use this application need to indesign and indesign SDK need to be installed on your Machine...
and then need to add indesign related reference of indesign(COM)

Using the code

Use this application need to indesign and indesign SDK need to be installed on your Machine... and then need to add indesign related reference of indesign(COM).

Here with applicatin three files 1. Indd this is design template and 2. XML that is xml tempate... we can change any data with same structure and import it and we can generate its PDF..3. Image file which is used in Indd file and its path was specifiled in XML file here indd and xml file are attched by use of indesign tool....

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

InDesign.Application objInDesign = 
  (InDesign.Application)Activator.CreateInstance(indAppType, true);

InDesign.Document objDoc = 
  (InDesign.Document)objInDesign.Open(cstrInddFile, false);

For this line activate indesign application ..

This is for importing an XML file....

objDoc.ImportXML(cstrXMLFile);

//this is used for get presets which is used to export PDF..
//if not availble the create Preset and give name at here....
//InDesign.PDFExportPreset objPreset = 
//   (InDesign.PDFExportPreset)objInDesign.PDFExportPresets.LastItem();

//this code is used for final PDF
objDoc.Export(idExportFormat.idPDFType, cstrOutputFile, false, 
              objInDesign.PDFExportPresets["Press"]);
              //works fine

Points of Interest

This is the one simple basic work flow for automatic publication flow... we can also implement so many functionality with use of Indesing.