πPDF Viewer
View PDF files instantly within the app environment, eliminating the need to download the document first or redirect the user to an external device browser
Last updated
View PDF files instantly within the app environment, eliminating the need to download the document first or redirect the user to an external device browser
Last updated
// Open from URL with Download Button
window.natively.openPDF({
url: 'https://example.com/documents/guide.pdf',
fileName: 'UserGuide.pdf',
download: true
}, (response) => {
console.log('PDF Viewer action:', response);
});
// Open from Base64 Data
window.natively.openPDF({
base64: 'JVBERi0xLjMKJcTl8uXrp...', // Truncated for brevity
fileName: 'GeneratedReport.pdf',
download: false
}, (response) => {
if (response.status === 'FAILED') {
console.error(''PDF Viewer action:', response.message);
}
});
//Response structure
{
"status": "SUCCESS", // or "FAILED" if an error occurred
"message": "PDF viewed successfully" // or error message
}