We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
I do follow import the pdf page in the example and it works like a charm
package main import ( "bytes" "github.com/phpdave11/gofpdf" "github.com/phpdave11/gofpdf/contrib/gofpdi" "io" "io/ioutil" "net/http" ) func main() { var err error pdf := gofpdf.New("P", "mm", "A4", "") // Download a PDF into memory res, err := http.Get("https://tcpdf.org/files/examples/example_038.pdf") if err != nil { panic(err) } pdfBytes, err := ioutil.ReadAll(res.Body) res.Body.Close() if err != nil { panic(err) } // convert []byte to io.ReadSeeker rs := io.ReadSeeker(bytes.NewReader(pdfBytes)) // Import in-memory PDF stream with gofpdi free pdf document importer tpl1 := gofpdi.ImportPageFromStream(pdf, &rs, 1, "/TrimBox") pdf.AddPage() pdf.SetFillColor(200, 700, 220) pdf.Rect(20, 50, 150, 215, "F") // Draw imported template onto page gofpdi.UseImportedTemplate(pdf, tpl1, 20, 50, 150, 0) pdf.SetFont("Helvetica", "", 20) pdf.Cell(0, 0, "Import PDF stream into gofpdf document with gofpdi") err = pdf.OutputFileAndClose("example.pdf") if err != nil { panic(err) } }
But when I use SetProtection function, then all content of the imported page was gone pdf.SetProtection(gofpdf.CnProtectAnnotForms, "1", "a")
pdf.SetProtection(gofpdf.CnProtectAnnotForms, "1", "a")
As my demand is import a pdf page and set password for the pdf file, please help me walkthrough this
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
I do follow import the pdf page in the example and it works like a charm
But when I use SetProtection function, then all content of the imported page was gone
pdf.SetProtection(gofpdf.CnProtectAnnotForms, "1", "a")
As my demand is import a pdf page and set password for the pdf file, please help me walkthrough this
The text was updated successfully, but these errors were encountered: