objective c - PSPDFKit taking long time to give error `documentRef is nil , cannot get pageRef` -
i have used code :
nsurl *documenturl= [nsurl fileurlwithpath:astrprintpdfpath isdirectory:no]; pspdfdocument *document = [pspdfdocument documentwithurl:documenturl]; pspdfviewcontroller *pdfcontroller = [[pspdfviewcontroller alloc] initwithdocument:document]; pdfcontroller.pagetransition = pspdfpagetransitioncurl; pdfcontroller.renderingmode = pspdfpagerenderingmodefullpageblocking; [pdfcontroller setupdatesettingsforrotationblock:^(pspdfviewcontroller *apdfcontroller, uiinterfaceorientation tointerfaceorientation) { // conditionally set depending on rotation if (uiinterfaceorientationislandscape(tointerfaceorientation)) { apdfcontroller.pagemode = pspdfpagemodedouble; } else { apdfcontroller.pagemode = pspdfpagemodesingle; } }]; uinavigationcontroller *navcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:pdfcontroller]; [self presentviewcontroller:navcontroller animated:yes completion:null]; pdfcontroller.title = @""; [pdfcontroller release]; [navcontroller release];
now problem
takes around 30 50 seconds
give these error : error: nserror *pspdferror(nsinteger, nsstring *_strong, nserror *_autoreleasing *)/35 error 210: documentref nil; cannot pageref
page 1. hanging ui completetly
, opens
pdfcontroller
nothing
this main developer of pspdfkit.
when "documentref nil; cannot pageref" - means pdf source used create pspdfdocument invalid. check isvalid
property on document test programmatically.
i'm not sure on version are, @ least 3.x not block ui thread, show empty view controller that's waiting set different document.
Comments
Post a Comment