KendoPDF not exporting inline styles.

1 Answer 91 Views
Styling Styling / Themes
Emmanuel
Top achievements
Rank 1
Emmanuel asked on 14 Jul 2022, 02:19 PM

Hello all, I'm creating an app where users can edit styling of a page and then export this. I have the default styles in a CSS file. However, the inline styles which users can change via state, is not exporting. 

Anybody know how to fix this? Thanks.

1 Answer, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 18 Jul 2022, 08:57 AM

Hello, Emmanuel,

I made a small example in order to reproduce the explained behavior, however, I was not able to, it seems that the inline styles are exported properly:

https://stackblitz.com/edit/react-eoftth?file=app%2Fstyles.css,app%2Fmain.jsx


Are you passing the inline styles the same way? If yes and they are still not exported properly can you provide a reproducible example so that I can inspect and help further?

I hope this helps.

Regards, FilipProgress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Emmanuel
Top achievements
Rank 1
commented on 18 Jul 2022, 10:24 AM | edited

Hello Filip,

Thank you for your reply. It seems it works when the styles are stated explicitly. I am setting mine through a variable from a style object as it needs to be changed by the user. Here's what it looks like: 

const headingStyle = {
letterSpacing: `${minimalistHeadingSpacing}px`,

};

<span className="minimalist-name heading" style={headingStyle}>{name}</span>

 

 

 

Emmanuel
Top achievements
Rank 1
commented on 18 Jul 2022, 04:33 PM

Just an update: It seems letterSpacing is the issue. As I tried the same approach with font size, and it works.
binita
Top achievements
Rank 2
commented on 19 Jul 2022, 06:06 AM

The Kendo UI PDF export adds a special class during the export so you can use that to your ... .k-pdf-export .export-text { display:inline The standard PDF fonts have no support for   cps test  Unicode characters. The font-face is declared in the Kendo UI stylesheets. ... performance and rises ... When I attempt to export to PDF, the operation is successful but the PDF itself is broken. In Acrobat it says that it cannot open the file, ...How can I export only the selected rows of a Kendo UI Grid to PDF? Solution. In the pdfExport event handler, hide the rows that are not selected by using CSS.
Filip
Telerik team
commented on 20 Jul 2022, 07:16 AM

Hello, Emmanuel,

I am glad to hear that the PDF export works. Let me know in case you need assistance with something else.

Regards,Filip

Tags
Styling Styling / Themes
Asked by
Emmanuel
Top achievements
Rank 1
Answers by
Filip
Telerik team
Share this question
or