how to generate a responsive PDF with Django?
<p>how to generate a responsive PDF with Django?.</p>

<p>I want to generate a PDF with Django but i need that is responsive, that is to say, the text of the PDF has that adapted to don't allow space empty.</p>

<p>for example to a agreement this change in the text, then, i need to adapt the to space of paper leaf.</p>

<p>PDF is not built to be responsive, it is built to display the same no matter where it is viewed.</p>

<p>As @alxs pointed out in a comment, there are a few features that PDF viewing applications have added to simulate PDFs being responsive. Acrobat's <em>Reflow</em> feature is the best example of this that I am aware of and even it struggles with most PDFs that users come across in the wild.</p>

<p>One of the components (if not the only one) that matters, is that in order for a PDF to be useful in Acrobat's <em>Reflow</em> mode is to make sure that the PDFs you are creating contain structure information, this would be a Tagged PDF. Tagged PDF contains content that has been marked, similar to HTML tags, where text that makes up a paragraph is tagged in the PDF as being a paragraph. A number of PDF tools (creation or viewing) do not interpret the structure of a PDF though.</p>

python html django pdf-generation weasyprint