Re: CGImage to NSImage, or PDFPage?

2010-08-11 Thread John Calhoun
s back and forth between bitmap formats and PDF-as-container format though has me wondering if there isn't a better way. I don't know what you're trying to accomplish though so perhaps you have the optimal solution. John Calhoun— ___ C

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread John Calhoun
hod in your subclass. Your method would get the current context as a CGContext and draw the CGImageRef directly. Make sure to return the correct size in -[PDFPage boundsForBox:] as well. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.app

Re: PDFSelection question

2010-06-07 Thread John Calhoun
something else you are attempting to do though. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/U

Re: PDFKit cpSelections?

2010-05-26 Thread John Calhoun
ction is drawn with a different color than when the focus is elsewhere I offer this just as an explanation for what is happening — I can't say why you are seeing doesNotRecognizeSelector or referecnes to cpSelection. John Calhoun—___ Coc

Re: initializing a pdfview

2010-05-26 Thread John Calhoun
; (id)initWithFrame:(NSRect)frameRect doesn't seem to get called--as it does in > nsview. Are you loading the PDFView subclass from a NIB or creating it programmatically? From the NIB I believe -(id) initWithCoder: (NSCoder *) coder is called. John Calhoun—

Re: Creating a PDFSelection...

2010-05-26 Thread John Calhoun
r example to improve fidelity between the original selection and the unarchived one. If you know the range of the original text selected, PDFPage's -[selectionForRange:] is unambiguously specified. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@li

Re: PDF View - smooth text?

2010-01-27 Thread John Calhoun
it isn't > something specific to Preview)? Try playing with interpolation quality in the CGContext. It may be combined with ant-ialising as well (so you may need to set both appropriately). John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@

Re: How to determine if a PDFPage is image based? (A scanned page)

2009-09-14 Thread John Calhoun
On Sep 13, 2009, at 5:01 AM, DairyKnight wrote: Is there a way to determine if a PDFPage contains only a picture? You could see if NULL is returned for -[PDFPage string]. That sort of indirectly implies an image (or a blank page — or one perhaps with line art only ...). John Calhoun

Re: Anti-aliasing in Snow Leopard (10.6) PDFView

2009-09-08 Thread John Calhoun
this behavior? John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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:

Re: NSPDFImageRep Memory Leak?

2009-09-08 Thread John Calhoun
-[PDFDocument dataRepresentation] as well. Check the PDFXxx headers, the behavior change is documented there. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: Performance Issue with Drawing PDFPages on NSView

2009-08-26 Thread John Calhoun
h so you will have to set up a transform within [NSView drawRect:] in order to scale/position the page correctly. That should make a significant performance difference John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: Memory efficient way to get image metadata?

2009-08-03 Thread John Calhoun
class if you want. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 you

Re: adding PDF annotations to the output of a regular NSView

2009-07-29 Thread John Calhoun
nd all that with the PDFView class But as I say, it sort of depends on your app. If your app is an appoinment calendar then writing it to live within a PDFView is a bit of a stretch. :-) John Calhoun— ___ Cocoa-dev mailing list (Cocoa-dev@

Re: trimbox and bleedbox from PDF

2009-06-11 Thread John Calhoun
(CoreGraphics ... straight C). From there get either a PDFPage (PDF Kit) or CGPDFPageRef (CoreGraphics) — both have methods/functions then to get the trim and bleed boxen. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: PDFView in layer backed view appears white

2009-04-06 Thread John Calhoun
d in your views drawRect method. You can set the needed scale on the current graphics context to have the PDFPage draw at the correct size. Also, don't forget to erase to white before calling PDFPage's draw. John Calhoun—___ Cocoa-de

Re: Saving a PDF Selection or converting it to an NSRange and back

2009-02-11 Thread John Calhoun
ns. These you can add to the PDF and save out. Might save you some work since when re-opening the PDF you don't need to re-create the highlights since they're now embedded in the PDF. John Calhoun—___ Cocoa-dev mailing list (Cocoa

Re: -[PDFView drawPage:] and Printing

2009-02-10 Thread John Calhoun
ch visible page. -[PDFView drawPage:] was put in PDFView as a convenience so it can be overriden in a subclass of PDFView. The default implementation of this method calls -[PDFPage drawWithBox:] for the page in question. John Calhoun—___ Cocoa-d

Re: -[PDFView drawPage:] and Printing

2009-02-09 Thread John Calhoun
-[PDFPage drawWithBox:] method to composite your two PDF's. This will in fact kill two birds with one stone. And in fact a third bird ... saving the PDF will save the composited PDF as well. :-) John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@

Re: PDFView printing subviews

2009-01-21 Thread John Calhoun
doable to me, just unfortunately more complicated than you would like. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev

Re: Tabbing PDF Annotation Editor between annotations in "edit mode"?

2008-11-14 Thread John Calhoun
e the focus by going round-robin threough the annotaions on the page. If you can do something more sophisticated though, go for it. :-) John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo

Re: Saving an annotated PDF to a flat image

2008-09-26 Thread John Calhoun
ument by calling PDFDocument's writeToFile/URL methods. Can you share some swatch of code? John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the mod

Re: Saving an annotated PDF to a flat image

2008-09-25 Thread John Calhoun
ion classes ave initializers so that annotations can be created. PDFView is really just a view. While it has a lot of convenience methods to aid in PDF viewing, the real functionailty of PDF Kit is in the other classes. John Calhoun—___ Cocoa-dev mailing

Re: Saving an annotated PDF to a flat image

2008-09-24 Thread John Calhoun
haven't tested the code. Oh, you may need to throw in a -[PDFPage transformContextForBox:] so it works with PDF's with rotated pages, etc. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin r

Re: How do I create a PDF fle paginated according to my own rules?

2008-08-28 Thread John Calhoun
info. This will work. And it will be fast as well. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Re: How do you create a new PDF file and write text to it?

2008-08-06 Thread John Calhoun
data to a file. Charles is correct. And it is easiest. The PDF Kit method I outlined above gives you slightly more control over the resulting PDF (you can for example add metadata, multiple pages, differing crop/media boxes, etc.). John Ca

Re: [PDFDocument documentRef] internal method questions.

2008-07-14 Thread John Calhoun
find the symbol you found exists back to Tiger and may be made public in SnowLeopard. It is something PDF Kit could benefit from — I just need to make sure the headers don't break (since we'd be declaring a CoreGraphics type in essentially a Cocoa-universe header). So, be sa

