Web Service Binding & Export PDF

5 posts, 0 answers
  1. Mehmet
    Mehmet avatar
    100 posts
    Member since:
    Jun 2014

    Posted 10 Sep 2014 Link to this post

    Hi,

    I couldn't achieve of exporting a pdf file with my web service binding scheduler.

    Isn't it possible?

    I would like to know whether it is possible to do it with a JS code in my aspx page. If it doesn't work, I don't have any binding criteria in my back end code. How could be possible to do that ?

    thank you
  2. Mehmet
    Mehmet avatar
    100 posts
    Member since:
    Jun 2014

    Posted 11 Sep 2014 Link to this post

    any idea of exporting a pdf on Client side?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 15 Sep 2014 Link to this post

    Hi,

    RadScheduler only supports Export to PDF out of the box when bound on the Server. If you want to export on the client you will have to use a third party solution.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Mehmet
    Mehmet avatar
    100 posts
    Member since:
    Jun 2014

    Posted 15 Sep 2014 Link to this post

    such as?
  6. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 17 Sep 2014 Link to this post

    Hello,

    You can use for instance the following libraries:
    http://html2canvas.hertzen.com/
    http://parall.ax/products/jspdf

    Here's the sample code which uses these two libraries to capture an image of the Scheduler and then exprot it to PDF:
    function exportScheduler() {
     
        var doc = jsPDF("landscape", "pt", "a2");
     
        html2canvas(document.getElementById("RadScheduler1"), {
            onrendered: function(canvas) {
                var data = canvas.toDataURL("image/jpeg");
                var pageWidth = doc.internal.pageSize.width;
                var pageHeight = doc.internal.pageSize.height;
                var width = canvas.width;
                var height = canvas.height;
     
                doc.addImage(data, "JPEG", (pageWidth - width) / 2, (pageHeight - height) / 2, width, height);
                doc.save("scheduler.pdf");
            }
        });
    }


    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017