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
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
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
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
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
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
)?
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
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
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
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
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
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
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
(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
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
. 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
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
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
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
. 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
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
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
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
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
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
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
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
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
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
... 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
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
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
, 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
.
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
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
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
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
-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
38 matches
Mail list logo