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. Image for the cookie policy date
close icon

Import excel data to pdf

Hello,  i want to imort only a specefic range of excel cell data into PDF. Please help me how can i accomplish it. Is there any utility available in Syncfusion to fullfill this requirment ?


Kind Regards,
Awais Afzal.

1 Reply

DB Dilli Babu Nandha Gopal Syncfusion Team November 6, 2015 05:09 AM UTC

Hi Awais

Thank you for contacting Syncfusion support.

In XlsIO, you can convert the specific range in a worksheet to PDF by setting a print area using PrintArea property of IPageSetup. This behavior can be achieved by using the following code example.

Code example
IWorksheet worksheet = workbook.Worksheets[0];
// Setting the PrintArea for the worksheet.
worksheet.PageSetup.PrintArea = "$A$1:$E$5";
ExcelToPdfConverter converter = new ExcelToPdfConverter(worksheet);
PdfDocument pdf =  converter.Convert();
pdf.Save("PrintArea.pdf");

We have shared a sample for your reference which can be downloaded from the following link.

Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/PrintAreaToPDF1074774529.zip

You can also refer to our UG documentation to know more about PrintArea property.
UG Documentation link: http://help.syncfusion.com/windowsforms/xlsio/working-with-excel-worksheet#page-setup-settings

Regards,
Dilli babu


Loader.
Live Chat Icon For mobile
Up arrow icon