• 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: PDFView won't display the first time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDFView won't display the first time?


  • Subject: Re: PDFView won't display the first time?
  • From: John Calhoun <email@hidden>
  • Date: Tue, 27 Mar 2007 18:32:48 -0700


On Mar 27, 2007, at 5:40 PM, Nick Zitzmann wrote:
NSData *pdfData = [myView dataWithPDFInsideRect:[myView frame]];
PDFDocument *document = [[[PDFDocument alloc] initWithData:pdfData] autorelease];


   [pdfView setAutoScales:YES];
   [pdfView setDocument:document];
   [pdfView layoutDocumentView];
   [pdfView setNeedsDisplay:YES];

The last two lines above are not needed since calling -[PDFView setDocument:] will internally re-layout the document view and mark itself dirty. Might as well remove those lines.


Otherwise, I don't see why you would get the gray view that you describe. Are you sure that the PDFView (in your NIB) is instantiated?

Also, the -setAutoScales: option is ignored the first time, although if I call this again with different PDF data, then it works.

On Tiger, I think this was a bug (as was pointed out) where you need to call -[PDFView setDocument] before playing with the display parameters like auto-scaling, etc.


Can we see more code?  A small sample app would be nice to look at.....

Also, I have to ask, have you tried this on Leopard? FWIW, your code probably works as is. Just curious anyway....

john calhoun—_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >PDFView won't display the first time? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Simple Cocoa bindings question
  • Next by Date: Re: PDFView won't display the first time?
  • Previous by thread: Re: PDFView won't display the first time?
  • Next by thread: [KIND OF SOLVED] Re: PDFView won't display the first time?
  • Index(es):
    • Date
    • Thread