jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.31k stars 777 forks source link

How to add watarmark to pdf ? #240

Closed zsr228 closed 5 years ago

zsr228 commented 5 years ago

As title, In your fpdf_test.go , I can't find a function to add watermark to pdf ?

jung-kurt commented 5 years ago

To make a watermark that repeats on each page, use the SetHeaderFunc() method. This lets you draw anywhere on the page as long as you reset the X and Y values before leaving the header function so that normal content begins where expected.

Adding a watermark to a document is demonstrated in the TransformRotate example.

zsr228 commented 5 years ago

3q, @jung-kurt , tomorrow let me have a try。

zsr228 commented 5 years ago

pdf.SetHeaderFunc() can add watermark,thank u。 another problem is, I did't find open exist pdf function @jung-kurt and when to support chinese(issues/109 I had read) ?

zsr228 commented 5 years ago

I had read issues/8,all my problem has resolved. but I still expect other contributor can finish read a pdf file as a template function. Best wish to gofpdf.

jung-kurt commented 5 years ago

Please reopen if this is still an issue.