Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iframe is not displaying pdf #10887

Closed
rajvaghela23 opened this issue May 16, 2024 · 6 comments
Closed

Iframe is not displaying pdf #10887

rajvaghela23 opened this issue May 16, 2024 · 6 comments
Assignees
Labels
bug teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label

Comments

@rajvaghela23
Copy link

rajvaghela23 commented May 16, 2024

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

Copy link
Contributor

Hi rajvaghela23! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

@ChetanSharma-msft ChetanSharma-msft added the teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label label May 16, 2024
@ChetanSharma-msft
Copy link
Collaborator

Hello @rajvaghela23 - Thanks for raising your query.
We will look into it and let you know the updates.

@Prasad-MSFT
Copy link
Collaborator

@rajvaghela23 - We tried to repro this issue and are also getting same error as below:
image

We are discussing this internally and we will get back to you once we find any resolution.

Thanks!

@Prasad-MSFT
Copy link
Collaborator

Update:

We have raised a bug for the same. We will inform you once we get any further update from engineering team. Thanks!

@Prasad-MSFT
Copy link
Collaborator

Hi @rajvaghela23 - We got update from engineering team that the behavior is currently by design.
Teams renders embedded apps in sandboxed iframes to keep our users safe. Sandboxed iframes do not support plugins which are required to render PDF files.

For SharePoint-hosted PDF files, the app can use the app.openLink API to launch a deep link and have Teams render the file: https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-link-teams#generate-deep-link-to-a-file-in-a-channel

For other PDF files, the app should use window.open to render the file in the user's default browser.

Copy link
Contributor

Tell us about your experience!

Hi rajvaghela23! This issue is closed in our system. We would like your feedback on your experience with our support team and Platform.

Best regards,
Teams Platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label
Projects
None yet
Development

No branches or pull requests

3 participants