How to embed Pdf in ext tab in EXT JS

  1. #1

    How to embed Pdf in ext tab in EXT JS

    Hi, I am using below code to embed pdf in ext tab.It is working fine in IE browser.In google chrome the tab is unable to show the pdf file.

    Please help me for this.

    @(Html.X().Panel().ID("ReviewTurnIn").Width(900).B order(false)
    .Layout(LayoutType.Table)
    .LayoutConfig(new TableLayoutConfig() { Columns = 1 }).PaddingSpec("30px 0px 0px 50px")
    .Items(mainPanleItems =>
    {
    mainPanleItems.Add(Html.X().Label().Text("Review Turn-in").Cls("header-text"));
    })

    .Items(mainPanleItems =>
    {
    mainPanleItems.Add(Html.X().Label().CellCls("info-text").Html("This is what we’ve so far."));
    })

    .Items(mainPanleItems =>
    {
    mainPanleItems.Add(Html.X().Container().ID("PdfEmb ed").Width(850)
    .Html(string.Format("<embed src='{0}' type='application/pdf' style='margin: 0 auto; width:100%; height:1000px;'></embed>",
    Url.Action("ReviewTurnInPDF", new { ServiceId = ServiceId, hashcode = Request.QueryString("hashcode") }))));
    })
    .BottomBar(Html.X().Toolbar().BaseCls("m1-toolbar-bottom")

    .Items(Html.X().Button().GrayButton(Url.Content("~/SupplierTurnIn/SupplierTurnIn/SwitchView"), CurrentWizardId),
    Html.X().ToolbarFill(),
    Html.X().Button().OrangeButton(Url.Content("~/SupplierTurnIn/Order/ReviewTurnIn"), CurrentWizardId, "SuccessTurnIn").Width(200).Text("Submit Turn-In")
    )
    )
    )
  2. #2
    Hello @Gopala! Welcome to Ext.NET forums!

    May you tell us which version of Ext.NET you are using so we can move your question to the correct forum?

    About .pdf embedding if you want to have a definitive portable solution, you will need a PDF JavaScript library to render the PDF on the page, else the browser uses third-party integrations (like Adobe reader) to show the PDF inside -- that would be a client-dependent thing. In the case the client browser has no default PDF handler, the file is either shown as a broken/missing applet or a download is attempted.

    As you are new in the forums you may not be aware of the tools to write posts so, whenever you paste code in messages, please wrap the code between [code ] [/code ] tags so they show nice for everyone to see (and copy-paste). This greatly helps understand your code on a first sight.

    And there are already some discussions on the forums about PDF embedding. If you want to know details about solutions, please give the forums a search for the "PDF" keyword, and you'll going to get good results about it.

    This thread may be particularly useful for you:
    IFrame's Loader "Load" listener is not fired when non-html content is loaded
    Last edited by geoffrey.mcgill; May 19, 2016 at 5:49 AM.

Similar Threads

  1. [CLOSED] embed display logic in ext container
    By T3rryChan in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 24, 2011, 3:40 PM
  2. [CLOSED] [1.0] Custom Control - How to embed resources?
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 19, 2010, 7:35 AM

Posting Permissions