Allows to set page orientation for PDF document

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

Syntax

      
 C#  Visual Basic 
public class CPageOrientation
Public Class CPageOrientation

Members

         
 All Members  Constructors   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
UseOffice..::.CPageStyle..::.CPageOrientation()()()
Creates a new instance of UseOffice..::.CPageStyle..::.CPageOrientation class
Auto()()()
Set default page orientation, portrait
Landscape()()()
Set landscape page orientation
Portrait()()()
Set portrait page orientation

Remarks



Examples

CopyHow to convert a XLS file to a CSV file in C#
using System;
using System.IO;
using System.Collections;

namespace Sample
{
    class Test
    {
        static void Main(string[] args)
        {
            // Convert XLS file to CSV file.
            // If you need more information about UseOffice .Net email us at:
            // support@sautinsoft.com.

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

            string inpFile = Path.GetFullPath(@"..\..\..\..\..\Testing files\example.xls");
            string outFile = Path.GetFullPath("Result.csv");

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

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

            if (ret == 1)
            {
                Console.WriteLine("Error! Can't load MS Excel library in memory");
                return;
            }

            // Perform the conversion.
            ret = u.ConvertFile(inpFile, outFile, SautinSoft.UseOffice.eDirection.XLS_to_CSV);

            // Release MS Excel from memory
            u.CloseExcel();

            // 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, 2010, 2013, 2016 or 2019.
            if (ret == 0)
            {
                // Open the result.
                System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(outFile) { UseShellExecute = true });
            }
            else
                Console.WriteLine("Error! Please contact with SautinSoft support: support@sautinsoft.com.");
        }

    }
}
CopyHow to convert a XLS file to a CSV file in VB.Net
Imports System
Imports System.IO
Imports System.Collections

Namespace Sample
    Friend Class Test
        Shared Sub Main(ByVal args() As String)
            ' Convert XLS file to CSV file.
            ' If you need more information about UseOffice .Net email us at:
            ' support@sautinsoft.com.


            Dim u As New SautinSoft.UseOffice()

            Dim inpFile As String = Path.GetFullPath("..\..\..\..\Testing files\example.xls")
            Dim outFile As String = Path.GetFullPath("Result.csv")

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

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


            If ret = 1 Then
                Console.WriteLine("Error! Can't load MS Excel library in memory")
                Return
            End If

            ' Perform the conversion.
            ret = u.ConvertFile(inpFile, outFile, SautinSoft.UseOffice.eDirection.XLS_to_CSV)

            ' Release MS Excel from memory
            u.CloseExcel()

            ' 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, 2010, 2013, 2016 or 2019.
            If ret = 0 Then
                ' Open the result.
                System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(outFile) With {.UseShellExecute = True})
            Else
                Console.WriteLine("Error! Please contact with SautinSoft support: support@sautinsoft.com.")
            End If
        End Sub

    End Class
End Namespace

Inheritance Hierarchy

System..::.Object
  SautinSoft..::.UseOffice..::.CPageStyle..::.CPageOrientation

See Also