-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
So I'm trying to load a pdf created with jspdf using a custom font, but when I try to load the file in a webview it appears as an empty pdf, if I don't use the custom it shows the text but if I try to use a font the text disappear. The pdf created with the custom font works in Firefox, Chrome, and Edge.
This is a piece of code to exemplify what I'm trying to do.
const PDFWindow = require('electron-pdf-window');
const fs = require('fs');
let webview = document.querySelector("webview");
webview.webContents = webview.getWebContents();
PDFWindow.addSupport(webview);
let doc = new jsPDF();
doc.setFont("Roboto-Regular"); // if I coment this it works
doc.setFontSize(8);
doc.setFontType('bold');
doc.text('Hello world!', 10, 10)
let file = doc.output();
fs.writeFile(name_of_file, file, 'utf8', function(err){
webview.loadURL(path_to_file);
$("#modalPDF").modal();
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels