mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-01 22:17:29 +08:00
Improve documentation comments
This commit is contained in:
parent
7e7292dbff
commit
7912d378a9
@ -289,6 +289,7 @@ func (blk *Block) drawToPage(page *model.PdfPage) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Add block annotations to the page.
|
||||
for _, annotation := range blk.annotations {
|
||||
page.Annotations = append(page.Annotations, annotation)
|
||||
}
|
||||
|
@ -86,6 +86,13 @@ func newStyledParagraph(style TextStyle) *StyledParagraph {
|
||||
}
|
||||
}
|
||||
|
||||
// appendChunk adds the provided text chunk to the paragraph.
|
||||
func (p *StyledParagraph) appendChunk(chunk *TextChunk) *TextChunk {
|
||||
p.chunks = append(p.chunks, chunk)
|
||||
p.wrapText()
|
||||
return chunk
|
||||
}
|
||||
|
||||
// Append adds a new text chunk to the paragraph.
|
||||
func (p *StyledParagraph) Append(text string) *TextChunk {
|
||||
chunk := newTextChunk(text, p.defaultStyle)
|
||||
@ -116,7 +123,7 @@ func (p *StyledParagraph) AddExternalLink(text, url string) *TextChunk {
|
||||
}
|
||||
|
||||
// AddInternalLink adds a new internal link tot the paragraph.
|
||||
// The text param represents the text that is displayed.
|
||||
// The text parameter represents the text that is displayed.
|
||||
// The user is taken to the specified page, at the specified x and y
|
||||
// coordinates. Position 0, 0 is at the top left of the page.
|
||||
// The zoom of the destination page is controlled with the zoom
|
||||
@ -127,13 +134,6 @@ func (p *StyledParagraph) AddInternalLink(text string, page int64, x, y, zoom fl
|
||||
return p.appendChunk(chunk)
|
||||
}
|
||||
|
||||
// appendChunk adds the provided text chunk to the paragraph.
|
||||
func (p *StyledParagraph) appendChunk(chunk *TextChunk) *TextChunk {
|
||||
p.chunks = append(p.chunks, chunk)
|
||||
p.wrapText()
|
||||
return chunk
|
||||
}
|
||||
|
||||
// Reset removes all the text chunks the paragraph contains.
|
||||
func (p *StyledParagraph) Reset() {
|
||||
p.chunks = []*TextChunk{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user