Results 1 to 5 of 5

Thread: Open PDF file inside an iframe

  1. #1
    Sencha User
    Join Date
    Feb 2017
    Posts
    2

    Default Open PDF file inside an iframe

    I'm trying to open a PDF file inside an iframe after rename the file but so far it doesn't work. I have done this because if I load the response content inside the iframe directly all works except the filename who appears as byte array code.

    I have something like this:

    this.load("data:application/pdf;base64,"+btoa((response),"file.pdf");

    load
    :function(uri, name){

    var iframe =Ext.get('myIframe');

    var link = document.createElement("a");
    link
    .download = name;
    link
    .href = uri;
    link
    .target = iframe;
    link
    .click();
    }I need that the PDF file be open inside this iframe but I don´t know the way to reach this.

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Can't you just set the src of the iframe to the URL of the pdf?

  3. #3

    Default

    I am using src but still getting scrolling issue on iPad. Sample code attached.

    var iframe = new Ext.ux.IFrame({
    src: 'UserManual.pdf',
    height: '100%',
    width: '100%'
    });
    var win = new Ext.Window({
    modal: true,
    title: 'Test',
    maximized: true,
    draggable: false,
    items: iframe
    });
    win.show();

    Please suggest a solution for scrolling issue.

  4. #4

    Default Not Possible

    I ran into this a few months ago and the way I understand it the issue is with the way the iPad handles the pdf file and not EXTJS.

    I use this to work around the issue until something changes:


    Code:
        if (Ext.is.iOS === true)    {        window.open('Reports/Output/test.pdf','_blank','fullscreen=yes');    }    else    {        //set the iframe source to your url
        }

    Erik

  5. #5
    Sencha User
    Join Date
    Apr 2013
    Posts
    914
    Answers
    105

    Default

    Set window shadow to false and scrolling should work just fine.

Similar Threads

  1. Replies: 4
    Last Post: 18 Dec 2014, 10:12 PM
  2. Open external webpages inside a panel using iframe
    By La Muerte Peluda in forum Sencha Touch 2.x: Examples and Showcases
    Replies: 5
    Last Post: 21 Aug 2013, 3:08 AM
  3. Replies: 1
    Last Post: 15 Nov 2010, 5:27 AM
  4. EXT window open inside iframe bug in ie
    By frankiew in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 2 May 2010, 2:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •