Getting the dimensions of a .html image

I am able to convert an html to a pdf properly when I hard-code the dimensions. I was wondering if it were possible to convert the html to an image to get its dimensions before I convert to pdf? I can already do so however it forces the “portrait” dimensions onto the image.

@sjonesi

I am afraid I did not get your point. Do you mean that when you convert an HTML to image, the API always convert it to portrait dimensions? Please share some more details. Please share your sample input HTML and output image along with the expected output. It will help us to address your issue exactly.