Skip to content

Commit 2187906

Browse files
committed
use creator to write the result to file
1 parent e194fdd commit 2187906

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

text/pdf_add_text_watermark.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ func main() {
7676
c.AddPage(page)
7777
}
7878

79-
writer, err := pdfReader.ToWriter(nil)
80-
if err != nil {
81-
fmt.Printf("Error: %v\n", err)
82-
os.Exit(1)
83-
}
84-
85-
writer.WriteToFile(outputPath)
79+
c.WriteToFile(outputPath)
8680
fmt.Print("Watermark added successfully.\n")
8781
}

text/water_mark_result.pdf

-3.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)