We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Resize Image

Thread ID:

Created:

Updated:

Platform:

Replies:

102690 Feb 22,2012 01:52 AM Feb 23,2012 05:35 AM ASP.NET Web Forms (Classic) 1
loading
Tags: PDF
Sudhanva
Asked On February 22, 2012 01:52 AM

Hello

I am using Syncfusion ver 9.4.I want to add the logo in word header document.The image which i am inserting should be 100*100 size.The image is displaying in original size.I want to resize original image to 100*100 size.Please provide me a sample code to resize image in header using AppendPicture().
regards,
Sudhan

Code is attached below

IWParagraph headerPar = new WParagraph(doc);
// Add a new table to the header
IWTable table = section1.HeadersFooters.Header.AddTable();
RowFormat format = new RowFormat();

// Setting Single table border style.
format.Borders.BorderType = Syncfusion.DocIO.DLS.BorderStyle.Single;
headerPar = new WParagraph(doc);

IWTextBox textlogo = headerPar.AppendTextBox(100, 80);
textlogo.TextBoxFormat.LineColor = System.Drawing.Color.White;
textlogo.TextBoxBody.AddParagraph().AppendPicture(Image.FromFile(txtTemplate2.Text));


Poornima R [Syncfusion]
Replied On February 23, 2012 05:35 AM

Hi Sudhan,

Thank you for your interest in Syncfusion Products.

Regarding your requirement of “Resizing the picture”, you can utilize Height and Width property if the WPicture class as in the below code. We have also prepared the sample illustrating the same. Please find the sample from the below link. Try running the sample and let us know if this meets your requirement.

Code snippet:
IWPicture picture = textlogo.TextBoxBody.AddParagraph().AppendPicture(Image.FromFile(txtTemplate2.Text));
//Set picture height
picture.Height = 100;
//Set picture width
picture.Width = 100;

Sample:
http://www.syncfusion.com/downloads/Support/DirectTrac/90903/Sample-1433274898.zip


For more information about picture formatting, please refer the below online documentation link.
http://help.syncfusion.com/Ug_101/Reporting/DocIO/ASP.NET/default.htm#!documents/44141picture.htm

Please let us know if you have any questions.

Regards,
Poornima





CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;