-
Notifications
You must be signed in to change notification settings - Fork 343
Path transformation to userspace #4
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
Conversation
public Path TransformPath(Matrix ctm) | ||
{ | ||
Path transformedPath = new Path(); | ||
foreach (Subpath subpath in subpaths) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you don't use 'var'?
|
||
return transformedCurve; | ||
} | ||
catch (Exception e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to log exception! Why you use try-catch construction and throw exception? Its not correct!
/// </summary> | ||
/// <param name="ctm">the matrix for the transformation</param> | ||
/// <returns>the transformed shape</returns> | ||
IShape TransformToUserspace(Matrix ctm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Open Closed Principle(second SOLID principle) You need to extend abstractions! Will add a new interface with a IShape TransformToUserspace method!
|
||
AffineTransform t = new AffineTransform(ctm.Get(Matrix.I11), ctm.Get(Matrix | ||
.I12), ctm.Get(Matrix.I21), ctm.Get(Matrix.I22), ctm.Get(Matrix.I31), ctm.Get(Matrix.I32)); | ||
//t = t.CreateInverse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
} | ||
catch (Exception e) | ||
{ | ||
throw new Exception(e.Message, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add logging
Hi @Excalib88 , |
Hi @Moneema14
As a result, we offer you the following corrections:
Also, according to iText Contributor License Agreement, for any non-trivial (more than 20 significant lines of code) pull request, we need a signed CLA to be in the clear regarding IP. We are waiting for your reply. |
Hi @Moneema14, thanks again for the contribution and sorry for the delay. We have added a possibility to transform shapes to user space in commit 7ef8601 I am now going to close this pull request. Your contribution suggestions are always welcome! Best, |
Hi @Moneema14, we are looking for a way to contact you to discuss one small topic regarding your contribution. Would you be available for that? If so, could you type me at alexey.subach[at]itextpdf.com ? Thanks! |
There is a clippingpath transformation method in ParserGraphicsState.cs file. Which is a Private method and we cant use it for other any kind of path. So, to extract path(not clipping path) from pdf files we need a path transformation method. This changes allow us to transform extracting path to userspace