Telerik Forums
Kendo UI for jQuery Forum
4 answers
22 views

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.

Kheng Aik
Top achievements
Rank 1
Iron
 answered on 20 Aug 2025
0 answers
54 views

I have been looking at kendo.drawing to render some charts to PDF and that has been working. Now we have the need to automate rendering the charts and attaching them to an email which then gets sent as part of a batch process.

Is it possible to invoke kendo.drawing.drawDom and kendo.saveAs from the server side?

Jay
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 18 Nov 2024
1 answer
72 views

Hello,

Can anyone help me locate references or documentation on how to customize the SVG of a linear Gauge?

Basically, I want to create a Battery Gauge. (example attached)

 

 

Neli
Telerik team
 answered on 01 Mar 2024
2 answers
261 views

I'm trying to set margins when exporting to PDF using the Drawing API and can't get it to work. Here is a dojo. When you click the button to get the PDF, there is no margin around the chart. I'm assuming I'm doing something wrong, but not quite sure what.

Nikolay
Telerik team
 answered on 09 Feb 2024
1 answer
456 views
I am trying to attach pdf file to email and send email notifications to users. Problem is when try to use kendo.saveAs its opening in another window .  If user browser is having pop up block, the email function is not working as it is not allowing open other window. Is there any way that i can do this in same window or any other option?
$.ajax({
                        type: "POST",
                        data: data,
                        url: "IUA/Submit",
                        success: function (result) {
                            if (result.Id !== 0) {
                                alert("Your application has completed the review phase and is confirmed complete. Your PIN will be " + result.Id + ". To complete your submission, please click the OK button below.");
                                $('#loading').hide();

                                kendo.drawing.drawDOM($("#mainDiv"))
                                    .then(function (group) {
                                        // Render the result as a PDF file
                                        return kendo.drawing.exportPDF(group, {
                                            paperSize: "auto",
                                            margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
                                        });
                                    })
                                    .done(function (data) {
                                        // Save the PDF file
                                        kendo.saveAs({
                                            type: 'POST',
                                            dataURI: data,
                                            fileName: "IUAEnrollment.pdf",
                                            proxyURL: '@Url.Action("SavePDF", "IUA")',
                                            forceProxy: true,
                                            proxyTarget: "_blank"
                                        });
                                        displayLoading("#formDiv", false);
                                        location.reload();
                                    });
                            } else if (result.IsDuplicateRec == true) {
                                $('#loading').hide();
                                $("#divDuplicate").show();
                                $("#captchaDiv").load(location.href + " #captchaDiv>*", "");
                            } else if (result.IsMVCCaptcha == false) {
                                $('label[for="lblCaptchaErr"]').show();
                                $("#captchaDiv").load(location.href + " #captchaDiv>*", "");
                                setTimeout(WaitUntilLoad, 6000);
                            }
                        },
                        error: function () {
                            $('#loading').hide();
                            alert("Error occured during the submission. Please contact helpdesk.");
                        }
                    });
Martin
Telerik team
 answered on 28 Jun 2023
1 answer
118 views

Hi,

Is there any way to set the standard print options like "fitting content to print area" or "standard print page size'" while creating a PDF from the drawing API?

    let pdfOptions = {
        paperSize: 'a3'
        landscape: true,
       

//something like this
      printOptions = {
             fitContentToPrintArea: true,
             paperSize: 'a4'
       }
    };

        kendo.drawing.exportPDF(root, pdfOptions).done(function (data) {
            kendo.saveAs({
                dataURI: data,
                fileName: fileName
            });
        });

 

Neli
Telerik team
 answered on 07 Jun 2023
1 answer
127 views

Hi everyone, I would like to ask for your help.
I would like to hide the SubItems when the drawer is in mini mode, if I click on each element.

Thanks in Advance

https://dojo.telerik.com/ejapuWiB/3

Dayan K

 

Nikolay
Telerik team
 answered on 02 May 2022
17 answers
1.6K+ views
I am using the the examples on this page (http://demos.telerik.com/kendo-ui/pdf-export/index) to export my view to pdf.  I noticed that the image did not export with the pdf also the  fields are over lapping after export.  Is there a property or style attribute I need to use to fix this?


Garun
Top achievements
Rank 1
Iron
 answered on 06 Apr 2022
2 answers
128 views

Attached  two files for your reference.

Code snippet is as below :- 

$scope.MonthlyExportStatement = function() {
        $scope.MonthlyDownloadButton = "Downloading...";
        kendo.drawing.drawDOM(".monthly-pdf-page", {
            paperSize: "A3",
            margin: "1cm",
            multiPage: true,
        }).then(function(group){
            kendo.drawing.pdf.saveAs(group, "test.pdf");
            setTimeout(function(){
                $scope.MonthlyDownloadButton = "Download PDF";
                $scope.$apply();
            });
        });
}

For actual image please refer image 2. While downloading PDF with kendoUI, Image is getting cut off.  What was wrong with above code ? Please assist me ASAP.

Aniket
Top achievements
Rank 1
Iron
 answered on 09 Feb 2022
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
SPA
Filter
Drawer (Mobile)
Globalization
Gauges
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?