We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert document to image

I am converting document into image

I wanted to put document name on images on top

how can I do this?
I want to convert all office document, pdf, .msg etc. to image


This message was posted using Email2Forum by Tahir Manzoor

Below is the code snippet supplied by Tahir Manzoor:


var doc = new Aspose.Words.Document(Path);
var builder = new DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.Write(“SOMETEXT”);

It is working perfectly in case of word document, I want same code snippet for Excel and Visio.


Hi,

You can use the code from Setting Headers and Footers for Excel documents. We are also looking for a similar solution for Visio diagrams and will update you soon.

Best Regards,

Hi


Thank you for your inquiry about Aspose.Diagram API. Please note that during the print preview of Visio drawing, you can click on “Edit Header & Footer” link button in Microsoft Visio 2013 (in Microsoft Visio 2010 >> “Header & Footer” button). There are a few options to add text as shown in the attached screenshot “Screenshot.png”. We can manage these properties using Aspose.Diagram API as follows:

[.NET, C#]

Diagram diagram = new Diagram(@“c:\temp\MyDiagram.vsd”);

// add page number at the right corner of header
diagram.HeaderFooter.HeaderRight = “&p”;

// set text at the center
diagram.HeaderFooter.HeaderCenter = “Center of the header”;

// set text at the left side
diagram.HeaderFooter.HeaderLeft = “Left of the header”;

// add text at the right corner of footer
diagram.HeaderFooter.FooterRight = “Right of the footer”;

// set text at the center
diagram.HeaderFooter.FooterCenter = “Center of the footer”;

// set text at the left side
diagram.HeaderFooter.FooterLeft = “Left of the footer”;
// set header & footer color diagram.HeaderFooter.HeaderFooterColor = Color.AliceBlue;
// set text font properties diagram.HeaderFooter.HeaderFooterFont.Italic = BOOL.True; diagram.HeaderFooter.HeaderFooterFont.Underline = BOOL.False;

// save Visio diagram diagram.Save(@"c:\temp\Output.vdx", SaveFileFormat.VDX);

We hope, this helps. Please feel free to reply us in case of any confusion or questions.