I’m Using PDF.JS
I want to make a custom button that add image/s previously stored as base64 on hidden field loaded with the page and add it to pdf viewer by a custom function
EX:
function AddStamp(){
var base64Data = 'JVBERi0xLjMNCiXi48/TDQoNCjEgMCBvYmoNCj......';
PDFViewerApplication.pdfViewer.addImage...(base64Data)
}
The PDF viewer have already a button (Add Image) that button opened file input and you have to select a file from your device to show the selected file, but what I need is to use same functionality but with existing image as base64 format.
PDF Viewer Function Example
I’m include the following file
viewer.js
build/pdf.js
I have a look at global class that provided by PDF.JS
There is no clear documentation either
PDFViewerApplication
PDFViewerApplication.pdfDocument
PDFViewerApplication.pdfViewer
but I have no luck no figure it out
Developer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.