gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDFKit code


From: Ultra Vga
Subject: Re: PDFKit code
Date: Wed, 2 Mar 2011 05:21:18 -0800 (PST)

Hey,

1: Reason I wrote this: I think the way Skim handles docs  better than evince and (no offence intended), vespuci. Skim uses PDFKit, so, I thought a free version would be useful. Also, wanted to see how 'dynamic' objective-c is -- how much info could you obtain using the objective-c runtime. So I decided to figure out how PDFKit works.

2: Reason I used an alias: I live in a country that seems to like lawsuits, like IBM being sued by because SCO says IBM reverse engineered UNIX, like the guy who was sued by Sony because he figured out how the ROM works and so forth. I like GNUStep, I like free software, I want to contribute, but I don't understand law, I don't know if Apple can sue anyone for contributing to GNUStep. In summary: I want to contribute, but am afraid of getting sued.

3: How I wrote this code: I started with the PDF sample application from Apple (a demo which shows how to use PDFKit, the starting point for applications like Skim.app). Then used the objective-c introspection APIs (ivar_getName, class_copyPropertyList, property_getName, class_copyMethodList...) to figure out the layout of the underlying implementation. Then created new classes for Document and so forth, and started replacing 1 method at a time, and placing breakpoint in other classes to see what leads where to figure out the logic. I'm actually electrical engineer for an aftermarket automotive parts company, so I'm pretty good and figuring out to create replacement parts.



From: Fred Kiefer <address@hidden>
To: Andy Somogyi <address@hidden>
Cc: address@hidden
Sent: Wed, March 2, 2011 3:29:04 AM
Subject: Re: PDFKit code

I only had a brief look at this code and the first thing I noticed was
that it isn't a clean room implementation at all. It uses plenty of
Apple example code, even with the original headers still included. No
harm in that, but it made me doubt the statements of the original
poster. It would be completely different if he had started his mail by
saying that he used some Apple example code and build parts of a PDFKit
implementation on top of that.
Free software development is a lot about trust. This is even more true,
when you are working on e FSF project and somebody comes up the first
time and uses an alias as mail address.

Others may see this differently, but I will stay away from this code.
Fred

Am 01.03.2011 14:29, schrieb Andy Somogyi:
> 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


_______________________________________________
Gnustep-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnustep-dev


reply via email to

[Prev in Thread] Current Thread [Next in Thread]