Get pixel size of canvas that is being rendered on camera

How do I get the size (both height and width) of the canvas that is being rendered on my camera?

Say I have a canvas of size 20,0000 width x 10,000 height and a zoomable orthogonal camera. I want to figure how many pixels of the canvas is being rendered. This should vary on different screen resolution and camera zoom size.

Thanks in advance.

I’m being silly. No more working late for me. I can get it by using the ViewportToWorldPoint and compare left to right for width or top to bottom for height like so:

//Get height
camera.ViewportToWorldPoint(new Vector3(0, 0, 0)) - camera.ViewportToWorldPoint(new Vector3(0, 1f, 0))

//Get width
camera.ViewportToWorldPoint(new Vector3(0, 0, 0)) - camera.ViewportToWorldPoint(new Vector3(1f, 0, 0))