Skip to content

Offline exporting fails when boost is active #19253

Closed

Description

@PadWorks

Expected behaviour

When exporting PDF offline, I expect a file with the same data as the displayed trend.

Actual behaviour

Once the Boost module is active, the exported PDF-chart is empty. If the boost module is not active, the export basically works. However, if a PDF is exported, an error message appears in the Chrome log for internal parameters that were not found.

Live demo with steps to reproduce

Standard: https://jsfiddle.net/PadWorks/stn6w9a7/26/
Boost Active: https://jsfiddle.net/PadWorks/759csfgk/9/

Product version

Highcharts JS v11.1.0

Affected browser(s)

Chrome

Activity

  1. karolkolodziej commented on Jul 4, 2023

    @karolkolodziej
    Member

    Hi @PadWorks!

    It looks like it is a regression introduced in the v9.3.2 probably along with the AST- demo with the last working version.
    Internal note: It fails in this loop, the href is missing:

    for (let i = 0; i < images.length; i++) {
    el = images[i];
    href = el.getAttributeNS(
    'http://www.w3.org/1999/xlink',
    'href'
    );
    if (href) {
    OfflineExporting.imageToDataUrl(
    href,
    'image/png',
    { imageElement: el },
    options.scale as any,
    embeddedSuccess,
    // Tainted canvas
    failCallback,
    // No canvas support
    failCallback,
    // Failed to load source
    failCallback
    );
    // Hidden, boosted series have blank href (#10243)
    } else {
    imagesEmbedded++;
    el.parentNode.removeChild(el);
    i--;
    checkDone();
    }
    }

  2. self-assigned this
    on Jul 24, 2023
  3. PadWorks commented on Aug 10, 2023

    @PadWorks
    Author

    @jakubSzuminski Does that mean you are about to solve the problem? By when can I expect a fix?

  4. jszuminski commented on Aug 11, 2023

    @jszuminski
    Contributor

    Hi @PadWorks, I'm currently debugging this issue.

    I cannot give you a specific ETA, but I've recently started working on this problem. I will do everything I can to solve it as soon as possible. I cannot give you any guarantees, but my estimate would be around 2 weeks.

    If I find any simple workaround available, I'll let you know here.

  5. jszuminski commented on Aug 17, 2023

    @jszuminski
    Contributor

    @PadWorks this was a tricky one as there were different reasons for different formats.

    I've prepared a simple fix for you which you can use freely until the next release: https://jsfiddle.net/BlackLabel/9h083ucz/

    Please let me know if that works for you.

  6. PadWorks commented on Aug 21, 2023

    @PadWorks
    Author

    @jakubSzuminski Many thanks. Basically the export now works with image types PNG and JPG, but unfortunately there seems to be a problem with the PDF export.

    1. The file size is not plausible with over 120MB for 12 points? (Above a certain size the exporter dies with activated boost so that the PDF becomes corrupt and is downloaded with 0 Bytes)
    2. Highcharts throws warning 33 due to the internal tagName fedropshadow. This should not happen in my opinion.

    https://jsfiddle.net/PadWorks/3vz7p18s/

  7. jszuminski commented on Aug 21, 2023

    @jszuminski
    Contributor

    @PadWorks no problem!

    1. Actually, if you take a look at how it used to work in v9.3.1 you'll notice that the file size did not increase due to my fix as it was also above 120MB. The reason for this big size is the high exporting.zoom (https://api.highcharts.com/highcharts/exporting.scale) and high resolution.

    2. You're right - I've fixed this by allowing the fedropshadow tag: https://jsfiddle.net/BlackLabel/9eyf4chm/

    This fix does not touch anything related to the file size of the exported file. The only purpose of the solution that I've included is to enable you to export to png/jpeg/pdf with offline exporting the same way you used to be able to do with versions <9.3.2.

    I'll look into the PDF corruption you described deeper this week and see if there's anything we can do about this.

  8. added a commit that references this issue on Aug 23, 2023
    a3857d8
  9. added a commit that references this issue on Sep 6, 2023
    e0863cc
  10. PadWorks commented on Sep 6, 2023

    @PadWorks
    Author

    @TorsteinHonsi Will this fix only be available in the next release, or is there already a hotfix for v11.1? If it is only available in the next release, is it already foreseeable when this will be available?

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

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions