kendo.saveAs pdf on Chrome mobile and iOS "open in" sharing

4 posts, 0 answers
  1. Evan
    Evan avatar
    2 posts
    Member since:
    Mar 2018

    Posted 21 Mar Link to this post

    On Chrome for Ipad (latest versions), rendering the page using kendo.drawing & kendo.saveAs pdf the page will be converted to pdf as expected. However, tapping the page and clicking iOS's "open in" sharing menu in the bottom right corner of the document displays an error "the file could not be downloaded at this time". The "open in" functionality is needed so users can attach the generated pdf to email/upload to another service.

    To replicate visit the Kendo-UI pdf export demo page using and iPad + Google chrome. You need to be in portrait view for responsive export to pdf menu to display.

    I'm aware that kendo-ui's pdf export feature technically does not support mobile browsers. However, unofficially it is mostly working for me with one exception. Adding to my frustration and confusion, iOS + safari exports the pdf correctly and maintains the "open in" functionality. It is just chrome mobile that I am encountering the bug.

    I tried saving the generated pdf on the server and requesting directly and the "open in" functionality works... so it is not a problem with the pdf itself. The only difference I can think of is the local generated one also contains POST header data? I thought a possible work around would be saving the generated file using the force-proxy option on the server and returning a response of the resource url. However, I would like to keep offline client side only functionality.

    Does anyone have suggestions for a possible work around? Recommendations for a different pdf generation JS library? It feels like I am 99% there using Kendo and would be thrilled if anyone could help.

  2. Dimitar
    Admin
    Dimitar avatar
    409 posts

    Posted 23 Mar Link to this post

    Hello Evan,

    This behavior seems as a iOS Chrome limitation we have recently discussed in the following forum thread. Indeed on the demo there is a popup, which says "The file could not be downloaded at this time". This problem is commented in various non Kendo UI related threads, e.g. Chrome on iOS won't download PDF's anymore. If the same scenario is tested locally with the project attached to my comment a little earlier in the same thread, then even the popup would not appear. Tapping on "Open in" will do nothing. Exporting to PDF on iOS Safari and Chrome requires proxyURL implementation, as mentioned in the beginning of the same thread. Even if the PDF fails to download due to the POST, still the POST is required to generate it before that.

    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. Evan
    Evan avatar
    2 posts
    Member since:
    Mar 2018

    Posted 28 Mar in reply to Dimitar Link to this post

    Thanks for your reply Demitar. I'm having difficulties getting the Kendo dependencies setup for the example running you linked but it looks like that demonstration simply shows how to to setup the server proxy? It still has issues with the  "open in" functionality not working correctly in Chrome iOS?

    I have seen other mentions of chrome on iOS having similar issues with pdfs in general but I am trying to understand the details of exactly why the browser is exhibiting that bug. I have compared response headers to pdfs generated with kendo.saveAs and returned through the proxy vs. a server request that reads a pdf file from disk. The response headers are set to be identical. With the file read from disk "open in" functionality works while the Kendo generated does not. The only difference I am seeing is the Kendo generated pdf has a request type of POST vs GET and has the addition of the Request Header

    Content-Type: application/x-www-form-urlencoded

     

    Is there a built in Kendo-UI for jquery saveAs method that can be called as an async promise?

    If so I was thinking a possible work around could be async call > proxy method that saves the file on the server > returns a response for when file creation compete > then kick off a new GET request for the file. 

     


  4. Dimitar
    Admin
    Dimitar avatar
    409 posts

    Posted 30 Mar Link to this post

    Hi Evan,

    Yes, the idea of the sample project was to show how to setup the proxy on the server and it also has the "open in" issue in iOS Chrome.
    As for the other question, I am afraid that there is no build-in Kendo UI for jQuery saveAs method to be called as an async promise.

    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.
Back to Top