View Full Version : Device context for PDF in viewer?
dkeith2@yahoo.com
March 19th, 2007, 10:23 AM
Is there a way to get a handle to the device context for the currently displayed page in the viewer? Something that I could attach an InkOverlay to? Not the viewer control size, but the PDF 'canvas' itself?
Thanks.
David Keith:1_28:
william
March 20th, 2007, 12:32 AM
Hi David,
Let me explain how our DLL works.
It uses the following function to render one PDF page directly onto the DC of a viewer control:
void FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags);
Therefore, there is no other DC or Canvas associated with the PDF page itself.
All you can get is the DC of the viewer control.
Please notice that the final paramter of the above function is a flag.
If you set it to 0, then the PDF page will be rendered without annotation.
If you set it to 1, then the PDF page will be rendered with annotation.
dkeith2@yahoo.com
March 20th, 2007, 11:48 AM
Should have explained, I'm using the ActiveX version.
Thanks.
David Keith
:1_20:
Hi David,
Let me explain how our DLL works.
It uses the following function to render one PDF page directly onto the DC of a viewer control:
void FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags);
Therefore, there is no other DC or Canvas associated with the PDF page itself.
All you can get is the DC of the viewer control.
Please notice that the final paramter of the above function is a flag.
If you set it to 0, then the PDF page will be rendered without annotation.
If you set it to 1, then the PDF page will be rendered with annotation.
tree
March 21st, 2007, 07:16 PM
Function: BeforeDraw
Sent just before the painting of the viewer contents is about to begin.
Prototype:
void BeforeDraw (long dc)
Parameters:
dc - Handle to the DC on which painting is about to take place.
Return value:
None
Function: AfterDraw
Sent just after the painting of the viewer contents is completed.
Prototype:
void AfterDraw (long dc)
Parameters:
dc - Handle to the DC on which painting is about to take place.
Return value:
None
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.