cssnode.jsrazorhtml-pdfnode-html-pdf

NodeJs HTML-PDF Library <pre> tag cutting PDF at right page


I'm having an issue with a node libray (html-pdf). I'm trying to render html to pdf, but the PDF page is not showing correctly.

When I try to insert a tag, the workflow is cutting the right side of the page, and it doesn't show the entire text. How can I solve it?

I've tried applying diferent styles to the tag but none of them works... Here is a screenshot about my problem:

enter image description here

Thank you in advance.


Solution

  • After some research, I found a solution for my case. Adding this code to my CSS worked.

    pre {
                white-space: pre-wrap;
                /* Since CSS 2.1 */
                white-space: -moz-pre-wrap;
                /* Mozilla, since 1999 */
                white-space: -pre-wrap;
                /* Opera 4-6 */
                white-space: -o-pre-wrap;
                /* Opera 7 */
                word-wrap: break-word;
                /* Internet Explorer 5.5+ */
            }