Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDFView won't display the first time?




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.