Implementing PDF select/snapshot tool with PDFViewCtrl?

60 views
Skip to first unread message

Support

unread,
Nov 1, 2013, 2:41:24 PM11/1/13
to pdfne...@googlegroups.com
Q:
 

What tool (Class) would I use to select images and  take a snapshot of image in PDF for copy/paste into another document?

 

-----

A:

 
To get a snapshot of a PDF page you could use PDFDraw.GetBitmap() or PDFRasterizer (as shown in PDFDraw sample project - http://www.pdftron.com/pdfnet/samplecode.html#PDFDraw)

 

Regarding the GUI part you would need to implement a custom tool that draws a rectangle (or captures points). Please take a look at provided ‘tools’ sample code for concrete of how to do this part.

 

Once you have 2 coordinates in clinet/screen coord space you can obtain the underlying page with PDFViewCtrl.GetPageNumberFromScreenPt(x, y). You can transform a point in PDF page coord space using PDFViewCtrl. ConvPagePtToScreenPt(x, y, page_num).

 

Reply all
Reply to author
Forward
0 new messages