Bug with PDF Maker

Bug with PDF Maker

cdelcidcdelcid Posts: 1Questions: 1Answers: 0

Hi. I downloaded a datatables script build from this very page. I keep getting this error when pressing the PDF button:

uncaught exception: File 'Roboto-Regular.ttf' not found in virtual file system

I tried placing the content from vfs_fonts.js after the content from pdfmake.min.js in datatables.js, but no luck. Does anyone know why this is happening and how can I solve it? Thanks.

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    This is what the download builder gives for me when I select jQuery, Buttons, HTML5 export and pdfmake:

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jqc-1.12.3/dt-1.10.16/b-1.4.2/b-html5-1.4.2/datatables.min.css"/>
     
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/v/dt/jqc-1.12.3/dt-1.10.16/b-1.4.2/b-html5-1.4.2/datatables.min.js"></script> 
    

    That appears to work for me: http://live.datatables.net/lenaqezi/1/edit .

    The error you are seeing happens if vfs_fonts is included before pdfmake, but you note that you've got it the correct way around, so I'm not sure what the issue is I'm afraid.

    Allan

  • AllenSongAllenSong Posts: 1Questions: 0Answers: 0

    Yes, I had similar issue and found: the function is working perfectly fine; the only issue is downloading from CDN libs takes too long time; So simply download it and add to your local folder, it will stably working fine.

This discussion has been closed.