Set width and height of PDF Viewer
23 Oct 20251 minute to read
To control the dimensions of the Syncfusion ASP.NET MVC PDF Viewer, you can modify its Width and Height properties.
To change the width and height of the PDF Viewer, update the Width and Height properties of the PdfViewer control as follows:
<div>
<div style="width:100%;height:600px">
@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Height("1000px").Width("80%").Render()
</div>
</div>In this example, the Width property is set to 80%, and the Height property is set to 1000px. You can change these values to any desired size in pixels or percentages. When using percentage-based values for Width or Height, ensure that the parent container elements also have defined dimensions, otherwise, the PDF Viewer may not render correctly.