You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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();
});
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: