PDF setCurrentPage OS Bug ?
PDF setCurrentPage OS Bug ?
- Subject: PDF setCurrentPage OS Bug ?
- From: Robert Miller <email@hidden>
- Date: Fri, 20 Jul 2001 15:03:24 -0400
- Organization: RFM & Associates
Hello,
I'm trying to display PDF files using NSImage which has an
NSPDFImageRep., The first page displays OK but when I call the
setCurrentPage method for the image rep nothing seems to happen. I call
the [myImage recache] method and that doesn't force any display change
either. The image has setDataRetained set to TRUE so recaching will
occur. Below is the code
-(void)setCurrentPage:(int)pageNum
{
currentPage = pageNum;
if (currentPage < 0)
currentPage = pageCount;
if (currentPage >= pageCount)
currentPage = 0;
if (theNSImage != nil) {
NSArray *reps = [theNSImage representations];
unsigned index;
unsigned count = [reps count];
for (index = 0; index <count; index++) {
NSPDFImageRep *irep = [reps objectAtIndex:index];
if ([irep isKindOfClass:[NSPDFImageRep class]]) {
[theNSImage recache];
[irep setCurrentPage:currentPage];
[self setNeedsDisplay:YES];
break;
}
}
}
}
is there some other setting(s) that have to be changed to display a
different page(s)???
Any help is greatly appreciated.
Thanks
Bob M.