Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 2.5 KB

File metadata and controls

57 lines (42 loc) · 2.5 KB
layout post
title Enable Print Rotation in TypeScript PDF Viewer | Syncfusion
description Learn how to enable print rotation for landscape documents in the Syncfusion TypeScript PDF Viewer component.
platform document-processing
control Print
documentation ug
domainurl

Enable print rotation in TypeScript PDF Viewer

Use the enablePrintRotation property to enable automatic rotation of landscape pages during printing so they match the paper orientation. Enable this setting to reduce clipping of landscape pages; disable it to preserve the document's original orientation. Ensure the Print module is injected before using this property — see the PdfViewer API reference: PdfViewer API Reference.

Print rotation demo showing landscape pages rotated for printing

{% tabs %} {% highlight ts tabtitle="Standalone" %}

import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageOrganizer } from '@syncfusion/ej2-pdfviewer';

// Inject required modules PdfViewer.Inject(TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageOrganizer);

const pdfviewer: PdfViewer = new PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib", enablePrintRotation: true, }); pdfviewer.appendTo('#PdfViewer');

{% endhighlight %} {% highlight ts tabtitle="Server-Backed" %}

import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageOrganizer } from '@syncfusion/ej2-pdfviewer';

// Inject required modules PdfViewer.Inject(TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageOrganizer);

const pdfviewer: PdfViewer = new PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', enablePrintRotation: true, }); pdfviewer.appendTo('#PdfViewer');

{% endhighlight %} {% endtabs %}

View Sample in GitHub

See Also