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
description: "Converts a URL to a PDF file with customizable options. [See documentation](https://pdfmunk.com/api-docs#:~:text=Operations%20related%20to%20PDF)",
7
+
version: "0.0.1",
8
+
type: "action",
9
+
props: {
10
+
app,
11
+
url: {
12
+
type: "string",
13
+
label: "Website URL",
14
+
description: "The URL of the website to convert to PDF",
15
+
},
16
+
paper_size: {
17
+
type: "string",
18
+
label: "Paper Size",
19
+
description: "The paper size for the PDF",
20
+
options: [
21
+
{
22
+
label: "A4",
23
+
value: "A4",
24
+
},
25
+
{
26
+
label: "A3",
27
+
value: "A3",
28
+
},
29
+
{
30
+
label: "A5",
31
+
value: "A5",
32
+
},
33
+
{
34
+
label: "Letter",
35
+
value: "Letter",
36
+
},
37
+
{
38
+
label: "Legal",
39
+
value: "Legal",
40
+
},
41
+
{
42
+
label: "Tabloid",
43
+
value: "Tabloid",
44
+
},
45
+
],
46
+
default: "A4",
47
+
},
48
+
landscape: {
49
+
type: "boolean",
50
+
label: "Landscape",
51
+
description: "Whether to use landscape orientation",
52
+
default: false,
53
+
},
54
+
displayHeaderFooter: {
55
+
type: "boolean",
56
+
label: "Display Header Footer",
57
+
description: "Whether to display header and footer",
58
+
default: false,
59
+
},
60
+
page_size: {
61
+
type: "integer",
62
+
label: "Page Size",
63
+
description: "The page size in points",
64
+
default: 5,
65
+
},
66
+
printBackground: {
67
+
type: "boolean",
68
+
label: "Print Background",
69
+
description: "Whether to print background graphics",
70
+
default: true,
71
+
},
72
+
},
73
+
asyncrun({ $ }){
74
+
const{
75
+
url,
76
+
paper_size,
77
+
landscape,
78
+
displayHeaderFooter,
79
+
page_size,
80
+
printBackground,
81
+
}=this;
82
+
83
+
constresponse=awaitthis.app.captureWebsiteToPdf({
84
+
$,
85
+
url,
86
+
paper_size,
87
+
landscape,
88
+
displayHeaderFooter,
89
+
page_size,
90
+
printBackground,
91
+
});
92
+
93
+
$.export("$summary",`Successfully converted ${url} to PDF`);
description: "Converts HTML/CSS content to a PDF file with customizable options. [See documentation](https://pdfmunk.com/api-docs#:~:text=Operations%20related%20to%20PDF)",
7
+
version: "0.0.1",
8
+
type: "action",
9
+
props: {
10
+
app,
11
+
html_content: {
12
+
type: "string",
13
+
label: "HTML Content",
14
+
description: "The HTML content to convert to PDF",
15
+
},
16
+
css_content: {
17
+
type: "string",
18
+
label: "CSS Content",
19
+
description: "The CSS content to style the HTML",
20
+
optional: true,
21
+
},
22
+
paper_size: {
23
+
type: "string",
24
+
label: "Paper Size",
25
+
description: "The paper size for the PDF",
26
+
options: [
27
+
{
28
+
label: "A4",
29
+
value: "A4",
30
+
},
31
+
{
32
+
label: "A3",
33
+
value: "A3",
34
+
},
35
+
{
36
+
label: "A5",
37
+
value: "A5",
38
+
},
39
+
{
40
+
label: "Letter",
41
+
value: "Letter",
42
+
},
43
+
{
44
+
label: "Legal",
45
+
value: "Legal",
46
+
},
47
+
{
48
+
label: "Tabloid",
49
+
value: "Tabloid",
50
+
},
51
+
],
52
+
default: "A4",
53
+
},
54
+
page_size: {
55
+
type: "integer",
56
+
label: "Page Size",
57
+
description: "The page size in points",
58
+
default: 2,
59
+
},
60
+
},
61
+
asyncrun({ $ }){
62
+
const{
63
+
html_content,
64
+
css_content,
65
+
paper_size,
66
+
page_size,
67
+
}=this;
68
+
69
+
constresponse=awaitthis.app.convertHtmlToPdf({
70
+
$,
71
+
html_content,
72
+
css_content,
73
+
paper_size,
74
+
page_size,
75
+
});
76
+
77
+
$.export("$summary","Successfully converted HTML to PDF");
0 commit comments