FROM : John Calhoun
DATE : Thu Jan 03 22:41:42 2008
On Jan 2, 2008, at 1:40 PM, Jerry LeVan wrote:
> For reasons that are not clear to me I had to keep the "pages" until
> I was
> finished with the PDF document in Tiger. For Leopard this was not
> necessary...
This was a bug in PDFKit in Tiger. My recollection is that when you
added a PDFPage to a document, PDFDocument made a copy of the PDFPage
and retained that, but did not tell the copy of its new owning document.
Recall that PDFPage has a -[document] method that returns the "ownnig"
document. To accomplish this a PDFPage has a weak reference to the
PDFDocument that it is a part of. A private call to -[PDFPage
setDocument:] is made by the PDFDocument when you add a page. The bug
is that while a copy of the page is created and retained, -
[setDocument:] is called on the original PDFPage. I'm not quite clear
on why you should have to keep the original pages around however....
A workaround for Tiger might be to call the private -[setDocument:]
call yourself after adding the page to a document. Something like:
[someDocument insertPage: originalPage atIndex: i];
[[someDocument pageAtIndex: i] setDocument: someDocument];
This should have no ill effect on Leopard.
john calhoun—_______________________________________________
Cocoa-dev mailing list (<email_removed>)
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://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
DATE : Thu Jan 03 22:41:42 2008
On Jan 2, 2008, at 1:40 PM, Jerry LeVan wrote:
> For reasons that are not clear to me I had to keep the "pages" until
> I was
> finished with the PDF document in Tiger. For Leopard this was not
> necessary...
This was a bug in PDFKit in Tiger. My recollection is that when you
added a PDFPage to a document, PDFDocument made a copy of the PDFPage
and retained that, but did not tell the copy of its new owning document.
Recall that PDFPage has a -[document] method that returns the "ownnig"
document. To accomplish this a PDFPage has a weak reference to the
PDFDocument that it is a part of. A private call to -[PDFPage
setDocument:] is made by the PDFDocument when you add a page. The bug
is that while a copy of the page is created and retained, -
[setDocument:] is called on the original PDFPage. I'm not quite clear
on why you should have to keep the original pages around however....
A workaround for Tiger might be to call the private -[setDocument:]
call yourself after adding the page to a document. Something like:
[someDocument insertPage: originalPage atIndex: i];
[[someDocument pageAtIndex: i] setDocument: someDocument];
This should have no ill effect on Leopard.
john calhoun—_______________________________________________
Cocoa-dev mailing list (<email_removed>)
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://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Jerry LeVan | Dec 21, 20:56 | |
| Nick Zitzmann | Dec 22, 21:29 | |
| Jerry LeVan | Dec 23, 04:28 | |
| John Calhoun | Jan 2, 22:25 | |
| Jerry LeVan | Jan 2, 22:40 | |
| John Calhoun | Jan 3, 22:41 | |
| Uli Kusterer | Jan 9, 18:44 | |
| Jerry LeVan | Jan 9, 19:21 | |
| John Calhoun | Jan 15, 00:20 | |
| Jerry LeVan | Jan 15, 00:59 |






Cocoa mail archive

