Free Support Forum - aspose.com

Inserting image in doc using aspos.doc

Hi,

I have breated an ASP.Net web applicatin and want to insert an image in its header. I Have installed aspos 10 for .NET and tried using the codes given in the demo section, but unfortunately its not workinb. Kindly plz provide me teh assistance in accomplishing the same, through codes. Its urgent.

Thank you.


This message was posted using Page2Forum from Aspose.Words for .NET - Documentation

Hello

Thanks for your inquiry. Here is simple code, which demonstrates the technique:

// Create an empty docuemnt and DocumentBuilder.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

// Move DocumentBuilder cursor into the primary page header.

builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);

// Insert image.

builder.InsertImage("C:\\Temp\\image.jpg");

// Save output document.

doc.Save("C:\\Temp\\out.doc");

Hope this helps.

Best regards,

Hello,

Ya its working well. Thanks a lot for your support :)