private void add_margins_to_html()

in thumbnails4j-doc/src/main/java/co/elastic/thumbnails4j/doc/DOCThumbnailer.java [111:120]


    private void add_margins_to_html(Document html_document){
        // This function is a hack to add "margins" and wrap lines for arbitrary html
        Node body = html_document.getElementsByTagName("body").item(0);
        Element page_div = html_document.createElement("div");
        page_div.setAttribute("style", "width:595.4pt;margin-bottom:36.0pt;margin-top:36.0pt;margin-left:36.0pt;margin-right:36.0pt;");
        while (body.getFirstChild() != null) {
            page_div.appendChild(body.removeChild(body.getFirstChild()));
        }
        body.appendChild(page_div);
    }