I have a react project displaying a Highcharts chart. I want to export the chart into a PDF.
const svg = scatterChartRef.current.chart.getSVG()
const imageBuffer = Buffer.from(svg)
const MyDocument = () => (
<Document>
<Page size="A4" style={styles.page}>
<View style={styles.section}>
<Image src={imageBuffer} debug={false} />
</View>
unfortunately this does not work, i'm assuming because react-pdf wants png or jpg image.
how can i convert my chart to png/jpg?
it seems the built in highcharts export methods only allow to trigger the download of a png or jpg, not provide a reference in code to a png/jpg buffer.