Rails: WickedPDF: Page Breaks

前端 未结 6 2050
灰色年华
灰色年华 2020-12-13 12:55

In my Ruby (1.9.2) Rails (3.0.x) I would like to render a web page as PDF using wicked_pdf, and I would like to control where the page breaks are. My CSS code to control pag

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 13:44

    i had the same issue and what ended up working for me was to make sure that my element with

    page-break: always;
    

    was on the root of the document, seems when its nested inside of other elements, especially ones with height assigned, the declaration gets ignored.

    hope this helps someone.

提交回复
热议问题