Konwertując surowy kod HTML lub strony internetowe do formatu PDF lub DOCX, możesz wymusić wyświetlanie podziałów stron w dokumentach dokładnie w żądanym miejscu, określając break-after:always
i break-inside:avoid
Reguły CSS dla każdego strona chcesz stworzyć. Pamiętaj, że oznacza to, że musisz kontrolować kod HTML konwertowanej strony internetowej.
Na przykład poniższy kod HTML utworzy trzy strony w dokumencie DOCX lub PDF.
<html> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <style type="text/css"> div.page { break-after: page; break-inside: avoid; } </style> </head> <body> <div class="page"> <h1>This is Page 1</h1> </div> <div class="page"> <h1>This is Page 2</h1> </div> <div class="page"> <h1>This is Page 3</h1> </div> </body> </html>