Skip navigation.
 
mlRe: Use pdfkit to display a batch of pictures...
FROM : John Calhoun
DATE : Tue Feb 26 21:43:58 2008

On Feb 21, 2008, at 1:30 PM, Leopard x86 wrote:
> Most of us have been used to use Mac OS X preview to open pictures 
> and pdf files. So my exact goal is to create an application of the 
> Preview-style to show my CGImage pictures, in other words, to 
> replace the page(PDFKit page object) of a displayed pdf document 
> with the CGImage object.


You can do this, but since you mention Preview, the Leopard version of 
Preview uses in fact the ImageKit view and ImageKit browser class 
(thumbnails)  for displaying images.

> If we can use the PDFKit document model to display a batch of 
> CGImages, then how to use the pdf built-in functions such as: Move
> \Select\Rotate\Scale\Zoom and so on?


Zoom is built in to PDFView (-[PDFView setScaleFactor:].

You can rotate a page by setting the rotation on the PDFPage and 
telling the PDFView to re-layout.

Move is done by tracking the mouse in a PDFView subclass and calling 
scrollToPoint: on the clip view enclosing the PDFView's document view.

Select is also done with a PDFView subclass.  Also handle the mouse as 
for tracking above, but in select mode you keep track of the selected 
area as a rectangle - in the PDFView subclass you can "post draw" on 
top of the PDF page in -[PDFPage drawPage:] and draw part of the page 
"darkended" or selected.

The above is a little brief (no sample code) but is essentially what 
Preview does.

There is sample code to show you how to subclass PDFView and handle 
your own mouse tracking, post-drawing, etc.

John Calhoun—_______________________________________________

Cocoa-dev mailing list (<email_removed>)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>

This email sent to <email_removed>

Related mailsAuthorDate
mlUse pdfkit to display a batch of pictures... Leopard x86 Feb 21, 22:30
mlRe: Use pdfkit to display a batch of pictures... John Calhoun Feb 26, 21:43