When putting the Viewer inside a div container which is smaller than the document, then the Viewer spreads outside that container - see above image.
The Viewer is using position: absolute and “An absolute position based on the next non-static element up the control hierarchy. If no relative [or absolute - Adam] elements are defined on the document the position will be document relative - ie. global absolute.”
So you just have to set your container's position to relative or absolute