You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/blazor/print.md
+121Lines changed: 121 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,127 @@ The SfPdfViewer supports printing the loaded PDF by default. Enable or disable t
52
52
53
53
```
54
54
55
+
## EnablePrintRotation in the Blazor SfPdfViewer
56
+
57
+
[EnablePrintRotation](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnablePrintRotation) controls whether landscape pages are auto-rotated to best fit when printing. Default: true. Set to false to preserve the original page orientation and suppress automatic rotation during print.
58
+
59
+
```cshtml
60
+
61
+
@using Syncfusion.Blazor.SfPdfViewer
62
+
63
+
<SfPdfViewer2 Height="100%"
64
+
Width="100%"
65
+
DocumentPath="@DocumentPath"
66
+
EnablePrintRotation="true" />
67
+
68
+
@code{
69
+
public string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf";
70
+
}
71
+
72
+
```
73
+
74
+
## Print modes in the Blazor SfPdfViewer
75
+
76
+
[PrintMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_PrintMode) specifies how the print dialog is opened. Default: PrintMode.Default (prints from the same window). Supported values:
77
+
78
+
-[PrintMode.Default](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PrintMode.html#Syncfusion_Blazor_SfPdfViewer_PrintMode_Default) — Opens the print dialog in the same window.
79
+
-[PrintMode.NewWindow](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PrintMode.html#Syncfusion_Blazor_SfPdfViewer_PrintMode_NewWindow) — Opens the print dialog from a new browser window/tab, which can be useful depending on browser popup policies.
80
+
81
+
```cshtml
82
+
83
+
@using Syncfusion.Blazor.SfPdfViewer
84
+
85
+
<SfPdfViewer2 Height="100%"
86
+
Width="100%"
87
+
DocumentPath="@DocumentPath"
88
+
PrintMode="PrintMode.NewWindow" />
89
+
90
+
@code{
91
+
public string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf";
92
+
}
93
+
94
+
```
95
+
96
+
## PrintScaleFactor in the Blazor SfPdfViewer
97
+
98
+
[PrintScaleFactor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_PrintScaleFactor) sets the scale used when rendering pages for printing. By default the scale factor set as 1.0 (prints at the on-screen scale). Valid range from 0.5 to 5.0. Higher values can improve output clarity for documents with smaller page dimensions and may increase print processing time.
99
+
100
+
```cshtml
101
+
102
+
@using Syncfusion.Blazor.SfPdfViewer
103
+
104
+
<SfPdfViewer2 Height="100%"
105
+
Width="100%"
106
+
DocumentPath="@DocumentPath"
107
+
PrintScaleFactor="2" />
108
+
109
+
@code{
110
+
public string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf";
111
+
}
112
+
113
+
```
114
+
115
+
## Print Events in Blazor SfPdfViewer
116
+
117
+
The following events are available in the SfPdfViewer component.
118
+
119
+
|Name|Description|
120
+
|---|---|
121
+
|PrintStart|Triggers when a print action starts.|
122
+
|PrintEnd|Triggers when a print action is completed.|
123
+
124
+
### PrintStart Event
125
+
126
+
The [PrintStart](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_PrintStart) event triggers when the print action is started.
127
+
128
+
#### Event Arguments
129
+
130
+
See [PrintStartEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PrintStartEventArgs.html) for details such as Filename, Cancel option.
131
+
132
+
The following example illustrates how to handle the PrintStart event.
The [PrintEnd](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_PrintEnd) event triggers when an annotation is added to a page in the PDF document.
153
+
154
+
#### Event Arguments
155
+
156
+
See [PrintEndEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PrintEndEventArgs.html) for details such as Filename.
157
+
158
+
The following example illustrates how to handle the PrintEnd event.
*[Download in Blazor SfPdfViewer component](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/blazor/saving-pdf-file#download-in-blazor-sfpdfviewer-component)
0 commit comments