Hi,
We are using UltimatePDF Forge for PDF generation with configured header and footer sections. After enabling Content Security Policy (CSP) in the environment, we started facing a layout issue in the generated PDFs.
Currently, both the header and footer are overlapping with the main content area instead of maintaining proper spacing and alignment.
Kindly review the attached screenshot for reference and help us identify the root cause and possible resolution.
Hoping for your assistance.
Thanks.
Hi @Vijay Dhasnamoorthy,
UltimatePDF uses a Chromium-based rendering engine to convert an HTML screen into PDF. The layout logic for header, main content, and footer spacing relies heavily on:
When Content Security Policy (CSP) is enabled at the environment level, one or more of these internal mechanisms can be blocked.
This causes:
From UltimatePDF’s own implementation and documentation:
Recommended resolution
Update CSP to allow inline styles: HTTPstyle-src 'self' 'unsafe-inline';
Hope this helps,
Cheers.
Saugat
Hi @Vijay Dhasnamoorthy
Did the issue start immediately after enabling CSP? If yes, please check for CSP violations in the browser console and Service Center logs. Ultimate PDF may be unable to load styles, fonts, or images used in the header/footer, causing incorrect height calculation and overlap with the main content.
Also verify that page margins are explicitly defined and test with CSP temporarily relaxed in a non-production environment to confirm the correlation.