Accusoft.PdfXpressSdk Namespace > Document Class > RenderPageToDib Method : RenderPageToDib(Int32,RenderOptions) Method |
'Declaration Public Overloads Function RenderPageToDib( _ ByVal pageNumber As Integer, _ ByVal options As RenderOptions _ ) As Integer
'Usage Dim instance As Document Dim pageNumber As Integer Dim options As RenderOptions Dim value As Integer value = instance.RenderPageToDib(pageNumber, options)
public int RenderPageToDib( int pageNumber, RenderOptions options )
public: int RenderPageToDib( int pageNumber, RenderOptions* options )
public: int RenderPageToDib( int pageNumber, RenderOptions^ options )
Returns either an unmanaged HGLOBAL or a HGDIOBJ handle.
When options.ProduceDibSection=false, HGLOBAL is created.
When options.ProduceDibSection=true, HGDIOBJ is created.
This method creates an unmanaged Windows DIB section or a global memory buffer containing a packed bitmap (DIB).
Note: The produced object must be deleted specifically, as the .NET runtime garbage collectors cannot clear up unmanaged resources.
DeleteObject
function.C# Signature:
[DllImport("gdi32.dll")]
static extern bool DeleteObject(IntPtr hObject);
VB.NET Signature:
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As IntPtr) As Boolean
A call would look like:
int DIB=document.RenderPageToDib(0);
DeleteObject(new System.IntPtr(DIB));
GlobalFree
.C# Signature:
[DllImport("kernel32.dll")]
static extern IntPtr GlobalFree(IntPtr hObject);
VB.NET Signature:
Public Declare GlobalFree Lib "kernel32" (ByVal hObject As IntPtr) As Boolean As System.IntPtr
A call would look like:
int DIB=document.RenderPageToDib(0);
GlobalFree(new System.IntPtr(DIB));
Copy protected rendering functionality is to be used only for viewing of copy protected PDF documents. This functionality should not be used to violate or bypass PDF file security measures which prevent copying or editing the PDF documents.