Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF files created with Wicked PDF would not be stamped / numbered correctly #8

Closed
boazsegev opened this issue Dec 18, 2014 · 0 comments

Comments

@boazsegev
Copy link
Owner

This issue was reported by Saba.

Looking into the issue, I discovered that the Wicked PDF's engine ( wkhtmltopdf ) doesn’t wrap the PDF content streams correctly.

to be more technical:

Immediately at the start of each page’s content stream, wkhtmltopdf creates a 'transformation' to the drawing engine (using the PDF command: 0.060000000 0 0 -0.060000000 28.3200000 813.679999 cm)…

This transformation isn’t wrapped in a container (the PDF commands q and Q), so that the transformation effects all the content streams as well as the original content.

The end result is that the stamped content (page numbering / watermark / overlaid page) is resized and appears inverted (upside down and mirror like) in the top left corner of the PDF page - which is an unexpected bug caused by this malformed PDF.

This was fixed by injecting a wrapper around the all the content streams, each time content is injected to an existing PDF page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant