-
Notifications
You must be signed in to change notification settings - Fork 869
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
PDFBOX-4073 Choosable Coordinate-Unitsystem #114
Open
habbisify
wants to merge
24
commits into
apache:trunk
Choose a base branch
from
habbisify:sprint2-feature-pr
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use spaces after control flow keywords
Prefer switch statements over multi-clause if-then statements.
Sprint2/testbranch
Documentation fix for convertUnit().
I can't remember that said that but I see I wrote it in the issue. And yes it's true 😂. I just had to create a PDF a week ago based on an existing PDF from a software that will be replaced. I used PDFDebugger and moved the mouse and saw the coordinates. The current code is just a tool that converts a list of numbers, that might make it more verbose, i.e. add to a list, convert, retrieve from the list. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is discussed in Jira ticket:
https://issues.apache.org/jira/browse/PDFBOX-4073
Our take on this: There could be a need to work with millimetres or inches instead of points. @THausherr commented that he uses PDFBox with points and adjusts the parameters via trial and error until he likes what he sees. However, our take on this topic is that there are documents which are strictly standardized to have certain measures, such as offset from the paper edges, in millimetres or inches.
Another concern by @lehmi was that the original idea of the reporter, "a central setting of an unitconverter so that every coordinate is converted deep inside shortly before rendering", is problematic since it will ultimately lead to more complicated and error prone code. We agree with this point.
Therefore, instead of implementing an internal unitconverter setting, we simply implemented a convertUnit method inside PDAbstractContentStream to do the unitconversion from mm or inches to points. This will not complicate other code or make it more error prone - it is just a stand-alone method to do the conversion. Basic test was also implemented to check that the unitconversion works as expected with the convertUnit method.
Please note, this PR is a mandatory part of the university course we are taking. However, acceptance of the PR is not required. This is also the last submission of our group during this course.
What do you think?