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

Unable to download pdf in iphone and ipad

11 Answers 917 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anusha
Top achievements
Rank 1
Anusha asked on 15 Feb 2018, 12:43 PM

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

11 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 16 Feb 2018, 09:13 AM
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.
0
Anusha
Top achievements
Rank 1
answered on 16 Feb 2018, 09:17 AM

Hi Dimitar,

We were able to fix it by using proxyurl. 

Thanks,

Anusha

0
Anusha
Top achievements
Rank 1
answered on 23 Feb 2018, 03:18 AM

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

0
Dimitar
Telerik team
answered on 23 Feb 2018, 08:00 AM
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.
0
Anusha
Top achievements
Rank 1
answered on 14 Mar 2018, 09:03 AM

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

0
Dimitar
Telerik team
answered on 15 Mar 2018, 05:08 PM
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.
0
Anusha
Top achievements
Rank 1
answered on 16 Mar 2018, 12:14 PM

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

 

0
Anusha
Top achievements
Rank 1
answered on 16 Mar 2018, 12:18 PM
Also can you confirm whether it is working in iphone/ipad chrome browser?
0
Anusha
Top achievements
Rank 1
answered on 16 Mar 2018, 12:21 PM
Also can you confirm whether it is working in iphone/ipad chrome browser?
0
Dimitar
Telerik team
answered on 19 Mar 2018, 12:08 PM
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.
0
Anusha
Top achievements
Rank 1
answered on 19 Mar 2018, 12:37 PM

Thanks Dimitar for the informations.

Thanks,

Anusha

Tags
General Discussions
Asked by
Anusha
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Anusha
Top achievements
Rank 1
Share this question
or