-
Notifications
You must be signed in to change notification settings - Fork 359
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
Implement text justification in PDF-BOX output device #3
Comments
I've read in stackoverflow [1] about the class: InlineBoxing (package com.openhtmltopdf.layout;) [1] http://stackoverflow.com/questions/36982586/flying-saucer-generates-pdf-with-badly-justified-text
add before: And it works fine for flying-saucer, but not to openhtmltopdf :( |
I've managed to get PdfBox to actually start adding spacing by upgrading to pdfbox 2.0.2 and changing the PdfPageContentStream's setTextSpacing and setSpaceSpacing to:
appendRawCommands is deprecated, but PdfBox still doesn't support the Tw and Tc operators. The spacing is wrong, I guess the LineBox.justify() method needs some rework as well. I managed to make word spacing work correctly by changing:
to
Yeah it's ugly as hell but you get the drill :) |
Thanks @surfx and especially @HiddenDog for the code. I'll try to look at this in the next 24 hours but I think you've put me in the right direction. |
…n and added tests for text justification. Thanks again @HiddenDog - text justification now works great.
Thanks everyone - now working well. |
#8 Online sandbox now at RC18. [ci skip]
Support classpath protocol
As of PDF-BOX 2.0.0-RC3 there is no way to implement text justification. Need to open PDF-BOX JIRA issue asking them to implement the text spacing and space spacing operators.
The text was updated successfully, but these errors were encountered: