Fixed an issue where the page count of generated documents did not match the document preview.
Generated documents now preserve the same pagination as the preview, ensuring consistent page counts and layout between the preview and the final document.