• 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 in layer backed view appears white
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PDFView in layer backed view appears white


  • Subject: PDFView in layer backed view appears white
  • From: Memo Akten <email@hidden>
  • Date: Mon, 6 Apr 2009 14:31:00 +0100

Hi, I would like to add a PDFView to another view. But if my root view is layer backed I see nothing (just white). If I disable layer backing, pdf appears fine.

My code is:
NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:nil inDirectory:folder];
PDFDocument* pdf = [[[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:path]] autorelease];
PDFView *pdfView = [[[PDFView alloc] initWithFrame:[[pdf pageAtIndex: 0] boundsForBox:kPDFDisplayBoxCropBox]] autorelease];
[pdfView setDocument:pdf];
[pdfView goToFirstPage:self];
[pdfView setDisplayMode:kPDFDisplaySinglePage];
[uiView addSubview:pdfView];
[uiView setWantsLayer:YES];



Is this normal behaviour? Is there anyway to display PDF's in a layer backed view? I only want to display a single PDF page, no need to select text, navigate pages, scroll etc. Just static display.


I was using the following code to draw the PDF into an image and display that, but then when the view is scaled it doesn't display very sharp (not vector anymore).
PDFPage* page = [pdf pageAtIndex:0];
NSData* rawData = [page dataRepresentation];
NSImage* image = [[[NSImage alloc] initWithData:rawData] autorelease];


Cheers,

Memo.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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 in layer backed view appears white
      • From: John Calhoun <email@hidden>
  • Prev by Date: Re: Equivalent of Redraw(MFC) on Cocoa
  • Next by Date: RE: IB Plugin help
  • Previous by thread: Re: Regarding NSScroller
  • Next by thread: Re: PDFView in layer backed view appears white
  • Index(es):
    • Date
    • Thread