Allows to set scale produced document

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

Syntax

      
 C#  Visual Basic 
public class CPageScale
Public Class CPageScale

Members

      
 All Members  Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
Auto()()()
FitByHeight()()()
FitByWidth()()()
Percent(Int32)
ScaleByHeight()()()
ScaleByWidth()()()
ScaleToOnePage()()()

Examples

CopyFit each sheet to a single PDF page fixed size in C#
using System;
using System.IO;
using SautinSoft;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            // Fit each sheet to a single page fixed size
            ExcelToPdf x = new ExcelToPdf();

            //Fit each sheet to single PDF page, A4 format.
            x.PageStyle.PageSize.A4();
            x.PageStyle.PageScale.Auto();

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


            string excelFile = Path.GetFullPath(@"..\..\..\..\test.xlsx");
            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();
            }

        }
    }
}
CopyFit each sheet to single a PDF page fixed size in VB.Net
Imports System
Imports System.IO
Imports SautinSoft

Module Sample

    Sub Main()
        ' Fit each sheet to a single page fixed size
        Dim x As New ExcelToPdf()

        'Fit each sheet to single PDF page, A4 format.
        x.PageStyle.PageSize.A4()
        x.PageStyle.PageScale.Auto()

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


        Dim excelFile As String = Path.GetFullPath("..\..\..\test.xlsx")
        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..::.CPageStyle..::.CPageScale

See Also