• 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: "Adam R. Maxwell" <email@hidden>
  • Date: Tue, 27 Mar 2007 18:12:08 -0700


On Mar 27, 2007, at 17:40, 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];

However, on the very first time -setDocument: is called, the view appears completely grey on the screen, meaning it's not displaying anything. If I use the zoom controls once, then the "document" appears but is completely blank. If I use them again, then and only then does the document display correctly. Also, the -setAutoScales: option is ignored the first time, although if I call this again with different PDF data, then it works.

Have you tried calling [pdfView setDocument:document] before setAutoScales:? ISTR having a similar problem long ago, and that code is working fine now with just setDocument:. You shouldn't need to send layoutDocumentView or setNeedsDisplay:YES.


-- Adam

_______________________________________________

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


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

  • Prev by Date: Bindings, Core Data, and memory
  • Next by Date: Re: PDFView won't display the first time?
  • Previous by thread: PDFView won't display the first time?
  • Next by thread: Re: PDFView won't display the first time?
  • Index(es):
    • Date
    • Thread