# auto_pdf **Repository Path**: yushi5344/auto_pdf ## Basic Information - **Project Name**: auto_pdf - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-18 - **Last Updated**: 2024-05-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 文件上传示例 1. 打包mac下 ```shell gox -osarch="darwin/amd64" ``` ```shell go run main.go ``` 2. 打包linux下 ```shell gox -osarch="linux/amd64" ``` #CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ 3. 打包windows下 ```shell CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build ``` 4. 热更新 ```shell air -c .air.toml ``` # 配置文件 ```json { "mode": "debug", "port": "8000", "redisHost": "127.0.0.1:6379", "redisDb": 10, "filePath": "files", "allowOrigin": "*" } ``` - `mode`有以下两种选择 `debug`,`release` - `filePath`为文件上传存放的路径 - `allowOrigin`为跨域是运行访问的域名 ## 运行逻辑 1. 将一个文件上传到此服务,上传成功后,将打开typora 2. 服务会控制键盘,调用快捷键,将文件转为pdf 3. 键入pdf名称,并敲下回车键进行保存 4. 保存成功后,服务读取pdf内容,返回给客户端 5. 客户端拿到pdf内容,保存到本地