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

PDFView won't display the first time?


  • Subject: PDFView won't display the first time?
  • From: Nick Zitzmann <email@hidden>
  • Date: Tue, 27 Mar 2007 18:40:16 -0600

I've done some searching on this subject but haven't found anything that has worked.

I have a view which is used for printing things. I'm taking the PDF data for the view and trying to display it in a PDFView that is instantiated in the nib. Here is what I'm doing:

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.

What's going on here? Is there anything I can do to get the PDF to display correctly the first time?

Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________

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:
    • [KIND OF SOLVED] Re: PDFView won't display the first time?
      • From: Nick Zitzmann <email@hidden>
    • Re: PDFView won't display the first time?
      • From: John Calhoun <email@hidden>
    • Re: PDFView won't display the first time?
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: Re: FSPathFileOperationStatusProcPtr callback error: -8081
  • Next by Date: Bindings, Core Data, and memory
  • Previous by thread: Re: Drawing to a PDF Context
  • Next by thread: Re: PDFView won't display the first time?
  • Index(es):
    • Date
    • Thread