Search code examples
phpsymfonywkhtmltopdfphpwkhtmltopdf

wkhtml to pdf creating more than one page while converting pdf


I am using wkhtml to pdf plugin. I want my all output in single page. when my content increased page shifted to another page and content get cut on starting of new page. i am tired with doing this. thanks in advance :) am using setting of a4 page size and orientation in landscape. [reference image ]


Solution

  • Where would you then expect the content to go?

    Unless you have magic stretchy paper, an A4 sheet always going to be an A4 sheet, with limited space for content.

    Therefore setting the maximum height of your Border and background to an A4 dimension is the only sensible option. You would also need to limit the size of the content within the border,

    OR

    If you expect the content to stetch beyond 2 pages, you could set the Border/Background image to fixed, which would then mean the image is repeated on all pages theres an answer for that here: wkhtmltopdf repeatitive background image on all pages