This is awesome,

I've been toying with the idea of writing a Cocoa based DJVU reader for a 
while, basically I wanted to follow Preview. There is a great app on SF called 
Skim, which is a PDF viewer. Obviously it uses PDFKit. My basic idea was to 
write something that would plug into Skim with minimal fuss. 

A while back, I tried to hook into PDFKit by writing my own PDFDocument / 
PDFPage class, and using PDFKit to do the layout. Apparently the problem was 
the PDFKit documentation is pretty grim, and I never really figured out how 
this would work. 

Then I downloaded this code. This code does the layout and drawing using 
Apple's PDFDocument / PDFPage classes. So, it turns out that it is actually 
fairly straightforward to implement your own document / page classes. The code 
here has behavior which looks like is pretty compatible with Apple's PDFKit. 

This is actually a really cool design. Basically, one can write a Document / 
Page classes for any type of content that should be displayed in page layout 
form, and this code performs all the layout and drawing. This layout code I 
think could also form the basis for a word processor type app. 

GNUStep guys: how do feel about a free version of a Preview type app built 
using this layout code?

Most of the code here looks pretty portable, there are only a few areas where 
it uses CoreGraphics, which from what I understand is not supported 'yet' in 
GNUStep. 


On Feb 20, 2011, at 8:38 PM, Ultra Vga wrote:

> Hello,
> 
> Attached are clean room implementations of the basics of PDFKit including 
> PDFView, PDFMatteView, and PDFDisplayView. Currently it still uses Apple's 
> PDFDocument and PDFPage, but it should not be too hard to wrap these 
> interfaces around the poppler library. These have been created by listing all 
> the methods of each original Apple class with objective-c introspection, 
> creating new classes, and one by one implementing each method until it could 
> display a document. 
> This is a project based on Apple's sample pdf viewer application in which I 
> created replacement versions of all the display classes.
> 
> Most document navigation / display features are working such as scrolling, 
> zoom, 1/2 page single and continuous displays, layout, notifications and so 
> forth.
> 
> There are still a few methods to implement in PDFView, but it fully 
> functional and handles all drawing and layout. These have been painstakingly 
> engineered to be 100% compatible with Apple's PDFKit. There is a LOT of 
> layout code in PDFView, and I think it could serve as the basis for ANY 
> document centric app such as a word processor or so forth. Basically, 
> anything that could implement the PDFDocument/PDFPage interfaces could be 
> displayed in this class. This could serve as the basis for a really great 
> Preview type app.
> 
> There still is some work to be done in PDFView: not all methods are 
> implemented, magnify/zoom is sometimes a bit jumpy when the last page is 
> zoomed, rotated pages (angles other than 0 degrees) are not displayed 
> entirely correct, and annotations and selects are not implemented. 
> 
> I'm releasing these as public domain, feel free to use them as you see fit. 
> 
> enjoy
> 
> 
> <PDFKitViewer.tar.gz>_______________________________________________
> Gnustep-dev mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/gnustep-dev

_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to