• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSImage to PDFPage in Tiger?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage to PDFPage in Tiger?


  • Subject: Re: NSImage to PDFPage in Tiger?
  • From: John Calhoun <email@hidden>
  • Date: Thu, 3 Jan 2008 13:41:42 -0800

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@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSImage to PDFPage in Tiger?
      • From: Uli Kusterer <email@hidden>
References: 
 >Re: NSImage to PDFPage in Tiger? (From: John Calhoun <email@hidden>)
 >Re: NSImage to PDFPage in Tiger? (From: Jerry LeVan <email@hidden>)

  • Prev by Date: Re: use finalize for removing AppleEvent handlers in GC apps?
  • Next by Date: Re: use finalize for removing AppleEvent handlers in GC apps?
  • Previous by thread: Re: NSImage to PDFPage in Tiger?
  • Next by thread: Re: NSImage to PDFPage in Tiger?
  • Index(es):
    • Date
    • Thread