RUPS is an acronym for Reading and Updating PDF Syntax. RUPS is a tool built on top of iText® that allows you to look inside a PDF document and browse the different PDF objects and content streams.
Other
286
stars
34
forks
source link
Minimal example adding line numbers to the Stream View #135
For ease of reference it is useful to have line numbers in the Stream view panel.
The implementation is similar to the indentation implementation in #85
Changes made:
Add LineManager class.
Add appendLineNumber() method to StyledSyntaxDocument.
Tested with basic byte stream.
Considerations:
To quickly enable all existing tests to pass, where the examples do not have line numbers, I overloaded the constructors for StyledSyntaxDocument and LineManager to allow for a boolean parameter numberLines, which toggles whether line numbers are actually printed.
This is a simple hack to get the PoC working, but it actually may be desirable behaviour because the functionality allows something like a toggle button that allows the user to switch line numbers on/off.
TODO:
[ ] Test with more complex byte streams
[ ] Consider how flexible the implementation should be.
For ease of reference it is useful to have line numbers in the Stream view panel.
The implementation is similar to the indentation implementation in #85
Changes made:
LineManager
class.appendLineNumber()
method toStyledSyntaxDocument
.Considerations:
StyledSyntaxDocument
andLineManager
to allow for a boolean parameternumberLines
, which toggles whether line numbers are actually printed.TODO: