diff --git a/README.md b/README.md index 450b5df..950ccac 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,11 @@ All conversion parameters and explanations can be found [here](https://www.conve ```go jpgRes := convertapi.ConvDef("pdf", "jpg", - param.NewResult("file", extractRes, nil), - param.NewBool("scaleimage", true), - param.NewBool("scaleproportions", true), + param.NewPath("file", "test.pdf", nil), + param.NewString("pagerange", "1"), + param.NewInt("imagewidth", 300), param.NewInt("imageheight", 300), + param.NewBool("fittosize", true), ) ``` diff --git a/examples/thumbnail/main.go b/examples/thumbnail/main.go index 15da9d7..2af4a4e 100644 --- a/examples/thumbnail/main.go +++ b/examples/thumbnail/main.go @@ -12,15 +12,9 @@ func main() { config.Default = config.NewDefault(os.Getenv("API_TOKEN")) // Get your token at https://www.convertapi.com/a/authentication fmt.Println("Creating PDF thumbnail") - extractRes := convertapi.ConvDef("pdf", "jpg", + jpgRes := convertapi.ConvDef("pdf", "jpg", param.NewPath("file", "assets/test.pdf", nil), param.NewString("pagerange", "1"), - ) - - jpgRes := convertapi.ConvDef("jpg", "jpg", - param.NewResult("file", extractRes, nil), - param.NewBool("scaleimage", true), - param.NewBool("scaleproportions", true), param.NewInt("imageheight", 300), ) @@ -30,4 +24,4 @@ func main() { fmt.Println(errs) } -} \ No newline at end of file +}