This is a migrated thread and some comments may be shown as answers.

drawDOM export table with icons to PDF

1 Answer 36 Views
Drawing API
This is a migrated thread and some comments may be shown as answers.
Amarbir
Top achievements
Rank 1
Amarbir asked on 03 Apr 2019, 07:29 PM

Hi,

I have tried a whole bunch of the suggestions before posting here.I cannot get the pdf export to put in icons I have in my table. The table uses custom fonts and I am loading ttf fonts and everything. I am putting here table html as rendered that needs to be output. the css declaraitons and javascript code for pdf.

1. Markup - Attached in zip

2. Font Declarations: 2

@font-face {
  font-family: 'cicon';
  srcurl('fonts/cicon.eot?c4pj34');
  srcurl('fonts/cicon.eot?c4pj34#iefix') format('embedded-opentype'),
    url('fonts/cicon.ttf?c4pj34') format('truetype'),
    url('fonts/cicon.woff?c4pj34') format('woff'),
    url('fonts/cicon.svg?c4pj34#cicon') format('svg');
  font-weight: normal;
  font-style: normal;
}

3. Javascript to produce pdf:

$('div.div-action-btns').hide();
          $('#export-pdf').hide();
          var draw = kendo.drawing;
          draw.drawDOM($('#div-grid-container'),{avoidLinks: true})
              .then(function (root) {
                  return draw.exportPDF(root, {
                      landscape: true,
                      paperSize:"auto"
                  });
              })
              .done(function (data) {
                  kendo.saveAs({
                      dataURI: data,
                      fileName: 'Lane-Assignments' + window.Stf.Utility.formatShortDate(new Date()) + '.pdf'
                  });
                  $('div.div-action-btns').show();
                  $('#export-pdf').show();
           
              });

4. Output PDF - Attached in zip

I need urgent help on this please.

 

 

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 05 Apr 2019, 12:56 PM
Hi Amarbir,

May I ask you to send us a fully runnable example reproducing the issue described, so we can test the scenario locally? Please, include in that sample the TreType font file used, so we will be able to properly replicate the case. Note also, that the PDF generator supports only TrueType fonts with Unicode mapping.

Looking forward to hearing from you.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Drawing API
Asked by
Amarbir
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or