Allows to specify which custom sheets and cells will be exported into PDF, Word

Namespace:  SautinSoft
Assembly:  SautinSoft.ExcelToPdf (in SautinSoft.ExcelToPdf.dll) Version: 4.0.2.29

Syntax

      
 C#  Visual Basic 
public class PrintedArea
Public Class PrintedArea

Members

         
 All Members  Constructors   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
ExcelToPdf..::.CSheet..::.PrintedArea()()()
Creates a new instance of ExcelToPdf..::.CSheet..::.PrintedArea class
All()()()
Mark all sheets and cells in workbook to export into PDF, Word
All(String, String)
Set single area to export in PDF, Word for all sheets in workbook
All(Int32, Int32, Int32, Int32)
Set single area to export in PDF, Word for all sheets in workbook
Custom(array<Int32>[]()[], String, String)
Adds custom area to export in PDF, Word
Custom(array<Int32>[]()[], Int32, Int32, Int32, Int32)
Adds custom area to export in PDF, Word by row/column numbers

Remarks

Examples

CopyExport to PDF only custom area from sheet in C#
using System;
using System.IO;
using SautinSoft;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            // Specify sheets and cells for converting.
            ExcelToPdf x = new ExcelToPdf();
            x.PageStyle.PageSize.Letter();

            // Set PDF as output format.
            x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf;

            // Let's convert only rectangle from "B6" to "C9" on sheet 1.            
            x.Sheets.PrintArea.Custom(new int[]{1}, "B6", "C9");

            string excelFile = Path.GetFullPath(@"..\..\..\..\test.xls");
            string pdfFile = Path.ChangeExtension(excelFile, ".pdf"); ;

            try
            {
                x.ConvertFile(excelFile, pdfFile);
                System.Diagnostics.Process.Start(pdfFile);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }

        }
    }
}
CopyExport to PDF only custom area from sheet in VB.Net
Imports System
Imports System.IO
Imports SautinSoft

Module Sample

    Sub Main()
        ' Specify sheets and cells for converting.
        Dim x As New ExcelToPdf()
        x.PageStyle.PageSize.Letter()

        ' Set PDF as output format.
        x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf

        ' Let's convert only rectangle from "B6" to "C9" on sheet 1.            
        x.Sheets.PrintArea.Custom(New Integer() {1}, "B6", "C9")

        Dim excelFile As String = Path.GetFullPath("..\..\..\test.xls")
        Dim pdfFile As String = Path.ChangeExtension(excelFile, ".pdf")


        Try
            x.ConvertFile(excelFile, pdfFile)
            System.Diagnostics.Process.Start(pdfFile)
        Catch ex As Exception
            Console.WriteLine(ex.Message)
            Console.ReadLine()
        End Try

    End Sub
End Module

Inheritance Hierarchy

System..::.Object
  SautinSoft..::.ExcelToPdf..::.CSheet..::.PrintedArea

See Also