Re: PDFKit guidance

2008-06-24 Thread John Calhoun
On Jun 24, 2008, at 7:15 AM, Adam R. Maxwell wrote: On Jun 23, 2008, at 3:01 PM, John Calhoun wrote: You can then either apply it to a context (in your PDFPage subclass) with: - (BOOL) applyToContext:(CGContextRef) aContext; Or better still, pass it in the options dictionary to one of

Re: PDFKit guidance

2008-06-23 Thread John Calhoun
y PDFDocument on 10.4 and - insertPage your subclassed PDFPage. QuartzFilters though were only introduced in 10.5 John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: PDFKit guidance

2008-06-20 Thread John Calhoun
ry to dispell that when I can. :-) John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/U

Re: PDFKit guidance

2008-06-19 Thread John Calhoun
pass in a QuartzFilter in the save methods (in the options dictionary) if you want to apply this Quartz Filter on saving. So, PDF Kit can I think do what you want. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: PDFDocuments and CGPDFDocuments

2008-06-02 Thread John Calhoun
in PDF Kit ... basically you call -[setBoundsForBox:] on the PDFPage in question. Additionally you should probably look into subclassing PDFPage. Within that domain you can overlay crop marks, apply additional transforms, etc. See PDFCalendar sample code for a PDFPage subclassing example. Jo

Re: PDFDocuments and CGPDFDocuments

2008-05-30 Thread John Calhoun
in PDF Kit (PDFView) and do your transforms there. Since I don't know exactly what you are doing, I can't recommend specific advice. If you explain what you think you need to do with CGPDFDocumentRef, I'll try to suggest a parallel way of doing it in PDF Kit.

Re: PDFPage Creation query

2008-05-23 Thread John Calhoun
bnail only? Both? John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 Subscri

Re: PDFPage Creation query

2008-05-22 Thread John Calhoun
correct. In short, instead override the draw and bounds method in yor own subclass. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa

Re: Storing PDF selection

2008-05-16 Thread John Calhoun
FSelection addSelection: (PDFSelection *) selection]. Yeah, a little hacky.... John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev

Re: Query with PDF Page display in PDFview

2008-05-15 Thread John Calhoun
ering, PDFSelection for selecting text, etc.). John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Re: Threading - How its done?

2008-05-06 Thread John Calhoun
, different PDFDocument instance. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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

Re: Threading - How its done?

2008-05-05 Thread John Calhoun
rying to share a single PDFView? I know that wll break.... John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.appl

Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5

2008-05-05 Thread John Calhoun
. Antonio is right. This was a bug. Hopefully I can get the fix into a software update. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Re: Create a PDFPage instance from Quartz-format image

2008-03-03 Thread John Calhoun
Draw the CGImage in your draw method. It's that simple. There is a sample app or two floating around somewhere that illustrate this: PDFCalendar and PDF Watermarker I believe. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

Re: Use pdfkit to display a batch of pictures...

2008-02-26 Thread John Calhoun
your own mouse tracking, post-drawing, etc. John Calhoun—___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Hel

Re: indexForPage: page not found - Problem with PDFView on Tiger, works fine on Leopard

2008-02-26 Thread John Calhoun
d differences between Leopard and Tiger here John Calhoun— ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com H

Re: Help with displaying encrypted PDF image

2008-02-26 Thread John Calhoun
decrypted because the printf statement "unlocked" is reached always. Yes, for an encrypted PDF document, -[PDFDocument dataRepresentation], -[PDFDocument writeToURL:], etc. do nothing. You can still get the image data by hand by drawing the PDFPage into a CGPDFContext. Jo