|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: Organize Pages Events in Blazor PDF Viewer | Syncfusion |
| 4 | +description: Learn how to organize pages Events in the Blazor PDF Viewer, including rotating, rearranging, inserting, deleting, and copying pages. |
| 5 | +platform: document-processing |
| 6 | +control: SfPdfViewer |
| 7 | +documentation: ug |
| 8 | +--- |
| 9 | + |
| 10 | +# Organize Pages Events in Blazor PDF Viewer |
| 11 | + |
| 12 | +The PDF Viewer provides events to track and respond to actions within the page organizer, allowing for the customization of page manipulation features. |
| 13 | + |
| 14 | +## PageOrganizerSaveRequested Event |
| 15 | + |
| 16 | +The `PageOrganizerSaveRequested` event is triggered when a save action is performed in the page organizer. |
| 17 | + |
| 18 | +- Occurs when the **Save as** button in the page organizer toolbar is clicked after modifying the document structure. |
| 19 | + |
| 20 | +The event arguments provide the necessary information about the save event: |
| 21 | + |
| 22 | +- `FileName`: The name of the currently loaded PDF document. |
| 23 | +- `DownloadDocument`: A base64 string of the modified PDF document data. |
| 24 | +- `Cancel`: A boolean that, when set to `true`, prevents the default save action from proceeding. |
| 25 | + |
| 26 | +{% tabs %} |
| 27 | +{% highlight razor %} |
| 28 | + |
| 29 | +@page "/" |
| 30 | +<SfPdfViewer2 DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" |
| 31 | + Height="100%" |
| 32 | + Width="100%"> |
| 33 | + <PdfViewerEvents PageOrganizerSaveRequested="SavePages"></PdfViewerEvents> |
| 34 | +</SfPdfViewer2> |
| 35 | + |
| 36 | +@code { |
| 37 | + private void SavePages(PageOrganizerSaveEventArgs args) { |
| 38 | + Console.WriteLine("Saved File Name : " + args.FileName.ToString()); |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +{% endhighlight %} |
| 43 | +{% endtabs %} |
| 44 | + |
| 45 | +## PageOrganizerZoomChanged Event |
| 46 | + |
| 47 | +The `PageOrganizerZoomChanged` event is triggered when the zoom level of the page organizer is changed. |
| 48 | + |
| 49 | +- This event is fired when the user interacts with the zoom slider in the page organizer. The `ShowImageZoomingSlider` property in `PageOrganizerSettings` must be set to `true` for the slider to be visible. |
| 50 | + |
| 51 | +Event arguments: |
| 52 | + |
| 53 | +- `PreviousZoom`: The previous zoom value. |
| 54 | +- `CurrentZoom`: The current zoom value. |
| 55 | + |
| 56 | +{% tabs %} |
| 57 | +{% highlight razor %} |
| 58 | + |
| 59 | +@page "/" |
| 60 | +<SfPdfViewer2 DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" |
| 61 | + Height="100%" |
| 62 | + Width="100%"> |
| 63 | + <PdfViewerEvents PageOrganizerZoomChanged="ZoomChange"></PdfViewerEvents> |
| 64 | +</SfPdfViewer2> |
| 65 | + |
| 66 | +@code { |
| 67 | + private void ZoomChange(PageOrganizerZoomChangedEventArgs args) { |
| 68 | + Console.WriteLine("Current Zoom : " + args.CurrentZoom); |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +{% endhighlight %} |
| 73 | +{% endtabs %} |
| 74 | + |
| 75 | +## PageOrganizerVisibilityChanged Event |
| 76 | + |
| 77 | +The `PageOrganizerVisibilityChanged` event is triggered when the page organizer dialog visibility is changed. |
| 78 | + |
| 79 | +{% tabs %} |
| 80 | +{% highlight razor %} |
| 81 | + |
| 82 | +@page "/" |
| 83 | +<SfPdfViewer2 DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" |
| 84 | + Height="100%" |
| 85 | + Width="100%" PageOrganizerVisibilityChanged="VisibleChanged"> |
| 86 | +</SfPdfViewer2> |
| 87 | + |
| 88 | +@code { |
| 89 | + private void VisibleChanged(bool isVisible) { |
| 90 | + Console.WriteLine("Organize Dialog Visibility : " + isVisible.ToString()); |
| 91 | + } |
| 92 | +} |
| 93 | + |
| 94 | +{% endhighlight %} |
| 95 | +{% endtabs %} |
| 96 | + |
| 97 | +## Related event documentation |
| 98 | + |
| 99 | +- Overall Viewer events: [Event](../events) |
| 100 | +- Annotation events: [Annotation events](../annotation/events) |
| 101 | +- Form designer events: [Form field events](../form-designer/events) |
0 commit comments