From f5f03a0412b2f86b2f5b90ecb8db555bd664ec13 Mon Sep 17 00:00:00 2001 From: Matias Insaurralde Date: Tue, 21 Nov 2023 14:52:54 +0000 Subject: [PATCH] Fix README samples Signed-off-by: Matias Insaurralde --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9751a10c..cff8ef55 100644 --- a/README.md +++ b/README.md @@ -544,7 +544,7 @@ func getPageCount(filePath string) (int, error) { }) pageCount, err := instance.FPDF_GetPageCount(&requests.FPDF_GetPageCount{ - Document: doc, + Document: doc.Document, }) if err != nil { return 0, err @@ -605,7 +605,7 @@ func renderPage(filePath string, page int, output string) error { DPI: 200, // The DPI to render the page in. Page: requests.Page{ ByIndex: &requests.PageByIndex{ - Document: doc, + Document: doc.Document, Index: 0, }, }, // The page to render, 0-indexed. @@ -626,7 +626,7 @@ func renderPage(filePath string, page int, output string) error { } defer f.Close() - err = png.Encode(f, pageRender.Image) + err = png.Encode(f, pageRender.Result.Image) if err != nil { return err }