Foxit Corporation Forums  

Go Back   Foxit Corporation Forums > Portable Document Format (PDF) Tools > SDK ( DLL or ActiveX)

SDK ( DLL or ActiveX) Integrate PDF functions into your application easily. The SDK shares the same technology that powers Foxit Reader.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 19th, 2007, 10:23 AM
dkeith2@yahoo.com dkeith2@yahoo.com is offline
Junior Member
 
Join Date: Feb 2007
Posts: 7
dkeith2@yahoo.com is an unknown quantity at this point
Default Device context for PDF in viewer?

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
Reply With Quote
  #2  
Old March 20th, 2007, 12:32 AM
william's Avatar
william william is offline
Foxit Developer
 
Join Date: Dec 2005
Posts: 192
william is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of light
Default

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.
Reply With Quote
  #3  
Old March 20th, 2007, 11:48 AM
dkeith2@yahoo.com dkeith2@yahoo.com is offline
Junior Member
 
Join Date: Feb 2007
Posts: 7
dkeith2@yahoo.com is an unknown quantity at this point
Cool

Should have explained, I'm using the ActiveX version.

Thanks.

David Keith


Quote:
Originally Posted by william
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.
Reply With Quote
  #4  
Old March 21st, 2007, 07:16 PM
tree tree is offline
Junior Member
 
Join Date: Jun 2006
Posts: 9
tree is an unknown quantity at this point
Default

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:13 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2005-2008 Foxit Corporation. All rights reserved.