This is a migrated thread and some comments may be shown as answers.

PDF Export problem with tables

2 Answers 44 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 23 Aug 2014, 08:46 PM
I'm trying to export an HTML table from RadEditor and the text is getting jumbled up. I can reproduce this by pasting the code below into the RadEditor Export to PDF demo. What am I doing wrong?
<table height="180" style="width: 720px;" border="1">
    <colgroup><col /></colgroup>
    <tbody>
        <tr>
            <td>
            <p style="text-align: center;"><span style="font-family: Arial; font-size: 48px;">Your Name Here<br />
            (555) 555-5555</span></p>
            </td>
        </tr>
    </tbody>
</table>

2 Answers, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 26 Aug 2014, 12:19 AM
More information: the code below exports to PDF from RadEditor correctly. This leads me to believe the RadEditor Export to PDF function is not processing the <span> tag.
<table height="180" style="width: 720px;" border="1">
    <colgroup><col /></colgroup>
    <tbody>
        <tr>
            <td>
            <p style="text-align: center; font-size: 48px;">Your Name Here<br />
            (555) 555-5555</p>
            </td>
        </tr>
    </tbody>
</table>
0
Ianko
Telerik team
answered on 26 Aug 2014, 03:38 PM
Hello Jeffrey,

The PDF library used to export the content is quite limited and such cases cannot be properly handled.

Indeed, span elements with inline stylization cannot be exported and due to that I am unable to suggest you an easy approach to resolve this behavior.

What I can suggest is integrating a third-party or custom library to serve the PDF exporting functionality as described in the blog post

Another possible way is to implement a custom filter that transfers the inline styles from the span element to the paragraph, although such logic could break different formatting in one paragraph.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or