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/enable-print-rotation.md
+7-13Lines changed: 7 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ domainurl: ##DomainURL##
10
10
11
11
# Enable print rotation in Blazor PDF Viewer
12
12
13
-
This guide shows how to enable automatic rotation of landscape pages during printing so they match the paper orientation and reduce clipping. Use [EnablePrintRotation](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnablePrintRotation)when printing documents that include landscape pages and you want them rotated to match the printer paper orientation.
13
+
The [EnablePrintRotation](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnablePrintRotation)property in the Blazor PDF Viewer controls how landscape pages are handled during printing. When enabled, the viewer automatically rotates landscape-oriented pages to match the printer’s paper orientation. This ensures that content fits properly on the page and avoids clipping.
14
14
15
-
## Prerequisites
15
+
By default, this property is set to **true**, meaning landscape pages are automatically adjusted for optimal printing. If set to **false**, pages retain their original orientation and are printed without any automatic rotation.
16
16
17
-
- A Blazor app with the Syncfusion PDF Viewer component integrated.
17
+
## When to use print rotation
18
18
19
-
## Steps to enable print rotation
19
+
Enable this feature when printing documents that include landscape pages and you want them to align with the printer’s paper orientation. This helps improve readability and ensures that content is not cut off during printing.
20
20
21
-
1. Configure the [SfPdfViewer](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.SfPdfViewer.html) component in your Blazor application.
22
-
2. Set [EnablePrintRotation](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnablePrintRotation)="true" in the PDF Viewer during initialization.
21
+
## Enabling print rotation
22
+
23
+
You can enable print rotation during the initialization of the PDF Viewer component by setting the `EnablePrintRotation` property to **true**.
23
24
24
-
## Example
25
25
26
26
{% tabs %}
27
27
{% highlight razor %}
@@ -42,14 +42,8 @@ This guide shows how to enable automatic rotation of landscape pages during prin
42
42
43
43
[View Sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Print)
44
44
45
-
## Troubleshooting
46
-
47
-
- If you need to preserve original page orientation for archival printing, set [EnablePrintRotation](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnablePrintRotation)="false".
48
-
- Confirm that the PDF Viewer component is properly configured with the correct resource URL.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/blazor/print/overview.md
-7Lines changed: 0 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,21 +68,14 @@ To start printing from code, call the [PrintAsync()](https://help.syncfusion.com
68
68
69
69
- Enable or disable printing with the [EnablePrint](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnablePrint) property
70
70
- Start printing from UI (toolbar Print) or programmatically using [PrintAsync()](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.SfPdfViewer.html#Syncfusion_Blazor_SfPdfViewer_SfPdfViewer_PrintAsync).
71
-
- Control output quality with the [PrintScaleFactor](./print-quality) property (0.5–5)
72
71
- Auto‑rotate pages during print using [EnablePrintRotation](./enable-print-rotation)
73
72
- Choose where printing happens with [PrintMode](./print-modes) (Default or NewWindow)
74
73
- Track the life cycle with [PrintStart and PrintEnd events](./events)
75
74
76
-
## Troubleshooting
77
-
78
-
- Ensure the resource URL value matches the deployed `ej2-pdfviewer-lib` version.
79
-
- Calling [PrintAsync()](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.SfPdfViewer.html#Syncfusion_Blazor_SfPdfViewer_SfPdfViewer_PrintAsync) launches the browser print dialog; behavior varies by browser and may be affected by popup blockers or browser settings.
80
-
81
75
[View Sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Print)
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/blazor/print/print-modes.md
+11-27Lines changed: 11 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,60 +8,44 @@ documentation: ug
8
8
domainurl: ##DomainURL##
9
9
---
10
10
11
-
# Print Modes in the Blazor PDF Viewer
11
+
# Print Modes in Blazor PDF Viewer
12
12
13
-
This guide shows how to set the PDF Viewer [`PrintMode`](https://ej2.syncfusion.com/blazor/documentation/api/pdfviewer/pdfviewer#printmode) so PDFs print from the current window or from a new window/tab.
13
+
The [`PrintMode`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_PrintMode) property determines how the print dialog is opened in the PDF Viewer. By default, it is set to PrintMode.Default, which prints the document from the same browser window.
14
14
15
-
## Prerequisites
15
+
## Available print modes
16
16
17
-
- A Blazor app with the Syncfusion PDF Viewer component integrated.
17
+
-[PrintMode.Default](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PrintMode.html): Prints the document from the current browser window.
18
+
-[PrintMode.NewWindow](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PrintMode.html): Opens the print dialog in a new window or tab. This may be affected by browser pop-up blockers.
18
19
19
-
## Steps to set print mode
20
+
## Set print mode
20
21
21
-
**Step 1:** Decide which [PrintMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_PrintMode) you need:
22
-
-`PrintMode.Default` — print from the same browser window.
23
-
-`PrintMode.NewWindow` — print from a new window or tab (may be blocked by pop-up blockers).
24
-
25
-
**Step 2:** Set [PrintMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_PrintMode) during viewer initialization (recommended):
22
+
You can configure the print mode during the initialization of the PDF Viewer component by setting the `PrintMode` property.
26
23
27
24
{% tabs %}
28
25
{% highlight razor %}
26
+
29
27
@using Syncfusion.Blazor.SfPdfViewer
30
28
31
29
<SfPdfViewer2 Height="100%"
32
30
Width="100%"
33
31
DocumentPath="@DocumentPath"
34
32
PrintMode="PrintMode.NewWindow" />
35
33
36
-
@code{
34
+
@code{
37
35
public string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf";
38
36
}
39
-
{% endhighlight %}
40
-
{% endtabs %}
41
-
42
-

43
37
44
-
**Step 3:** Print mode can also be changed at runtime after the viewer is created:
45
-
46
-
{% tabs %}
47
-
{% highlight razor %}
48
-
// switch to NewWindow at runtime
49
-
pdfViewerRef.PrintMode = "NewWindow";
50
38
{% endhighlight %}
51
39
{% endtabs %}
52
40
53
-
## Quick reference
54
-
55
-
-`PrintMode.Default`: Print from the same window (default).
56
-
-`PrintMode.NewWindow`: Print from a new window or tab.
41
+

57
42
58
-
N> Browser pop-up blockers must allow new windows or tabs when using `PrintMode = PrintMode.NewWindow`.
43
+
> **Note:** Ensure that browser pop-up blockers allow new windows or tabs when using `PrintMode.NewWindow`.
59
44
60
45
[View samples on GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Print)
0 commit comments