Skip to content

Commit 26e944f

Browse files
committed
add readme
1 parent 21e61a1 commit 26e944f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README-zh.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# 支持中文的chromedp/headless-shell
2+
3+
基于官方的chromedp/headless-shell,添加了中文的支持,主要通过安装字体,使用阿里云镜像优化
4+
5+
```bash
6+
在linux环境可以通过以下命令来运行,程序请在release页面下载或通过源码构建
7+
./go-pdf -url=http://www.baidu.com -path=./baidu.pdf
8+
```
9+
10+
## 使用
11+
12+
### 依赖
13+
14+
1. docker
15+
2. go(for demostration)
16+
17+
### 使用dockerfile构建镜像
18+
19+
```bash
20+
bash pdf.sh
21+
```
22+
23+
### 拉取预构建镜像
24+
25+
```bash
26+
docker pull registry.cn-hangzhou.aliyuncs.com/programnotes/chromedp-headless-shell-suport-chinese:v1.2
27+
28+
# run container using script
29+
bash run-pull-container.sh
30+
```
31+
32+
### 测试
33+
34+
```bash
35+
curl -X GET http://localhost:9222/json
36+
```
37+
38+
通过curl调接口看到类似输出说明部署成功了
39+
```bash
40+
[ {
41+
"description": "",
42+
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/ D2502817BA8C5F804A663645ECEA3054",
43+
"id": "D2502817BA8C5F804A663645ECEA3054",
44+
"title": "about:blank",
45+
"type": "page",
46+
"url": "about:blank",
47+
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/D2502817BA8C5F804A663645ECEA3054"
48+
} ]
49+
```

0 commit comments

Comments
 (0)