How to view .pdf file inside a folder in app using file system


it’s bugging me for hours now and I cant get it to work.

I took reference from the following :
Preview/Read a .pdf file inside Nativescript application
File-system: where is the "documents" folder?

heres my current code:


<StackLayout class="page-content">
    <pdf:PDFView src="{{ pdfUrl }}"/>



const AboutViewModel = require("./aboutustp-view-model");
const fs = require("tns-core-modules/file-system");
const documents = fs.knownFolders.currentApp();

var filename = "handbook.pdf";

const filepath = fs.path.join(documents.path, "documents", filename);
console.log("pdf folder path : " + filepath);
this.pdfUrl = filepath;

function onLoaded(args) {
    const component = args.object;
    component.bindingContext = new AboutViewModel();

exports.onLoaded = onLoaded;

How can I view/display the PDF itself on the app using this?

Preview/Read a .pdf file inside Nativescript application

Are you sure you have the file at that path?
Are you using Webpack, if yes did you made necessary config changes to keep the file copied during build?
Did you check whether file exists using the exists method in file system?
Do you see any errors in console?