I have an application with PDF viewer, and I try to use PDFKit.PDFView
which need to PDFKit.PDFDocument
object.
My code is:
var pdfview = new PdfKit.PdfView();
var path = NSBundle.MainBundle.PathForResource("Harvard", "pdf");
var urll = new NSUrl(path);
var pdfdoc = new PdfDocument(urll);
pdfview.Document = pdfdoc;
I get an exception at line 4, which says :
Could not initialize an instance of the type 'PdfKit.PdfDocument': the native 'initWithURL:' method returned nil
My pdf file, Harvard.pdf, is in Resources folder and in direct iOS project directory with BundleResource build action.
this PDF file can be read easily with CGPDFDocument
, but I need to use PDFView
to solve problem I asked for it before in
handle links clicking inside PDF viewer on iOS with swift.
So, can anyone help me please?