cete.dynamicpdf.diskbufferingoptions
DiskBufferingOptions
- Namespace: ceTe.DynamicPDF
- Assemblies: ceTe.DynamicPDF.40.dll
Represents a disk buffering options.
public class DiskBufferingOptions
Public Class DiskBufferingOptions
Inheritance: Object → DiskBufferingOptions
Licensing
This class is a DynamicPDF Generator Community Edition feature.
Examples
The following code demonstrates how to enable disk buffering:
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document()
' Create Disk buffering options
Dim MyOptions As DiskBufferingOptions = New DiskBufferingOptions()
' Change the default location of the temporary file.
MyOptions.Location = "C:\temp"
MyDocument.DiskBuffering = MyOptions
Dim text As String = "To create a table that will appear on the PDF, first instantiate a Table class. Always specify the Height and Width as well as the X and Y coordinates where the table will be placed on the page (the X and Y coordinates is where the top left corner of the Table will be positioned on the page). The height and width specified will be the amount of vertical or horizontal space allotted for the table on a particular page. There is no need to try and guess the height and width of the final table during the instantiation of the Table object (since the table can be based on dynamic data and height or width may not always be known). While these height and width values are required by the Table's constructor, they can be reset once the Table is filled in. One strategy may be to set the height and width values to the biggest possible values that the page can accommodate and then go back and re-set them if the table's content is smaller. In addition to the X, Y, Height and Width, any formatting that has to be the default for the entire table should be specified here"
'Create a TextArea page element
Dim MyTextArea As TextArea = New TextArea(text, 50, 50, 400, 600)
For i As Integer = 0 To 99999
Dim MyPage As Page = New Page()
MyPage.Elements.Add(MyTextArea)
MyDocument.Pages.Add(MyPage)
Next
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();
// Create Disk buffering options
DiskBufferingOptions options = new DiskBufferingOptions();
// Change the default location of the temporary file.
options.Location = @"d:\temp";
document.DiskBuffering = options;
string text = "To create a table that will appear on the PDF, first instantiate a Table class. Always specify the Height and Width as well as the X and Y coordinates where the table will be placed on the page (the X and Y coordinates is where the top left corner of the Table will be positioned on the page). The height and width specified will be the amount of vertical or horizontal space allotted for the table on a particular page. There is no need to try and guess the height and width of the final table during the instantiation of the Table object (since the table can be based on dynamic data and height or width may not always be known). While these height and width values are required by the Table's constructor, they can be reset once the Table is filled in. One strategy may be to set the height and width values to the biggest possible values that the page can accommodate and then go back and re-set them if the table's content is smaller. In addition to the X, Y, Height and Width, any formatting that has to be the default for the entire table should be specified here";
TextArea area = new TextArea(text, 50, 50, 400, 600);
for (int i = 0; i < 10000; i++)
{
Page page = new Page();
page.Elements.Add(area);
document.Pages.Add(page);
}
// Save the PDF
document.Draw(@"d:\MyDocument.pdf");
}
}
Constructors
DiskBufferingOptions()
Initializes a new instance of the disk buffering options class.
public DiskBufferingOptions()
Public Sub New ()
Properties
Current
Gets the default disk buffering options.
public static DiskBufferingOptions Current { get; }
Public Shared Property Current As DiskBufferingOptions
Property Value
Enabled
Gets or sets disk buffering options.
public bool Enabled { get; set; }
Public Property Enabled As Boolean
Property Value
Location
The location where to store the temporary file.
public string Location { get; set; }
Public Property Location As String
Property Value
Methods
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .