1024133: Document Handling in Blazor PDF Viewer#2792
Conversation
|
Build Status: INPROGRESS 🔃 |
|
CI Status: FAILURE ❌ |
|
Build Status: INQUEUE 🕒 |
|
Build Status: INPROGRESS 🔃 |
|
CI Status: SUCCESS ✅ |
|
Build Status: INQUEUE 🕒 |
|
Build Status: INPROGRESS 🔃 |
|
CI Status: SUCCESS ✅ |
|
Build Status: INPROGRESS 🔃 |
|
CI Status: SUCCESS ✅ |
|
Build Status: INPROGRESS 🔃 |
|
CI Status: SUCCESS ✅ |
| domainurl: ##DomainURL## | ||
| --- | ||
|
|
||
| # Retrieve the Loaded Document Instance |
There was a problem hiding this comment.
Change title Retrieve the Blazor PDF Viewer Instance
|
|
||
| This page explains how to access the loaded document instance in the Blazor PDF Viewer using Blazor component references, listen for the [DocumentLoaded](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_DocumentLoaded) event, and retrieve document information, page details, and metadata—so you can safely invoke viewer APIs after the PDF document is loaded. | ||
|
|
||
| ## Explanation: Why access the loaded document instance? |
There was a problem hiding this comment.
Why access the lPDF Viewer Instance?
|
|
||
| # Retrieve the Loaded Document Instance | ||
|
|
||
| This page explains how to access the loaded document instance in the Blazor PDF Viewer using Blazor component references, listen for the [DocumentLoaded](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_DocumentLoaded) event, and retrieve document information, page details, and metadata—so you can safely invoke viewer APIs after the PDF document is loaded. |
There was a problem hiding this comment.
PDF Viewer instance
| @@ -0,0 +1,188 @@ | |||
| --- | |||
| layout: post | |||
| title: Retrieve Loaded Document Instance Blazor PDF Viewer | syncfusion | |||
There was a problem hiding this comment.
PDF Viewer Instance
| --- | ||
| layout: post | ||
| title: Retrieve Loaded Document Instance Blazor PDF Viewer | syncfusion | ||
| description: Learn how to access the loaded PDF document instance in the Blazor PDF Viewer using component references and the DocumentLoad event. |
There was a problem hiding this comment.
Learn how to access the Blazor PDF Viewer instance references and the DocumentLoad, Created event.
| - **Call Viewer APIs** (typical examples): | ||
| - **Zoom / Fit**: `ZoomTo(125)`; fit to page/width | ||
| - **Navigation**: go to a specific page | ||
| - **Interactions**: enable/disable features |
There was a problem hiding this comment.
Add the proper API name and its API reference link
| - **Interactions**: enable/disable features | ||
| - **Export**: `Download()`, `Print()` | ||
|
|
||
| N> The **Created event** triggers when the PDF Viewer component is rendered in the DOM. The **DocumentLoaded event** triggers when the document is successfully loaded and parsed. Always invoke viewer APIs after the `DocumentLoaded` event fires to ensure document information is available, or from user actions that occur after load. Guard calls with null checks or readiness flags. |
There was a problem hiding this comment.
Add the proper Created, DocumentLoaded API reference link
|
|
||
| Below is a focused snippet showing: | ||
| 1) Creating a **component reference** for the viewer, | ||
| 2) Wiring the **`Created`** event for viewer initialization and the **`DocumentLoaded`** event for document details, and |
There was a problem hiding this comment.
Add the proper Created, DocumentLoaded API reference link
| <strong>Document Info</strong><br /> | ||
| Name: @Info2.Name <br /> | ||
| Pages: @Info2.PageCount <br /> | ||
| Title: @Info1.Title <br /> |
There was a problem hiding this comment.
Remove title and authos
| private async Task OnCreated() | ||
| { | ||
| // Created event: Fires when the PDF Viewer component is rendered | ||
| string filePath = "wwwroot/pdf-succinctly.pdf"; |
There was a problem hiding this comment.
only add await Viewer!.LoadAsync("wwwroot/pdf-succinctly.pdf");
Description:
Updated Document Handling in Blazor PDF Viewer