This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ req.Footer(footer)
4646req.Assets (style, img)
4747req.PaperSize (gotenberg.A4 )
4848req.Margins (gotenberg.NoMargins )
49+ req.Scale (0.75 )
4950
5051// store method allows you to... store the resulting PDF in a particular destination.
5152client.Store (req, " path/you/want/the/pdf/to/be/stored.pdf" )
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const (
1616 landscapeChrome string = "landscape"
1717 pageRanges string = "pageRanges"
1818 googleChromeRpccBufferSize string = "googleChromeRpccBufferSize"
19+ scale string = "scale"
1920)
2021
2122// nolint: gochecknoglobals
@@ -101,3 +102,8 @@ func (req *chromeRequest) PageRanges(ranges string) {
101102func (req * chromeRequest ) GoogleChromeRpccBufferSize (bufferSize int64 ) {
102103 req .values [googleChromeRpccBufferSize ] = strconv .FormatInt (bufferSize , 10 )
103104}
105+
106+ // Scale sets scale form field
107+ func (req * chromeRequest ) Scale (scaleFactor float64 ) {
108+ req .values [scale ] = fmt .Sprintf ("%f" , scaleFactor )
109+ }
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ func TestHTMLComplete(t *testing.T) {
7777 req .Margins (NormalMargins )
7878 req .Landscape (false )
7979 req .GoogleChromeRpccBufferSize (1048576 )
80+ req .Scale (1.5 )
8081 dirPath , err := test .Rand ()
8182 require .Nil (t , err )
8283 dest := fmt .Sprintf ("%s/foo.pdf" , dirPath )
You can’t perform that action at this time.
0 commit comments