Re: CGImage to NSImage, or PDFPage?

2010-08-11 Thread John Calhoun
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— ___ Cocoa-dev mailing list

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread John Calhoun
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.apple.com

Re: PDFSelection question

2010-06-07 Thread John Calhoun
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/Unsubscribe/Update your

Re: Creating a PDFSelection...

2010-05-26 Thread John Calhoun
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@lists.apple.com) Please do not post admin

Re: initializing a pdfview

2010-05-26 Thread John Calhoun
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—___ Cocoa-dev mailing list (Cocoa

Re: PDFKit cpSelections?

2010-05-26 Thread John Calhoun
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—___ Cocoa-dev mailing list (Cocoa

Re: PDF View - smooth text?

2010-01-27 Thread John Calhoun
)? 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@lists.apple.com) Please do not post admin requests

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: NSPDFImageRep Memory Leak?

2009-09-08 Thread John Calhoun
to -[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: 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: http

Re: Performance Issue with Drawing PDFPages on NSView

2009-08-26 Thread John Calhoun
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) Please do not post admin requests

Re: Memory efficient way to get image metadata?

2009-08-03 Thread John Calhoun
such a class) Look into ImageIO on the OS. It is not a Cocoa class library but rather a C-level framework. You can get the properties from an image probably a good deal more efficiently than via NSImage. And you could easily wrap it all in your own ImageInfo Objective-C class if you want. John

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

2009-07-29 Thread John Calhoun
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@lists.apple.com) Please do not post

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

Re: PDFView in layer backed view appears white

2009-04-06 Thread John Calhoun
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-dev mailing list (Cocoa-dev

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

2009-02-11 Thread John Calhoun
. 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-dev@lists.apple.com

Re: -[PDFView drawPage:] and Printing

2009-02-10 Thread John Calhoun
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-dev mailing

Re: -[PDFView drawPage:] and Printing

2009-02-09 Thread John Calhoun
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@lists.apple.com

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
. 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 moderator comments to the list. Contact the moderators at cocoa-dev-admins

Re: Saving an annotated PDF to a flat image

2008-09-26 Thread John Calhoun
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 moderators

Re: Saving an annotated PDF to a flat image

2008-09-25 Thread John Calhoun
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 list (Cocoa-dev

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

2008-08-28 Thread John Calhoun
this 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
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 Calhoun

Re: [PDFDocument documentRef] internal method questions.

2008-07-14 Thread John Calhoun
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 safe, but stay tuned. John

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

Re: PDFKit guidance

2008-06-23 Thread John Calhoun
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. Contact the moderators

Re: PDFKit guidance

2008-06-20 Thread John Calhoun
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/Update

Re: PDFKit guidance

2008-06-19 Thread John Calhoun
to 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
... 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. John Calhoun

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. John Calhoun

Re: Storing PDF selection

2008-05-16 Thread John Calhoun
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-admins

Re: Query with PDF Page display in PDFview

2008-05-15 Thread John Calhoun
, 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 Help

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

Re: Threading - How its done?

2008-05-05 Thread John Calhoun
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.apple.com

Re: Help with displaying encrypted PDF image

2008-02-26 Thread John Calhoun
to be 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. John Calhoun

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

2008-02-26 Thread John Calhoun
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 Help/Unsubscribe/Update your

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

2008-02-26 Thread John Calhoun
-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 Help/Unsubscribe/Update your