Displaying PDF Documents in a Popup in a .NET MAUI App
Environment
Version | Product | Author |
---|---|---|
7.1.0 | Telerik UI for .NET MAUI Popup and PDF Viewer | Dobrinka Yordanova |
Description
I need to load and display a PDF document in a popup within a .NET MAUI application. The end user must be able to use continuous scrolling. To achieve this, I want to use the PDFViewer and RadPopup components.
This KB article also answers the following questions:
- How can I display a PDF in a popup in .NET MAUI?
- Is it possible to load PDF documents in a popup with continuous scrolling?
- What steps are required to implement a PDF viewer in a popup for .NET MAUI applications?
Solution
To display a PDF document in a popup, follow these steps:
1. Include the necessary namespace references to your .NET MAUI page.
2. Add the RadPopup
control to your page and set its IsOpen
property to control the visibility. Inside the popup, place the RadPdfViewer
to load and show the PDF document.
3. In the code-behind, handle the button click events to open and close the popup. Load the PDF document into the RadPdfViewer
when the popup is shown.
For the example, ensure the PDF document (your-pdf-file.pdf
) is added to your project with the Build Action
set to EmbeddedResource
.