How to export plot to .png or .svg in an angular app?

I am using the angular-plotly package to put some graphs into my angular application. If I have a parent component that contains a plotly-plot child component, how can export the plot (from a typescript function) into a png or svg dat url such that I can then later embed it into a pdf that is generated by my application (client-side)?

I can get a reference to the plotly-plot component using ViewChild, but then I don’t see any method on that component to convert to a static image… I see there is a toImage method on the Plotly object, but not sure how to access that method from within my component.

Thanks in advance for any help.