1. #1
    Ext User
    Join Date
    Feb 2010
    Posts
    12
    Vote Rating
    0
    softbender is on a distinguished road

      0  

    Default Loading PDF in Ext.Window

    Loading PDF in Ext.Window


    Code:
    I have a servlet that returns a PDF. What i trying do is loading the PDF to Ext.Window. Below is the sample source
    
                Ext.getCmp('hisAmpPhyWin').load(
                        {
                            url:'servlet/Servlet/',
                            params: {xhtml:xhtmlData},
                            text: 'Loading PDF...',
                            scripts: false
                        });
    Where 'hisAmpPhyWin' is a Ext.Window instance.

    The thing is its showing the PDF content (i mean ascii characters) not the actual PDF in the browser.

    Please help to fix this issue.

  2. #2
    Sencha User
    Join Date
    Mar 2008
    Posts
    566
    Vote Rating
    0
    moegal is on a distinguished road

      0  

    Default


    try searching the forum for IFrameComponent or displaying pdf in extjs. I use an iframe to display pdf's

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    You could use:
    Code:
    var win = new Ext.Window({
      title: 'My PDF',
      bodyCfg: {
        tag: 'iframe',
        src: 'servlet/Servlet/?xhtml=' + encodeURIComponent(xhtmlData)
      }
    }).show();

  4. #4
    Ext User
    Join Date
    Feb 2010
    Posts
    12
    Vote Rating
    0
    softbender is on a distinguished road

      0  

    Default


    Excellent! Thanks

  5. #5
    Sencha User
    Join Date
    Oct 2008
    Posts
    48
    Vote Rating
    0
    Daz is on a distinguished road

      0  

    Default


    Thanks, worked fine with IE/ Chrome/ Opera for Ext 3.3.1

    With Safari 4.0.5 the PDF didn't appear.
    Yet, if the window is resized after the PDF has downloaded it appears.
    As a workaround I'm checking for Safari and using the embed tag and the PDF appears fine.

    Any tips on how to make IFrames/ PDFs work with Safari?

Similar Threads

  1. Open pdf file in an Ext window
    By senacle in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 15 Nov 2010, 5:32 AM
  2. Replies: 1
    Last Post: 15 Nov 2010, 5:27 AM
  3. Static PDF in Ext.Window
    By walldorff in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 29 Jun 2010, 12:22 PM
  4. PDF file in Ext.Window?
    By neerajnandwana in forum Ext 2.x: Help & Discussion
    Replies: 14
    Last Post: 17 Jun 2010, 10:56 AM
  5. I can't see created pdf in a new window
    By haydar in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 3 Nov 2009, 1:33 AM

Thread Participants: 3

Tags for this Thread