Configuring RadClientExportManager for PDF Export in ASP.NET AJAX
Environment
Product | RadClientExportManager for ASP.NET AJAX |
Version | 2025.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:
-
Landscape Property: This accepts a boolean value. Use
true
for landscape andfalse
for portrait orientation.javascriptlandscape: false, // Portrait landscape: true, // Landscape
-
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]
. -
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.
-
Shrink to Fit: Adjust the
scale
andmargin
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:javascriptvar 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
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:
<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.