summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2014-04-15 20:08:24 -0400
committerKurt Jung <kurt.w.jung@code.google.com>2014-04-15 20:08:24 -0400
commitf7253a9ffd57d84b807b601cf2c8e4563d9b614e (patch)
tree72d341494db87ac07561f0dc1c7d07033e792b47
parent49c0e81fbc7de8b74fabaf6b959ec1fa162bfe62 (diff)
Documentation adjustment.
-rw-r--r--fpdf.go2
-rw-r--r--fpdf_test.go4
2 files changed, 4 insertions, 2 deletions
diff --git a/fpdf.go b/fpdf.go
index 7a6f0c2..4c6fa81 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -2172,6 +2172,8 @@ func (f *Fpdf) SetXY(x, y float64) {
// full access to the document regardless of the actionFlag value. An empty
// string for this argument will be replaced with a random value, effectively
// prohibiting full access to the document.
+//
+// See tutorial 24 for an example of this function.
func (f *Fpdf) SetProtection(actionFlag byte, userPassStr, ownerPassStr string) {
if f.err != nil {
return
diff --git a/fpdf_test.go b/fpdf_test.go
index fc9d6a5..ae0acf9 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -1187,11 +1187,11 @@ func ExampleFpdf_tutorial23() {
// This example demonstrates document protection.
func ExampleFpdf_tutorial24() {
- pdf := gofpdf.New("P", "mm", "A4", cnFontDir) // A4 210.0 x 297.0
+ pdf := gofpdf.New("P", "mm", "A4", cnFontDir)
pdf.SetProtection(gofpdf.CnProtectPrint, "123", "abc")
pdf.AddPage()
pdf.SetFont("Arial", "", 12)
- pdf.Write(10, "You can print me but not copy my text.")
+ pdf.Write(10, "Password-protected.")
pdf.OutputAndClose(docWriter(pdf, 24))
// Output:
// Successfully generated pdf/tutorial24.pdf