Allows to specify page properties for output PDF document: page size, orientation, page margins and page numbers

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

Syntax

      
 C#  Visual Basic 
public class CPageStyle
Public Class CPageStyle

Members

         
 All Members  Constructors   Properties  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
UseOffice..::.CPageStyle()()()
Creates a new instance of UseOffice..::.CPageStyle class
PageMarginBottom
Set bottom page margin
PageMarginLeft
Set left page margin
PageMarginRight
Set right page margin
PageMarginTop
Set top page margin
PageOrientation
Set page orientation
PageSize
Set page size

Remarks







Examples

CopyHow to convert a DOC file to a RTF file in C#
using System;
using System.IO;
using System.Collections;

namespace Sample
{
    class Test
    {

        static void Main(string[] args)
        {

            //Convert DOC file to RTF 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\DOC.doc"));
            //Path to output resulted file
            string outputFilePath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(),@"..\..\..\..\..\..\Testing files\Result.rtf"));

            //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.DOC_to_RTF);

            //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 DOC file to a RTF file in VB.Net
Imports System
Imports System.IO
Imports System.Text
Imports System.Collections


Module Module1
    Sub Main()
        'Convert DOC file to RTF 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\DOC.doc"))
        'Path to output resulted file
        Dim outputFilePath As String = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..\..\..\..\..\Testing files\Result.rtf"))

        '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.DOC_to_RTF)

        '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

See Also