New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Configuring RadClientExportManager for PDF Export in ASP.NET AJAX

Environment

ProductRadClientExportManager for ASP.NET AJAX
Version2025.1.218

Description

When exporting content to PDF using RadClientExportManager, I need detailed information on all available pdfSettings properties and their acceptable values. Specifically, I'm looking for guidance on setting the landscape mode correctly, using different paper sizes like "Letter", and ensuring content such as charts fits on the page without unnecessary trial and error. This knowledge base article also answers the following questions:

  • How to configure landscape or portrait mode in PDF export?
  • What are the acceptable paper sizes for PDF export?
  • How can I ensure my content fits within the page when exporting to PDF?

Solution

To customize the PDF export settings in RadClientExportManager, follow these guidelines:

  1. Landscape Property: This accepts a boolean value. Use true for landscape and false for portrait orientation.

    javascript
    landscape: false, // Portrait
    landscape: true,  // Landscape
  2. PaperSize Values: Common paper sizes like "A4", "Letter", and "Legal" are supported. You can also specify custom sizes using an array of width and height in points (1 pt = 1/72 inch), for example, [800, 600].

  3. Full List of Export Settings: RadClientExportManager leverages the Kendo UI Drawing API for PDF export. Refer to the Kendo UI PDF Export Documentation for a comprehensive list of options.

  4. Shrink to Fit: Adjust the scale and margin properties to fit content on the page. Ensure the content width does not exceed the paper size. Example settings for a "Letter" paper size with adjusted scale and margins:

    javascript
    var pdfSettings = {
        fileName: "Full-PDF-Export",
        proxyURL: "http://www.proxy.com",
        margin: { top: "20mm", left: "10mm", bottom: "20mm", right: "10mm" },
        paperSize: "Letter",
        landscape: false, // Change as needed
        scale: 0.8, // Adjust scale to fit content
        // Additional properties...
    };

Example Implementation

javascript
function exportPDF() {
    var exportManager = $find('<%=RadClientExportManager1.ClientID%>');
    var pdfSettings = {
        fileName: "Full-PDF-Export",
        proxyURL: "http://www.proxy.com",
        // Configure other pdfSettings properties as shown above
    };
    exportManager.set_pdfSettings(pdfSettings);
    exportManager.exportPDF($(".MyGrid"));
}

Add a RadClientExportManager to your page:

aspx
<telerik:RadClientExportManager runat="server" ID="RadClientExportManager1"></telerik:RadClientExportManager>

For RadGrid or other Telerik UI for ASP.NET AJAX controls, configure them as needed and use the exportPDF JavaScript function to initiate the export.

See Also