Unable to download pdf in iphone and ipad

12 posts, 0 answers
  1. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 15 Feb Link to this post

    Hi,

    I am using Kendo UI v2016.2.714. We have an issue in downloading the pdf in iphone and ipad. It is working perfectly in all other systems.

    The method we are using to generate pdf is as below.

    function download(selector) {
        kendo.drawing.drawDOM($(selector)).then(function(group){
            group.options.set("pdf", {
                paperSize: "auto",
                margin: {
                    left   : "1cm",
                    top    : "1cm",
                    right  : "1cm",
                    bottom : "1cm"
                }
            });
            kendo.drawing.pdf.saveAs(group, "test.pdf");
        });
    }

     

    Have any one of you faced similar issue? Please help us to fix this.

     

    Thanks,

    Anusha

  2. Dimitar
    Admin
    Dimitar avatar
    400 posts

    Posted 16 Feb Link to this post

    Hi Anusha,

    Exporting PDF on Safari and IE 9 is a little peculiar, as these browsers are not capable of saving files locally. This is marked in the known Kendo PDF export limitation section.
    The setup requires a proxyURL configuration for IE 9 and Safari browsers, also described in PDF Drawing Backend help section.
    More information about proxyURL is described in the pdf.proxyURL Grid's configuration articles and in kendo saveAs method article.

    PDF Export's demo Document Export shows how a proxyURL is set up. It uses Kendo UI demos services project , which shows a sample backend setup.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 16 Feb in reply to Dimitar Link to this post

    Hi Dimitar,

    We were able to fix it by using proxyurl. 

    Thanks,

    Anusha

  4. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 22 Feb Link to this post

    Hi Dimitar,

     

    We have noticed that when we are trying to download pdfs in safari, it s working as expected. But when we do it in chrome, pdfs were opening sporadically. On an iPhone and iPad, if we held our finger on the download link for a little while, we got the following options: save image; copy; and cancel. Other times, the link would just open and then disappear. 

     

    Thanks,

    Anusha

  5. Dimitar
    Admin
    Dimitar avatar
    400 posts

    Posted 23 Feb Link to this post

    Hi Anusha,

    The described issue sounds like an option prompted by Chrome to select some content on long tap over it. A solution for it is described in the following StackOverflow thread. It does not sound like something specifically related to Kendo UI or PDF export. If the provided solution does not resolve the issue, it would be helpful if you provide a runnable Dojo sample to reproduce and debug the problem on our side.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  6. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 14 Mar in reply to Dimitar Link to this post

    Hi Dimitar,

    User is not able to download the pdf in chrome in ipad and iphone. We have created a Dojo example. 

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

    In our script we have provided proxy url as well. But in Dojo example, we have't provided the URL. Kindly help us to resolve the issue.

    Thanks,

    Anusha

  7. Dimitar
    Admin
    Dimitar avatar
    400 posts

    Posted 15 Mar Link to this post

    Hi Anusha,

    The drawDOM configuration provided in the Dojo does not work on my side. The following one works, I commented the old non-working part:

    function getPDF(selector) {
        kendo.drawing.drawDOM($(selector))
            .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" }
                });
            })
            //.then(function (group) {
            //    group.options.set("pdf", {
            //        paperSize: "auto",
     
            //        margin: {
            //            left: "1cm",
            //            top: ".5cm",
            //            right: "1cm",
            //            bottom: "1cm"
            //        }
            //    });
            //    //kendo.drawing.pdf.saveAs(group, "sample.pdf");
            //})
            .done(function (data) {
                // Save the PDF file
                kendo.saveAs({
                    dataURI: data,
                    fileName: "sample.pdf",
                    proxyURL: "@Url.Action("Pdf_Export_Save")"
                });
            });
     };

    I am sending you a working MVC project based on the Telerik UI for ASP.NET MVC PDF Export demo, which incorporates the proxyURL implementation without contacting a remote export service. The Index.cshtml file contains the fixed script from the Dojo. The project exports to PDF as expected on iOS Chrome.

    Best regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  8. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 16 Mar in reply to Dimitar Link to this post

    Hi Dimitar,

    Thank you for your reply. We are working in java. We tried using the script you have provided. But now the "Open In" popup is coming, but no applications are displayed over there. We have installed pdf reader. We have tested in multiple mobiles, got the same result.

    Can you confirm whether we are using necessary css and js file from the dojo we shared? https://dojo.telerik.com/iWeRowAT/3

    Thanks,

    Anusha

     

  9. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 16 Mar in reply to Anusha Link to this post

    Also can you confirm whether it is working in iphone/ipad chrome browser?
  10. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 16 Mar in reply to Anusha Link to this post

    Also can you confirm whether it is working in iphone/ipad chrome browser?
  11. Dimitar
    Admin
    Dimitar avatar
    400 posts

    Posted 19 Mar Link to this post

    Hi Anusha,

    The Dojo references all needed scripts and CSS files, sufficient for PDF export. As a side note that kendo.common-material.min.css should be referenced before kendo.material.min.css.

    As far as the "Open In..." popup is concerned, it is a not Kendo UI related issue/limitation of iOS Chrome browser, when viewing a PDF. There are multiple forum threads discussing this issue and proposing some alternative approaches - e.g. this thread. I got the same popup on my side on iPhone/iPad Chrome. While Safari shows some suggestions to use a PDF reader for example, Chrome shows nothing. We have no control on it, it is an iOS Chrome limitation.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  12. Anusha
    Anusha avatar
    8 posts
    Member since:
    Sep 2017

    Posted 19 Mar in reply to Dimitar Link to this post

    Thanks Dimitar for the informations.

    Thanks,

    Anusha

Back to Top