mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
799041171b
commit
0ae9ad6562
22 files changed
+2220
-21
No files matched your search
@@ -77,6 +77,9 @@ func (r *Renderer) WalkPage(page *PageContent, visitor PageVisitor) error {
|
||||
}
|
||||
}
|
||||
for order := range 3 {
|
||||
if r.printing && (r.printContents == "annotations" || r.printContents == "forms") {
|
||||
break
|
||||
}
|
||||
if r.Reader.doc != nil {
|
||||
for _, ref := range page.Template {
|
||||
kind := ref.ZOrder
|
||||
@@ -103,6 +106,18 @@ func (r *Renderer) WalkPage(page *PageContent, visitor PageVisitor) error {
|
||||
}
|
||||
if r.RenderAnnotations {
|
||||
for _, annotation := range r.Reader.Annots[page.ID] {
|
||||
if r.printing && (r.printContents == "document" && annotation.Subtype != "Widget" || r.printContents == "forms" && annotation.Subtype != "Widget" || r.printContents == "annotations" && annotation.Subtype == "Widget") {
|
||||
continue
|
||||
}
|
||||
if r.printing && annotation.Parameters != nil {
|
||||
for _, parameter := range annotation.Parameters.Parameter {
|
||||
if parameter.Name == "PDF.Printable" && (parameter.Value == "true" || parameter.Value == "false") {
|
||||
visible := parameter.Value == "true"
|
||||
annotation.Visible = &visible
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if annotation.Visible != nil && !*annotation.Visible && !pageIncludesHidden(visitor) {
|
||||
continue
|
||||
}
|
||||
@@ -111,6 +126,9 @@ func (r *Renderer) WalkPage(page *PageContent, visitor PageVisitor) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
if r.printing && (r.printContents == "annotations" || r.printContents == "forms") {
|
||||
return nil
|
||||
}
|
||||
for _, stamp := range r.Reader.Stamps[page.ID] {
|
||||
if r.pageContext != nil {
|
||||
if err := r.pageContext.Err(); err != nil {
|
||||
|
||||
Reference in new issue
Block a user