Allows to set page size for output PDF document

Namespace:  SautinSoft
Assembly:  UseOffice (in UseOffice.dll) Version: 4.3.12.15

Syntax

      
 C#  Visual Basic 
public class CPageSize
Public Class CPageSize

Members

         
 All Members  Constructors   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
UseOffice..::.CPageStyle..::.CPageSize()()()
Creates an instance of UseOffice..::.CPageStyle..::.CPageSize
A3()()()
Set A3 page size, 297 x 420 mm, 11.69 x 16.54 In
A4()()()
Set A4 page size, 210 x 297 mm, 8.26 x 11.69 In
A5()()()
Set A5 page size, 148 x 210 mm, 5.82 x 8.26 In
A6()()()
Set A6 page size, 105 x 148 mm, 4.13 x 5.82 In
Auto()()()
Set default page size
B5Iso()()()
Set B5Iso page size, 176 x 250 mm, 6.93 x 9.83 In
B5Jis()()()
Set B5Jis page size, 182 x 257 mm, 7.16 x 10.11 In
B6()()()
Set B6 page size, 128 x 182 mm, 5.04 x 7.16 In
Executive()()()
Set Executive page size, 184 x 267 mm, 7.25 x 10.5 In
FitToPagesTall(Int32)
Sets the number of pages tall the worksheet will be scaled to when it's printed. Applies only to Excel worksheets.
Folio()()()
Set Folio page size, 210 x 330 mm, 8.26 x 12.99 In
HeightInch(Single)
Set page height in inches
Heightmm(Single)
Set page height in mm
Legal()()()
Set Legal page size, 216 x 356 mm, 8.5 x 14 In
Letter()()()
Set Letter size, 216 x 279 mm, 8.5 x 11 In
Oficio2()()()
Set Oficio2 page size, 216 x 330 mm, 8.5 x 13 In
Statement()()()
Set Statement page size, 140 x 216 mm, 5.5 x 8.5 In
WidthInch(Single)
Set page width in inches
Widthmm(Single)
Set page width in mm

Remarks



Examples

CopyHow to convert a HTML file to a PDF file in C#
using System;
using System.IO;
using System.Collections;

namespace Sample
{
    class Test
    {

        static void Main(string[] args)
        {

            //Convert HTML file to PDF file
            //If you need more information about UseOffice .Net email us at:
            //support[at]sautinsoft.com        


            SautinSoft.UseOffice u = new SautinSoft.UseOffice();

            //Path to any local file
            string inputFilePath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(),@"..\..\..\..\..\..\Testing files\HTML.htm"));
            //Path to output resulted file
            string outputFilePath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(),@"..\..\..\..\..\..\Testing files\Result.pdf"));

            //Prepare UseOffice .Net, loads MS Word in memory
            int ret = u.InitWord();            

            //Return values:
            //0 - Loading successfully
            //1 - Can't load MS Word� library in memory 

            if (ret==1)
                return;

            //Converting
            ret = u.ConvertFile(inputFilePath, outputFilePath, SautinSoft.UseOffice.eDirection.HTML_to_PDF);

            //Release MS Word from memory
            u.CloseWord();

            //0 - Converting successfully
            //1 - Can't open input file. Check that you are using full local path to input file, URL and relative path are not supported
            //2 - Can't create output file. Please check that you have permissions to write by this path or probably this path already used by another application
            //3 - Converting failed, please contact with our Support Team
            //4 - MS Office isn't installed. The component requires that any of these versions of MS Office should be installed: 2000, XP, 2003, 2007 or 2010
            if(ret==0 )
            {
                //Show produced file
                System.Diagnostics.Process.Start(outputFilePath);
            }        
        }
    }
}
CopyHow to convert a HTML file to a PDF file in VB.Net
Imports System
Imports System.IO
Imports System.Text
Imports System.Collections


Module Module1
    Sub Main()
        'Convert HTML file to PDF file
        'If you need more information about UseOffice .Net email us at:
        'support[at]sautinsoft.com        



        Dim u As New SautinSoft.UseOffice

        'Path to any local file
        Dim inputFilePath As String = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..\..\..\..\..\Testing files\HTML.htm"))
        'Path to output resulted file
        Dim outputFilePath As String = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..\..\..\..\..\Testing files\Result.pdf"))

        'Prepare UseOffice .Net, loads MS Word in memory
        Dim ret As Integer = u.InitWord()

        'Return values:
        '0 - Loading successfully
        '1 - Can't load MS Word� library in memory 


        If ret = 1 Then
            Return
        End If

        'Converting
        ret = u.ConvertFile(inputFilePath, outputFilePath, SautinSoft.UseOffice.eDirection.HTML_to_PDF)

        'Release MS Word from memory
        u.CloseWord()

        '0 - Converting successfully
        '1 - Can't open input file. Check that you are using full local path to input file, URL and relative path are not supported
        '2 - Can't create output file. Please check that you have permissions to write by this path or probably this path already used by another application
        '3 - Converting failed, please contact with our Support Team
        '4 - MS Office isn't installed. The component requires that any of these versions of MS Office should be installed: 2000, XP, 2003, 2007 or 2010
        If ret = 0 Then
            'Show produced file
            System.Diagnostics.Process.Start(outputFilePath)
        End If
    End Sub
End Module

Inheritance Hierarchy

System..::.Object
  SautinSoft..::.UseOffice..::.CPageStyle..::.CPageSize

See Also