Skip to content

Scale doesn't work for PDF offline exporting #19762

Description

@hattn125

Actual behaviour

When I use the offline-exporting module, I noticed that: the option exporting.scale didn't work for PDF type. The PDF file always has width/height same as parent container, without scale.
Other types (PNG/JPEG) works properly.

Expected behaviour

The option exporting.scale should work for PDF type in offine-exporting, same as other types.

Live demo with steps to reproduce

https://jsfiddle.net/37zb2h68/9/

Product version

Highcharts 10.x

Affected browser(s)

All browsers

Activity

  1. karolkolodziej commented on Sep 18, 2023

    @karolkolodziej
    Member

    Hi @hattn125!
    Thank you for reporting the issue!

    If you use the external buttons and run the exportChart method you are able to export it with the scale- demo.

  2. hattn125 commented on Sep 19, 2023

    @hattn125
    Author

    Hi @karolkolodziej! Thank for your reply!

    But it still doesn't work for PDF type in your demo.

    Reproduce steps: exporting PDF type with scale = 1 and scale = 3. The PDF files are totally the same.

  3. karolkolodziej commented on Sep 19, 2023

    @karolkolodziej
    Member

    I've tested my demo and if you use buttons 1 and 2 you get:
    image
    and
    image

  4. hattn125 commented on Sep 19, 2023

    @hattn125
    Author

    Ah you're right! The scale works fine with chart.exportChart in your demo. But it used the Highchart server side export.

    In my case, I want to use an offline export on client side (so no data sent to Highchart), then I tried chart.exportChartLocal, but it seems didn't work
    My new demo

    I'm appreciate your support, but can you check again?

  5. karolkolodziej commented on Sep 19, 2023

    @karolkolodziej
    Member

    You are right about the exportChartLocal. The scale isn't properly applied when using offline export.

    As a workaround you can try to declare the sourceWidth and sourceHeight- demo.
    With that, you can sort of manually set the scale.

  6. hattn125 commented on Sep 20, 2023

    @hattn125
    Author

    Yes, sourceWidth and sourceHeight are good for workaround in my case at the moment :)

    Just curious: do you think there is any chance that Highchart will fix it in an offical release, instead of such workaround?

  7. karolkolodziej commented on Sep 20, 2023

    @karolkolodziej
    Member

    Let me bring it to the team and we will see what we can do 😉
    We will keep you posted!

  8. self-assigned this
    on Sep 20, 2023
  9. added a commit that references this issue on Sep 21, 2023
    a390ec6
  10. added a commit that references this issue on Sep 22, 2023
    c60ffff
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