This online demo demonstrates the export to PDF feature of RadEditor.
The approach is very straight-forward - to export the editor content to PDF format:
- Enable the PdfExportFilter filter of RadEditor: ContentFilters="DefaultFilters,PdfExportFilter" - if it is disabled the tables wont be exported
- Fire the ExportToPdf() server-side method to export the content to PDF file
It is also possible to export the content as PDF on the server via the new
OnExportContent event property of RadEditor.
You may also need to configure the exporting settings for the editor through the
RadEditor.ExportSettings section. The available properties are:
- FileName - a string specifying the name (without the extension) of the file that will be created. The file extension is automatically added based on the method that is used.
- OpenInNewWindow - open the exported PDF in a new instead of the same page
There is additional sub-category (
Pdf) for the
ExportSettings dedicated on various configuration settings for the exported .pdf document. Below is a list of them:
- AllowAdd - Boolean property which determines whether content adding is allowed
- AllowCopy - Boolean property which determines whether content copying is allowed
- AllowModify - Boolean property which determines whether content modifications are allowed
- AllowPrint - Boolean property which determines whether the pdf document can be printed
- PageTitle - Sets the title of the page
- PageLeftMargin - Sets the left margin for the pages in the pdf document
- PageRightMargin - Sets the right margin for the pages in the pdf document
- PageTopMargin - Sets the top margin for the pages in the pdf document
- PageBottomMargin - Sets the bottom margin for the pages in the pdf document
- PageHeaderMargin - Sets the header margin for the pages in the pdf document
- PageFooterMargin - Sets the footer margin for the pages in the pdf document
- PageHeight - Sets the height of the pages in the pdf document
- PageWidth - Sets the width of the pages in the pdf document
- Author - Sets the name of the author of the pdf document
- Keywords - Sets the keywords for the pdf document
- Subject - Sets the subject of the pdf document
- Title - Sets the title of the pdf document
- PaperSize - Enumeration which specifies the paper font size.The default value is Letter
- Producer - Specifies the producer of the resulting pdf document
- Creator - Specifies the creator of the resulting pdf document
Unsupported features / scenarios:
Although we are striving to constantly improve our products, there are some limitations in the current implementation of our PDF engine:
- Image transparency;
- Right-to-left fonts;
- Nested DIV elements with absolute position;
- Nested DIV elements with specified width or height;
- Automatic text clipping;
- Client-side binding;
- Medium trust;
- Img tags that point to non-existing image files break the PDF file generation;
- Exporting full HTML page (currently, only the content inside the body tag can be exported).
Related Resources