Search code examples
asp.net-mvcpdfrazorpdf-generationmvcrazortopdf

MvcRazorToPdf align content to bottom of page


I am trying to get a footer in a generated pdf file. I am using this library https://github.com/andyhutch77/MvcRazorToPdf

Is there any way to get some of my content to the bottom of the page? Unfortunately pdf does not respond to position:absolute; bottom:0px; or margin-bottom.

The page shows an unknown amount of records on the page, so I cannot do it statically.


Solution

  • I found a way to solve this problem. It's not very neat, but I doubt there are other ways since MvcRazorToPdf does not support the margin and position styles.

    <table id="wrapper" style="height:100%;">
        <tr>
            <td valign="top">
                Put your site content here.
            </td>
        </tr>
        <tr>
            <td valign="bottom">
                Put your footer here.
            </td>
        </tr>
    </table>