Search code examples
htmlcsspdfprintingwkhtmltopdf

Wkhtmltopdf Vertical text on right hand side of every page


Below is example of PDF produced using wkhtmltopdf. I need to produce text down the right spine of the every page. I have tried adding it to the header code put seems to clip the body of the PDF. I am using header and footer parameters of wkhtmltopdf. Not too sure how or if i can get this text on right hand side of every page.

Example of want pdf to look like


Solution

  • You can use CSS and set the position of the element to fixed. Try this:

    .vertical-text {
        position: fixed;
        -webkit-transform: rotate(90deg);
        -webkit-transform-origin: center bottom auto;
        top: 50%;
        right: 0;
    }