If you are creating the document programmatically, i.e
pdfDoc = new PDFDocument(strFilePath, null);
the context is not getting set.
If you wish to load your PDF document before opening it in the viewer, you will need to use the constructor that takes the context as a parameter, i.e:
pdfDoc = new PDFDocument(new FilePDFSource(strFilePath), null, context);
where context is your current Activity.