-[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:
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
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
; (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—
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
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
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@
(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
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@
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
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
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
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
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
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
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
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
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.
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
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
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
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.
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
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
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
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
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
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
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
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.
.
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
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
, 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
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
-[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@
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
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
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
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
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
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
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
43 matches
Mail list logo