This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree 3 files changed +8
-0
lines changed
3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ req.Footer(footer)
46
46
req.Assets (style, img)
47
47
req.PaperSize (gotenberg.A4 )
48
48
req.Margins (gotenberg.NoMargins )
49
+ req.Scale (0.75 )
49
50
50
51
// store method allows you to... store the resulting PDF in a particular destination.
51
52
client.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 (
16
16
landscapeChrome string = "landscape"
17
17
pageRanges string = "pageRanges"
18
18
googleChromeRpccBufferSize string = "googleChromeRpccBufferSize"
19
+ scale string = "scale"
19
20
)
20
21
21
22
// nolint: gochecknoglobals
@@ -101,3 +102,8 @@ func (req *chromeRequest) PageRanges(ranges string) {
101
102
func (req * chromeRequest ) GoogleChromeRpccBufferSize (bufferSize int64 ) {
102
103
req .values [googleChromeRpccBufferSize ] = strconv .FormatInt (bufferSize , 10 )
103
104
}
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) {
77
77
req .Margins (NormalMargins )
78
78
req .Landscape (false )
79
79
req .GoogleChromeRpccBufferSize (1048576 )
80
+ req .Scale (1.5 )
80
81
dirPath , err := test .Rand ()
81
82
require .Nil (t , err )
82
83
dest := fmt .Sprintf ("%s/foo.pdf" , dirPath )
You can’t perform that action at this time.
0 commit comments