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

stamp: incorrect positioning on already rotated pages #298

Closed
meerkat-mary opened this issue Feb 20, 2021 · 5 comments
Closed

stamp: incorrect positioning on already rotated pages #298

meerkat-mary opened this issue Feb 20, 2021 · 5 comments
Assignees
Labels

Comments

@meerkat-mary
Copy link

Hi @hhrutter,

I'm running into an issue where stamps are incorrectly added to the bottom left (and rotated 90 degrees to the right) for a portrait page - instead of the bottom right (with no rotation) as intended. Here is the Text description snippet:

text := strconv.Itoa(i)
desc := "pos:br, off: -10 10, align:r, rot:0, sc: 1 abs"
wm, err := api.TextWatermark(text, desc, true, false, pdfcpu.POINTS)

For most PDFs, it correctly adds a page number stamp to the bottom right hand side of the page, however for some PDFs it seems to think they are in landscape format, when I open those PDFs they are in portrait mode and they haven't been manually rotated - any idea on what this could be?

I'll send a sample PDF to your email address shortly

Thanks!

@hhrutter
Copy link
Collaborator

OK please send over a sample.
I'll check.

@hhrutter hhrutter changed the title Stamp position anchor isn't working properly on some portrait PDFs stamp: incorrect positioning on already rotated pages Feb 20, 2021
@hhrutter hhrutter self-assigned this Feb 20, 2021
@hhrutter hhrutter added the bug label Feb 20, 2021
@hhrutter
Copy link
Collaborator

Hi there!

You just discovered pdfcpu misinterprets existing page rotations when stamping 🔥 .

In PDF world clockwise rotation equals positive rotation.
I could complain about this not to be intuitive as far as trigonometry is concerned but that won't make a difference unfortunately.. Thanks for reporting this 💚

@meerkat-mary
Copy link
Author

No problem :) thanks for looking into this!

hhrutter added a commit that referenced this issue Feb 26, 2021
@hhrutter
Copy link
Collaborator

This is fixed with the latest commit!

@meerkat-mary
Copy link
Author

Thanks @hhrutter !!

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

No branches or pull requests

2 participants