Declined
Last Updated: 23 Feb 2023 11:11 by ADMIN
Aidan
Created on: 04 Nov 2019 21:42
Category: Kendo UI for Angular
Type: Bug Report
1
Export Editor tables to PDF

Hello,

 

The PDF export component does not seem to handle tables that are in the editor content. In the Stackblitz example I included, which is based off of the PDF export demo under the Editor component, the table borders do not show in the editor and in the exported PDF. In my own practice, any editor version 8 and above will not export the tables to PDF. In fact, the exported PDF is blank no matter what is in the editor. Here is what I am using. When I change the editor version to 0.7.0, the PDF export works (albeit without table support). I would like to be able to export the tables that inside of the editor's content to PDF. This problem only started happening after I updated my editor to versions 0.8.0 and above.  


<kendo-pdf-export #pdf paperSize="Letter" margin="1cm" [scale]="scale">
                    <kendo-editor #editor iframe="false" style="align-self: auto; padding: 20px; height: 90vh; width: 24cm; margin: 0 auto;" [(value)]="value" 
                    (dragover)="onDragOver(event)" (drop)="onDrop(event)">
                      <kendo-toolbar>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorUndoButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorRedoButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorStrikethroughButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorSubscriptButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorSuperscriptButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>
                        <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>
                        <kendo-toolbar-dropdownlist kendoEditorFontSize></kendo-toolbar-dropdownlist>
                        <kendo-toolbar-dropdownlist kendoEditorFontFamily></kendo-toolbar-dropdownlist>
                        <kendo-toolbar-colorpicker kendoEditorForeColor></kendo-toolbar-colorpicker>
                        <kendo-toolbar-colorpicker kendoEditorBackColor></kendo-toolbar-colorpicker>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>

                        <kendo-editor-insert-table-button></kendo-editor-insert-table-button>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorAddColumnBeforeButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorAddColumnAfterButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorAddRowBeforeButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorAddRowAfterButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>
                        <kendo-toolbar-buttongroup>
                          <kendo-toolbar-button kendoEditorDeleteColumnButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorDeleteRowButton></kendo-toolbar-button>
                          <kendo-toolbar-button kendoEditorDeleteTableButton></kendo-toolbar-button>
                        </kendo-toolbar-buttongroup>
                        <kendo-toolbar-button kendoEditorInsertFileButton></kendo-toolbar-button>
                        <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>
                        <kendo-toolbar-button kendoEditorViewSourceButton></kendo-toolbar-button>


                        <kendo-toolbar-button text="Export as PDF"
                                              [icon]="'pdf'"
                                              (click)="pdf.saveAs('editor-content.pdf')"></kendo-toolbar-button>
                      </kendo-toolbar>
                    </kendo-editor>
                  </kendo-pdf-export>

Attached Files:
2 comments
ADMIN
Martin Bechev
Posted on: 18 May 2021 15:43

As an update on this thread, here is the dedicated PDF Export for Editor Component feature request:

https://feedback.telerik.com/kendo-angular-ui/1442759-dedicated-pdf-export-for-editor-component

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Martin Bechev
Posted on: 11 Nov 2019 15:39

Hi Aidan,

Thank you for the provided runnable project.

By default, the Editor table styles are applied when the [iframe] option is set to true. Then the tables are rendered correctly in the Editor. Please, check the following example:

https://stackblitz.com/edit/angular-amnblu?file=app/app.component.ts

However, there is a known limitation regarding PDF Export functionality where the <iframe> is not a supported element. Please, refer to the following article for more information:

https://www.telerik.com/kendo-angular-ui/components/drawing/limitations-browser-support/#toc-elements-and-styles

That is why setting the [iframe] to false doesn't show any table in the Editor content and further in the PDF document. A workaround that I can provide is to apply the needed CSS styles for the tables (the same are applied if the iframe=true). This will ensure that they will be visible in the Editor and in the exported document:

https://stackblitz.com/edit/angular-nkqlac?file=app/app.component.ts

If you have the time, please submit a new feature request in the Feedback Portal, by describing the dedicated PDF Export component for the Editor component, to help us estimate the customer demand for such a feature and prioritize accordingly when updating our Roadmap.

Thank you in advance.

Regards,
Martin
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.