PDF Xpress for ActiveX - User Guide > How To > Modify PDF Document Content > Render to Device Context |
To render a PDF document directly to a Device Context, do the following:
This will render the document directly to the Device Context, in this case the display.
VB6 Example |
Copy Code
|
---|---|
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As Long) As Long Private Sub PrintButton_Click() Dim pdf As New PdfXpress pdf.InitializePaths "C:\Users\Public\Documents\Accusoft\PDFXpress\V7.0\Support\Font", _ "C:\Users\Public\Documents\Accusoft\PDFXpress\V7.0\Support\CMap" Dim doc As New PdfDocument doc.SetParentControl pdf doc.OpenDocument "C:\myfile.pdf", "" Dim options As New RenderDcOptions options.ForDeviceTechnology = PDF_DeviceTechnology_Display Dim hDC As Long hDC = GetDC(0) doc.RenderPageOptionsToDc 0, hDC, options ReleaseDC 0, hDC Set options = Nothing Set doc = Nothing pdf.Terminate Set pdf = Nothing End Sub |