-
Notifications
You must be signed in to change notification settings - Fork 0
/
urltoimage.proto
62 lines (57 loc) · 1.19 KB
/
urltoimage.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
syntax = "proto3";
package liburltoimage;
option go_package = "mxiqi.com/liburltoimage";
service Urltoimage{
// Sends a greeting
rpc Convert(Request) returns (Response) {
}
}
//https://pptr.dev/api/puppeteer.page.screenshot
message Request{
//文件名,可选
string url = 1;
//要转换成的类型,pdf,png/jpg
string size = 2;
string type = 3;
int32 quality = 4;
//是否透明
bool transparent = 5;
PDFOptions pdfoptions = 6;
bool captureBeyondViewport = 7;
}
//https://pptr.dev/api/puppeteer.pdfoptions
message PDFOptions{
//格式A3,A4,A5,Letter,default A4
string format = 1;
bool displayHeaderFooter = 2;
string footerTemplate = 3;
string headerTemplate = 4;
string height = 5;
string width = 6;
//是否横向(默认是竖)
bool landscape = 7;
//是否透明
bool omitBackground = 8;
string pageRanges = 9;
//边距
PDFMargin margin = 10;
bool printBackground = 11;
bool preferCSSPageSize = 12;
}
message PDFMargin{
string bottom=1;
string left=2;
string right=3;
string top=4;
}
message FileContent{
//文件名
string name = 1;
//二进制的文件内容
bytes content= 2;
}
message Response{
int32 code = 1;
string message = 2;
repeated FileContent files=3;
}