Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

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

0.00/5 (No votes)
9 Apr 2007 1  
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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here