Skip to content

Iframe is not displaying pdf #10887

@rajvaghela23

Description

@rajvaghela23

Type of issue

Feature doesn't work (bug)

Feedback

We are using the following code to display a PDF in an iframe.

<iframe id="pdfiframe" class="hide" name="pdfiframe" title="PDF" frameborder="0" width="100%" height="900" scrolling="auto"></iframe>

We are calling this function to get the PDF rendered in the above iframe code.

function ShowPDFInIframe(obj, orderId = 0) {
    var url = $(obj).attr("url");
    if (url != "") {
        $.ajax({
            type: "POST",
            url: rootPath + "/PDFController/LoadPdfInRefereceTab?documentURL=" + url,
            success: function (data) {
                debugger;
                var iframe = $("#pdfiframe")[0];
                iframe.src = data;
            }
        });
    }
}

When we click on a PDF icon in the Microsoft Teams App, it displays a blank screen. This is a screenshot from Teams of when we open the application in a web browser.

image

We followed this link to implement the solution but we are still getting the same error.

https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/tab-requirements

Page URL

https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/tab-requirements

Content source URL

https://github.com/MicrosoftDocs/msteams-docs/blob/main/msteams-platform/tabs/how-to/tab-requirements.md

Author

@surbhigupta

Document Id

7037e9c7-f501-5b70-8acf-1f004a06289b

Metadata

Metadata

Assignees

Labels

bugteams-developer-supportQuestion related to extensibility (Bot, ME, Tab) would be marked under this label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions