0

I'm working on a project that views PDFs pulled from the internet. I was working with a UIWebView, but then I switched to PSPDFKit because it looks a whole lot better, with additional features. When I use the code below, the view loads, but the PDF does not.

[self setSelectedObject:(CateRegulations*)[[theDictionary valueForKey:[[[self.theDictionary allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]objectAtIndex:indexPath.section-1]] objectAtIndex:indexPath.row]];
NSString *path = selectedObject.url;
PSPDFDocument *document = [PSPDFDocument PDFDocumentWithUrl:[NSURL fileURLWithPath:path]];
PSPDFViewController *objPdfViewController=[[PSPDFViewController alloc] initWithDocument:document];


[self.navigationController pushViewController:objPdfViewController animated:YES];
[objPdfViewController release];

My debugger reads as follows:

2011-09-25 21:06:29.494 Project[4509:12b03] Error: -[PSPDFDocument rectBoxForPage:]/224 Warning: Returning empty rect.
2011-09-25 21:06:29.495 Project[4509:12b03] Error: -[PSPDFPage displayDocument:page:pageRect:scale:]/92 Warning: Invalid page rect given: {{0, 0}, {0, 0}}
2011-09-25 21:06:29.495 Project[4509:12b03] Error: -[PSPDFViewController scrollToPage:animated:hideHUD:]/1027 Error: Cannot scroll outside boundaries(0), scrolling to last page.
2011-09-25 21:06:29.495 Project[4509:14503] Error: -[PSPDFCache enqueueItem:]/608 Warning: Page is invalid: 0 (pageCount: 0)
2011-09-25 21:06:29.498 Project[4509:12b03] Error: -[PSPDFDocument rectBoxForPage:]/224 Warning: Returning empty rect.
2011-09-25 21:06:29.498 Project[4509:12b03] Error: -[PSPDFPage displayDocument:page:pageRect:scale:]/92 Warning: Invalid page rect given: {{0, 0}, {0, 0}}
2011-09-25 21:06:29.498 Project[4509:12b03] Error: -[PSPDFViewController scrollToPage:animated:hideHUD:]/1027 Error: Cannot scroll outside boundaries(0), scrolling to last page.
2011-09-25 21:06:29.498 Project[4509:14503] Error: -[PSPDFCache enqueueItem:]/608 Warning: Page is invalid: 0 (pageCount: 0)
2011-09-25 21:06:29.531 Project[4509:14503] Error: -[PSPDFDocument pathForPage:]/303 Warning: Path for page 0 is missing!
2011-09-25 21:06:29.532 Project[4509:14503] Error: -[PSPDFGlobalLock openPDFDocumentWithPath:]/50 Error: pdfPath is nil!
2011-09-25 21:06:29.532 Project[4509:14503] Error: -[PSPDFGlobalLock openPDFWithPath:page:]/89 Error: As pdfDocument is nil, aquiring pageRef failed.
2011-09-25 21:06:29.532 Project[4509:14503] Error: -[PSPDFTilingView drawLayer:inContext:]/208 Missing PDF IMAGE FOR <PSPDFDocument uid:2100.2A.pdf files:1 pageCount:0>
2011-09-25 21:06:30.495 Project[4509:18803] Error: __45-[PSPDFCache cacheDocument:startAtPage:size:]_block_invoke_0/802 Warning: startPage:0 to high, resetting to 1.
2011-09-25 21:06:30.496 Project[4509:18803] Error: -[PSPDFCache enqueueItem:]/608 Warning: Page is invalid: 1 (pageCount: 0)
2011-09-25 21:06:30.496 Project[4509:18803] Error: -[PSPDFCache enqueueItem:]/608 Warning: Page is invalid: 0 (pageCount: 0)
2011-09-25 21:06:31.499 Project[4509:18803] Error: __45-[PSPDFCache cacheDocument:startAtPage:size:]_block_invoke_0/802 Warning: startPage:0 to high, resetting to 1.
2011-09-25 21:06:31.500 Project[4509:18803] Error: -[PSPDFCache enqueueItem:]/608 Warning: Page is invalid: 1 (pageCount: 0)
2011-09-25 21:06:31.500 Project[4509:18803] Error: -[PSPDFCache enqueueItem:]/608 Warning: Page is invalid: 0 (pageCount: 0)
jscs
  • 63,694
  • 13
  • 151
  • 195

1 Answers1

0

check your url may be it is empty

Tendulkar
  • 5,550
  • 2
  • 27
  • 53