You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: controller/types.go
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ type Html2PdfRequestDTO struct {
26
26
HeaderTemplatestring`schema:"headerTemplate,omitempty" validate:"omitempty"`// HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document For example, <span class=title></span> would generate span containing the title.
27
27
FooterTemplatestring`schema:"footerTemplate,omitempty" validate:"omitempty"`// HTML template for the print footer. Should use the same format as the headerTemplate.
28
28
PreferCSSPageSizebool`schema:"preferCSSPageSize,omitempty" validate:"omitempty"`// Whether or not to prefer page size as defined by css. core.Defaults to false, in which case the content will be scaled to fit the paper size.
29
+
WaitingTimeint`schema:"waitingTime,omitempty" validate:"omitempty"`// Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond
29
30
}
30
31
31
32
typeHtml2ImageRequestDTOstruct {
@@ -39,6 +40,7 @@ type Html2ImageRequestDTO struct {
39
40
ClipHeightfloat64`schema:"clipHeight,omitempty" validate:"omitempty"`// Capture the screenshot of a given region only.Rectangle height in device independent pixels (dip).
40
41
ClipScalefloat64`schema:"clipScale,omitempty" validate:"omitempty"`// Capture the screenshot of a given region only.Page scale factor.
41
42
FromSurfacebool`schema:"fromSurface,omitempty" validate:"omitempty"`// Capture the screenshot from the surface, rather than the view. Defaults to true.
43
+
WaitingTimeint`schema:"waitingTime,omitempty" validate:"omitempty"`// Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond
Copy file name to clipboardExpand all lines: converter/doctron_core/html2pdf.go
+26-18Lines changed: 26 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -3,64 +3,70 @@ package doctron_core
3
3
import (
4
4
"context"
5
5
"errors"
6
+
"time"
7
+
6
8
"github.com/chromedp/cdproto/page"
7
9
"github.com/chromedp/chromedp"
8
-
"time"
9
10
)
10
11
11
-
// Paper orientation. Defaults to false.
12
+
//DefaultLandscape Paper orientation. Defaults to false.
12
13
constDefaultLandscape=false
13
14
14
-
// Display header and footer. Defaults to false.
15
+
//DefaultDisplayHeaderFooter Display header and footer. Defaults to false.
15
16
constDefaultDisplayHeaderFooter=false
16
17
17
-
// Print background graphics. Defaults to true.
18
+
//DefaultPrintBackground Print background graphics. Defaults to true.
18
19
constDefaultPrintBackground=true
19
20
20
-
// Scale of the webpage rendering. Defaults to 1.
21
+
//DefaultScale Scale of the webpage rendering. Defaults to 1.
21
22
constDefaultScale=1
22
23
23
-
// Paper width in inches. Defaults to 8.5 inches.
24
+
//DefaultPaperWidth Paper width in inches. Defaults to 8.5 inches.
24
25
constDefaultPaperWidth=8.5
25
26
26
-
// Paper height in inches. Defaults to 11 inches.
27
+
//DefaultPaperHeight Paper height in inches. Defaults to 11 inches.
27
28
constDefaultPaperHeight=11
28
29
29
-
// Top margin in inches. Defaults to 1cm (~0.4 inches).
30
+
//DefaultMarginTop Top margin in inches. Defaults to 1cm (~0.4 inches).
30
31
constDefaultMarginTop=0.4
31
32
32
-
// Bottom margin in inches. Defaults to 1cm (~0.4 inches).
33
+
//DefaultMarginBottom Bottom margin in inches. Defaults to 1cm (~0.4 inches).
33
34
constDefaultMarginBottom=0.4
34
35
35
-
// Left margin in inches. Defaults to 1cm (~0.4 inches).
36
+
//DefaultMarginLeft Left margin in inches. Defaults to 1cm (~0.4 inches).
36
37
constDefaultMarginLeft=0.4
37
38
38
-
// Right margin in inches. Defaults to 1cm (~0.4 inches).
39
+
//DefaultMarginRight Right margin in inches. Defaults to 1cm (~0.4 inches).
39
40
constDefaultMarginRight=0.4
40
41
41
-
// Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
42
+
//DefaultPageRanges Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
42
43
constDefaultPageRanges=""
43
44
44
-
// Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
45
+
//DefaultIgnoreInvalidPageRanges Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
45
46
constDefaultIgnoreInvalidPageRanges=false
46
47
47
-
// HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document For example, <span class=title></span> would generate span containing the title.
48
+
//DefaultHeaderTemplate HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document For example, <span class=title></span> would generate span containing the title.
48
49
constDefaultHeaderTemplate=""
49
50
50
-
// HTML template for the print footer. Should use the same format as the headerTemplate.
51
+
//DefaultFooterTemplate HTML template for the print footer. Should use the same format as the headerTemplate.
51
52
constDefaultFooterTemplate=""
52
53
53
-
// Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
54
+
//DefaultPreferCSSPageSize Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
54
55
constDefaultPreferCSSPageSize=false
55
56
56
-
// PrintToPDFParams print page as PDF.
57
+
//DefaultWaitingTime Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond
58
+
constDefaultWaitingTime=0
59
+
60
+
// PDFParams print page as PDF.
57
61
typePDFParamsstruct {
58
62
page.PrintToPDFParams
63
+
WaitingTimeint// Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond
0 commit comments