Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    PDF Export on iPad issues in 4.1p

    I've got some code that has regressed when we migrated to 4.1p. On the iPad, we have code that exports to PDF in a new mobile Safari browser tab that works fine in 3.1p, but silently fails on 4.1p. The code to export looks like this:

    Code:
    DSRequest requestProperties = new DSRequest();
    requestProperties.setExportFilename(getPdfFileName());
    requestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);				requestProperties.setContentType("application/pdf");		requestProperties.setDownloadResult(true);				requestProperties.setDownloadToNewWindow(true);
    
    RPCManager.exportContent(contentLayout, requestProperties);
    I've attached some sample source code that shows the behavior if you run it in 3.1p versus 4.1p.

    I'm running SmartGWT SmartClient Version: v9.1p_2014-04-03/Enterprise Deployment (built 2014-04-03)

    With an iPad running iOS 7.1.
    Attached Files

    #2
    We are able to reproduce this and are looking into it. It appears to only occur with downloadToNewWindow: true, so a workaround would be to remove the line setting downloadToNewWindow.

    Comment


      #3
      Thanks for the info on the work around. It is preferable for our app to open the PDF in a new tab so the user doesn't have to hit the back button to return to the app, and so that they can navigate between the app and the generated PDF, with out re-generating the PDF.

      Comment


        #4
        Try disabling your popup blocker in Safari - you can do this in the settings app. You also may need to reload the page and/or restart Safari.

        Comment


          #5
          Turning off the pop-up blocker did allow the PDF to open in a new tab.

          In 3.1p, this wasn't necessary. So this leads me to ask what changed, and can it be changed back? Our users haven't had to turn off the pop-up blocker in the past, and asking them to turn it off may be problematic. Also with the pop-up blocker turned on, the PDF generation silently fails giving the user no indication of what the problem might be.

          Thanks,
          Chris

          Comment


            #6
            We've applied a fix to SC 10.0d/SGWT 5.0d and SC 9.1p/SGWT 4.1p to address this issue - you shouldn't need to disable the popup blocker in Mobile Safari any more.

            Note that the regression was due to us switching to asynchronous HTML generation for the PDF to avoid a "browser running slowly" dialog. Mobile Safari apparently engages the popup blocker unless the window is opened synchronously with the click event. We've found a way around both of these problems.

            Check the next nightly builds.

            Comment


              #7
              Thank you, that did fix the problem.

              Kind Regards,
              Chris

              Comment

              Working...
              X