• 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 with a 'small' frame
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PDFView with a 'small' frame


  • Subject: PDFView with a 'small' frame
  • From: Phil <email@hidden>
  • Date: Sat, 17 Sep 2005 21:32:02 -0400

I've noticed some strange behavior creating PDFViews programatically (i.e. this doesn't seem to happen if I create the PDFView in a window using IB which tells me something required is not being set?) and am hoping someone will have some insight as to what is missing.

It seems that if the frame size is small enough (in trying different settings it appears that this is just about any value smaller than the size of what PDFPage boundsForBox: returns for the height or width), then the PDFView will go into a state of constant refresh or will remain grey and go to 100% CPU utilization. Here's a code snippet to create the PDFView as subview which illustrates the problem:

    PDFDocument *newDoc;
    PDFView *thispdfview;
    NSURL *theURL;
    theURL = [NSURL fileURLWithPath: @"<PDF filename>"];
    newDoc = [[PDFDocument alloc] initWithURL: theURL];

// NSRect myRect = { { 0,0 }, { 150, 200 } }; // this doesn't work so well
NSRect myRect = { { 0,0 }, { 700, 900 } };


    thispdfview = [[PDFView alloc] init];
    [thispdfview setDocument: newDoc];
    [thispdfview setFrame: myRect];
    [thispdfview goToPage: [newDoc pageAtIndex: 0]];
    [self addSubview: thispdfview];

This form works as expected. However, if you replace the NSRect definition with the commented version the issue is observed.

Phil

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: PDFView with a 'small' frame
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: retain & release
  • Next by Date: Re: PDFView with a 'small' frame
  • Previous by thread: Animating Drag and Drop
  • Next by thread: Re: PDFView with a 'small' frame
  • Index(es):
    • Date
    • Thread