Pointcloud not visible in image export

Hi, I am trying to create an image of the scene with a pointcloud.

viewer.render()
viewer.canvas.toDataUrl()

If I set pointCloudShading attenuation to false everything is rendered as expected. But when it is set to true, pointcloud is not visible in the image.

Is it not possible with attenuation set to true, or am I doing something wrong?