1 Star 0 Fork 304

下下雨 / PDF-Guru

forked from Kevin2li / PDF-Guru 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rotate.go 548 Bytes
一键复制 编辑 原始数据 按行查看 历史
Kevin2li 提交于 2023-07-18 15:06 . refactor
package main
import "fmt"
func (a *App) RotatePDF(inFile string, outFile string, rotation int, pages string) error {
logger.Printf("inFile: %s, outFile: %s, rotation: %d, pages: %s\n", inFile, outFile, rotation, pages)
args := []string{"rotate"}
if rotation != 0 {
args = append(args, "--angle", fmt.Sprintf("%d", rotation))
}
if pages != "" {
args = append(args, "--page_range", pages)
}
if outFile != "" {
args = append(args, "-o", outFile)
}
args = append(args, inFile)
logger.Println(args)
return a.cmdRunner(args, "pdf")
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/cj94demo/PDF-Guru.git
git@gitee.com:cj94demo/PDF-Guru.git
cj94demo
PDF-Guru
PDF-Guru
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891