New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowHTML with offline exporting #5985

Closed
morganfree opened this Issue Nov 16, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@morganfree
Contributor

morganfree commented Nov 16, 2016

Expected behaviour

With offline exporting, html elements in the chart are visible in the exported images.

Actual behaviour

HTML elements are not visible.

Live demo with steps to reproduce

http://jsfiddle.net/z4m4wmom/

Affected browser(s)

Tested in Chrome 54

@oysteinmoseng oysteinmoseng self-assigned this Nov 18, 2016

@oysteinmoseng oysteinmoseng added the Bug label Nov 18, 2016

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng

oysteinmoseng Nov 18, 2016

Collaborator

Thanks for reporting. We'll take a look as soon as possible.

Collaborator

oysteinmoseng commented Nov 18, 2016

Thanks for reporting. We'll take a look as soon as possible.

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng

oysteinmoseng Nov 18, 2016

Collaborator

Neither canvas/CanVG nor svg2pdf support foreignObject and HTML rendering, so we have to fall back to online export for PNG, JPEG and PDF export. SVG support should now work, however, and it falls back gracefully for the other output types.

Collaborator

oysteinmoseng commented Nov 18, 2016

Neither canvas/CanVG nor svg2pdf support foreignObject and HTML rendering, so we have to fall back to online export for PNG, JPEG and PDF export. SVG support should now work, however, and it falls back gracefully for the other output types.

@ellier7

This comment has been minimized.

Show comment
Hide comment
@ellier7

ellier7 Jun 9, 2017

Is there a way to style PDFs with client side exporting? If I set allowHTML to true and disable fallbackToExportServer, exporting does not work. I need to use offline exporting but PDFs are not styled nicely when exported

ellier7 commented Jun 9, 2017

Is there a way to style PDFs with client side exporting? If I set allowHTML to true and disable fallbackToExportServer, exporting does not work. I need to use offline exporting but PDFs are not styled nicely when exported

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng

oysteinmoseng Jun 9, 2017

Collaborator

@ellier7 There are limitations to what kind of HTML would be supported in PDF export, but colors etc should not be an issue. Do you have a demo of what you want to achieve?

EDIT: Actually any HTML fails in PDF export, as it is included in SVG foreignObjects which are unsupported by the PDF conversion library at this time. Is your styling dependent on HTML?

Collaborator

oysteinmoseng commented Jun 9, 2017

@ellier7 There are limitations to what kind of HTML would be supported in PDF export, but colors etc should not be an issue. Do you have a demo of what you want to achieve?

EDIT: Actually any HTML fails in PDF export, as it is included in SVG foreignObjects which are unsupported by the PDF conversion library at this time. Is your styling dependent on HTML?

@ellier7

This comment has been minimized.

Show comment
Hide comment
@ellier7

ellier7 Jun 9, 2017

@oysteinmoseng It's mostly font style (size and family)

ellier7 commented Jun 9, 2017

@oysteinmoseng It's mostly font style (size and family)

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng

oysteinmoseng Jun 9, 2017

Collaborator

@ellier7 I see. You should not need allowHTML for those (see e.g. http://jsfiddle.net/9rao0z3r/), but font styles can be problematic in PDF export regardless, because the conversion library doesn't seem to handle custom fonts very well. Presumably you are not looking to export to default fonts.

Is installing our node-based export server locally an option? There you would be able to install custom fonts and keep control of all aspects of the export.

Collaborator

oysteinmoseng commented Jun 9, 2017

@ellier7 I see. You should not need allowHTML for those (see e.g. http://jsfiddle.net/9rao0z3r/), but font styles can be problematic in PDF export regardless, because the conversion library doesn't seem to handle custom fonts very well. Presumably you are not looking to export to default fonts.

Is installing our node-based export server locally an option? There you would be able to install custom fonts and keep control of all aspects of the export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment