Hi,
I am using Font Awesome in my website, and i use kendo.drawing.drawDOM to export the content of browser to save as PDF.
I have no issue when using Font Awesome v6.x, but after upgrade to v7, it throws exception as below:
Uncaught Error: Table loca not found in directory
at Directory.readTable (kendo.all.js?v=MqxEUy3L2C5M1NNIrnRwFVhryZ5lhiNwICBm4cSuw5c:42392:19)
at TTFFont.parse (kendo.all.js?v=MqxEUy3L2C5M1NNIrnRwFVhryZ5lhiNwICBm4cSuw5c:43552:25)
at new TTFFont (kendo.all.js?v=MqxEUy3L2C5M1NNIrnRwFVhryZ5lhiNwICBm4cSuw5c:43544:18)
at kendo.all.js?v=MqxEUy3L2C5M1NNIrnRwFVhryZ5lhiNwICBm4cSuw5c:43844:32
at XMLHttpRequest.<anonymous> (kendo.all.js?v=MqxEUy3L2C5M1NNIrnRwFVhryZ5lhiNwICBm4cSuw5c:43823:21)
$(document).on({
"click": function (e) {
e.preventDefault()
// Embed external fonts into pdf
kendo.pdf.defineFont({
"Font Awesome 7 Brands":
"/fonts/FontAwesome/fa-brands-400.ttf",
"Font Awesome 7 Free":
"/fonts/FontAwesome/fa-regular-400.ttf",
"Font Awesome 7 Solid":
"/fonts/FontAwesome/fa-solid-900.ttf",
"DejaVu Sans":
"https://cdn.kendostatic.com/2023.1.117/styles/fonts/DejaVu/DejaVuSans.ttf",
"DejaVu Sans|Bold":
"https://cdn.kendostatic.com/2023.1.117/styles/fonts/DejaVu/DejaVuSans-Bold.ttf",
"DejaVu Sans|Bold|Italic":
"https://cdn.kendostatic.com/2023.1.117/styles/fonts/DejaVu/DejaVuSans-Oblique.ttf",
"DejaVu Sans|Italic":
"https://cdn.kendostatic.com/2023.1.117/styles/fonts/DejaVu/DejaVuSans-Oblique.ttf"
})
kendo.drawing.drawDOM($("#Body"), {
landscape: false,
paperSize: "B2",
margin: "2cm",
forcePageBreak: ".page-break"
}).then(function (group) {
kendo.drawing.pdf.saveAs(group, siteShortName + "-Snap-" + new Date().getTime() + ".pdf")
})
}
}, "#Snap")
Do you able to tell what may cause the error? I am using online free font converter to convert woff2 to ttf as v7 no longer provide ttf. v7 is now using css variable.
Thanks.