我需要在可滚动范围内制作 pdf,因为画布宽度和高度为 900x800,我想使用客户端代码下载并打印显示的 pdf。
var rob = service.standard.call.payslipPdf.get(payslip).Ev_pdf; //odata service call for pdf base64 data
var pdfText = decode64(rob);
debugger;
var rawLength = pdfText.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for (i = 0; i < rawLength; i++) {
array[i] = pdfText.charCodeAt(i);
}
PDFJS.disableWorker = true;
PDFJS.workerSrc = '/module/mycompensation/build/pdf.js';
PDFJS.getDocument(array).then(function (pdf) {
//code to render pdf on canvas
});