Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2007-12-17 06:14:42

bhaskar_joardar
Member
Registered: 2007-12-17
Posts: 0

Adding Text to Textframe with C#.NET

Hi, I am developing an indd file programatically with C#.NET. I am importing an XML successfully and want to design the indd file with the value of the XML. The problem is that I am not being able to write the values to the textframe. I have the indesign CS3 trial version installed in my computer. Here is the code below.
Type indAppType = Type.GetTypeFromProgID("InDesign.Application");
InDesign.Application myInDesign = (InDesign.Application)Activator.CreateInstance(indAppType, true);
InDesign.Document myDocument = myInDesign.Documents.Add(true, myInDesign.DocumentPresets[1]);

InDesign.Page myPage = (InDesign.Page) myDocument.Pages[1];
myDocument.ImportXML(Server.MapPath("Indesing-doc/bhaskar.xml"));
        InDesign.Rectangle myRectangleA = myPage.Rectangles.Add(myDocument.Layers[1], InDesign.idLocationOptions.idUnknown, myPage);
myRectangleA.GeometricBounds = new string [4] {"70pt", "70pt", "180pt", "500pt"};
InDesign.TextFrame textFrameA = myRectangleA.TextFrames.Add(myDocument.Layers[1], InDesign.idLocationOptions.idUnknown, myRectangleA);
textFrameA.GeometricBounds = new string[4] { "80pt", "80pt", "140pt", "450pt" };

/*
Here I want to add my text in the textFrameA and want to fill the myRectangleA with the Orange colour. Please help me. Or if you can show me the way to associate the textFrameA  or myRectangleA with the element of the XML, that will also be helpful.
*/

myDocument.Close(idSaveOptions.idNo, Server.MapPath("testing"));


My Product Information:
LiveCycle Designer Pro 8.1 / Windows

Offline

 

#2 2007-12-17 20:16:04

thomp
Member

Registered: 2007-04-23
Posts: 1027

Re: Adding Text to Textframe with C#.NET

I hate to tell you this Bhaskar, but this forum is only for Acrobat JavaScript questions.  There are many fine InDesign forums, try:

http://www.adobeforums.com/

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in