Is there a way to get the content height of the embed element with JS?

I tried to embed a PDF document in a web page and found that I could never get the exact height of the PDF document, so a scroll bar appeared.

<embed id="pdf" width="100%" height="1000px" name="plugin" id="plugin" src="http://localhost:8080/static/assets/%E7%AC%AC%E5%8D%81%E4%B8%80%E5%B1%8A%E5%85%A8%E5%9B%BD%E9%85%B6%E5%AD%A6%E5%AD%A6%E6%9C%AF%E8%AE%A8%E8%AE%BA%E4%BC%9A%E6%9A%A8%E9%82%B9%E6%89%BF%E9%B2%81%E8%AF%9E%E8%BE%B090%E5%91%A8%E5%B9%B4%E7%BA%AA%E5%BF%B5%E4%BC%9A%EF%BC%88%E7%AC%AC%E4%B8%80%E8%BD%AE%E9%80%9A%E7%9F%A5%EF%BC%89.pdf" type="application/pdf" internalinstanceid="13">

try to get the element, where either clientHeight or scrollHeight is the height of its viewport.

has also tried to embed an iframe, directly, but still can"t get the actual height inside it, so is there any way to get the actual height of the embed?

Mar.13,2021

embed is an embedded content tag, iframe upgrade. The actual height of embed is self-defined, and the actual height of pdf has nothing to do with the height of embed. The specific height of the pdf can be calculated by page number and resolution

Menu