-
Notifications
You must be signed in to change notification settings - Fork 87
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 Creator support for outlines #321
Conversation
Codecov Report
@@ Coverage Diff @@
## v3 #321 +/- ##
==========================================
- Coverage 38.99% 38.56% -0.43%
==========================================
Files 120 121 +1
Lines 22945 23081 +136
==========================================
- Hits 8947 8901 -46
- Misses 12743 12899 +156
- Partials 1255 1281 +26
Continue to review full report at Codecov.
|
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.
Reviewed 5 of 5 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @adrg)
a discussion (no related file):
Looks great. Couple of suggestions and questions.
pdf/model/outline.go, line 112 at r1 (raw file):
// OutlineItem represents a PDF outline item dictionary (Table 153 - pp. 376 - 377). type OutlineItem struct {
Good approach to wrap the PdfOutlineItem in an OutlineItem (higher level), separating the creation function and the logic.
Can this also be used when reading the outlines, e.g. getting a list of all outlines?
Might be good to add a comment that this is intended for creation use.
pdf/model/outlines.go, line 50 at r1 (raw file):
func NewPdfOutline() *PdfOutline { outline := &PdfOutline{ primitive: &PdfIndirectObject{
More concise syntax: core.MakeIndirect(core.MakeDict())
pdf/model/outlines.go, line 69 at r1 (raw file):
func NewPdfOutlineItem() *PdfOutlineItem { outlineItem := &PdfOutlineItem{ primitive: &PdfIndirectObject{
same here
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.
Reviewable status: 3 of 5 files reviewed, 4 unresolved discussions (waiting on @adrg and @gunnsth-review)
pdf/model/outline.go, line 112 at r1 (raw file):
Previously, gunnsth-review wrote…
Good approach to wrap the PdfOutlineItem in an OutlineItem (higher level), separating the creation function and the logic.
Can this also be used when reading the outlines, e.g. getting a list of all outlines?
Might be good to add a comment that this is intended for creation use.
I added a comment on the Outline struct specifying that currently it can be used only to build outlines. The outline object could be used to also read the outlines from a PDF file.
I think we should do this in another pull request though and make this one about the Creator. The interface for the high-level outlines could contain a method for reading outlines from a PDF file, one for printing them in user friendly format. Maybe merging and splitting as well.
pdf/model/outlines.go, line 50 at r1 (raw file):
Previously, gunnsth-review wrote…
More concise syntax: core.MakeIndirect(core.MakeDict())
Done.
pdf/model/outlines.go, line 69 at r1 (raw file):
Previously, gunnsth-review wrote…
same here
Done.
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.
Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @adrg)
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.
Reviewable status: complete! all files reviewed, all discussions resolved
Generate PDF outlines automatically for Chapter and Subchapter components in the Creator.
Also, adds a high level interface for creating outline trees in the model package, compatible with the
low level interface.
Resolves #87
Resolves #14
This change is