Accusoft.PdfXpressSdk Namespace > Document Class > RenderPageToDib Method : RenderPageToDib(Int32) Method |
'Declaration Public Overloads Function RenderPageToDib( _ ByVal pageNumber As Integer _ ) As Integer
'Usage Dim instance As Document Dim pageNumber As Integer Dim value As Integer value = instance.RenderPageToDib(pageNumber)
public int RenderPageToDib( int pageNumber )
public: int RenderPageToDib( int pageNumber )
public: int RenderPageToDib( int pageNumber )
This method creates an unmanaged Windows GDI bitmap object.
Note: This object must be deleted specifically, as the .NET runtime garbage collectors cannot clear up unmanaged resources. Clean up can be done via a call to DeleteObject(hBitmap).
Calling RenderPageToDib(Int32) is equivalent to calling RenderPageToDib(Int32, rendOptions), where rendOptions is a RenderOptions object with rendOptions.ProduceDibSection=true. That makes calling DeleteObject() necessary.
C# Signature:
[DllImport("gdi32.dll")]
static extern bool DeleteObject(IntPtr hObject);
VB.NET Signature:
Publlic 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));
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.