Use |
The UseOfficeCPageStyleCPageSize type exposes the following members.
Name | Description | |
---|---|---|
UseOfficeCPageStyleCPageSize | Creates an instance of UseOfficeCPageStyleCPageSize |
Name | Description | |
---|---|---|
HeightInch | Sets the page height in inches. (Doesn't acceptable for Excel documents). | |
HeightMm | Sets the page height in millimeters. (Doesn't acceptable for Excel documents). | |
WidthInch | Sets the page width in inches. (Doesn't acceptable for Excel documents). | |
WidthMm | Sets the page width in millimeters. (Doesn't acceptable for Excel documents). |
Name | Description | |
---|---|---|
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 | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
Executive | Set Executive page size, 184 x 267 mm, 7.25 x 10.5 In | |
Folio | Set Folio page size, 210 x 330 mm, 8.26 x 12.99 In | |
GetHashCode | Serves as the default hash function. (Inherited from Object) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
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 | |
ToString | Returns a string that represents the current object. (Inherited from Object) | |
xlPaper10x14 | 10 in. x 14 in. Acceptable only for Excel documents. | |
xlPaper11x17 | 11 in. x 17 in. Acceptable only for Excel documents. | |
xlPaperA3 | A3 (297 mm x 420 mm). Acceptable only for Excel documents. | |
xlPaperA4 | A4 (210 mm x 297 mm). Acceptable only for Excel documents. | |
xlPaperA4Small | A4 Small (210 mm x 297 mm). Acceptable only for Excel documents. | |
xlPaperA5 | A5 (148 mm x 210 mm). Acceptable only for Excel documents. | |
xlPaperB4 | B4 (250 mm x 354 mm). Acceptable only for Excel documents. | |
xlPaperB5 | B5 (182 mm x 257 mm). Acceptable only for Excel documents. | |
xlPaperDsheet | C size sheet (176 mm x 250 mm). Acceptable only for Excel documents. |
using System; using System.IO; using System.Collections; namespace Sample { class Test { static void Main(string[] args) { // Before starting, we recommend to get a free 100-day key: // https://sautinsoft.com/start-for-free/ // Apply the key here: // UseOffice.SetLicense("..."); // Convert HTML file to PDF 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(@"..\..\..\..\..\..\TestFiles\example.html"); string outFile = Path.GetFullPath("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) { Console.WriteLine("Error! Can't load MS Word library in memory"); return; } // Perform the conversion. ret = u.ConvertFile(inpFile, outFile, 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, 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."); } } }
Imports System Imports System.IO Imports System.Collections Namespace Sample Friend Class Test Shared Sub Main(ByVal args() As String) ' Before starting, we recommend to get a free 100-day key: ' https://sautinsoft.com/start-for-free/ ' Apply the key here: ' UseOffice.SetLicense("..."); ' Convert HTML file to PDF 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("..\..\..\..\..\..\TestFiles\example.html") Dim outFile As String = Path.GetFullPath("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 Console.WriteLine("Error! Can't load MS Word library in memory") Return End If ' Perform the conversion. ret = u.ConvertFile(inpFile, outFile, 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, 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