-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add a way to set an object transformation, without applying to the current one #117
Comments
Hi @benoitryder , thank you for reporting the issue. It is possile to set the six matrix parameters to specific values using |
Hi! In my case, if I have a |
If I'm understanding you correctly, I think you could achieve a reset to the identity matrix by using (I'm slightly confused, I think, because of the title of the issue - there really isn't a way to apply a transformation to an object independently of any previously-applied transformations. That is inherent to the design of transforms in PDF. The only real option is to reset all previously-applied transformations by applying the identity matrix to the object.) I've pushed a small change that adds a new |
According to the documentation (and it seems to match the implementation), this will not reset the transformation but apply the identity transformation (thus not changing anything at all). IMHO
pdfium provides |
Ok, I see what you're saying. For whatever reason, I had it in my mind that I agree with you that Updated The |
Thanks! |
Renamed new |
Methods available to change the transformation of objects apply the provided transformation to the current matrix.
There is no method available to "reset" the transformation or force it to a given value (e.g. set translation to an absolute position, reset scale to 1).
A workaround exists: first apply the inverted matrix, then apply the desired transformation. But this may lead to inaccuracy errors, and is not very convenient.
PdfPageObjectPrivate::set_matrix()
does that (it wrapsFPDFPageObj_SetMatrix()
), but it is not public and the name is already taken with a different meaning by the publicset_matrix()
methods.I can think of several relatively easy solutions.
A flexible one would be to expose
PdfPageObjectPrivate::set_matrix()
with a different name (reset_matrix()
?).A method that resets the object's matrix to
PdfMatrix::IDENTITY
would work too.The text was updated successfully, but these errors were encountered: