I am using DrawToDevice method to print a pdf page to the printer. Following is a part of my code:
Code: Select all
Dim oPage As IPXC_Page
Set oPage = pDoc.Pages.Item(l_currentPage)
Dim oParams As IPXC_PageRenderParams
Set oParams = oTrackerInstance.CreateRenderParams
oParams.PageViewBox = PBox_PrintBox
oParams.RenderFlags = RF_DisplayLargeImages & RF_SmoothImages
oParams.TextSmoothMode = TSM_ClearType
Dim oContext As IPXC_OCContext
Set oContext = oTrackerInstance.CreateStdOCCtx
oContext.RenderType = RenderType_ModePrint
oContext.Resolution = 600
oContext.PrintContentFlags = CF_SETACTIVATEDEFAULT
oContext.ZoomLevel = 100
' set the top and left of the renderRect '
renderRect.Top = 0
renderRect.Left = 0
setDevrect l_currentPage
' center the page '
setCentering
Dim oMatrix As PXC_Matrix
If Abs(oPage.Rotation) = 90 Or Abs(oPage.Rotation) = 270 Then
oMatrix.a = 0
oMatrix.b = dDrawScale
oMatrix.c = dDrawScale
oMatrix.d = 0
oMatrix.e = renderRect.Left
oMatrix.f = renderRect.Top
Else
oMatrix.a = dDrawScale
oMatrix.b = 0
oMatrix.c = 0
oMatrix.d = dDrawScale
oMatrix.e = renderRect.Left
oMatrix.f = renderRect.Top
End If
oPage.DrawToDevice clP.hdc, renderRect, oMatrix, DDF_AsVector, oParams, oContext
Set oContext = Nothing
Set oParams = Nothing
Set oPage = Nothing
1. Free Text
2. Square
3. Popup
Is there a step that I am missing in the code above?
Regards,
M