How can I convert images to a pdf document go lang?

huangapple go评论78阅读模式
英文:

How can I convert images to a pdf document go lang?

问题

我正在尝试制作一个小工具,用于从网站下载图片并自动转换为PDF。我已经尝试查找Go语言库来将图片转换为PDF,但大多数库都与将PDF转换为图片相关,即使在像MarotoGofPdf这样的库中,也没有详细说明如何将一个目录中的图片转换为PDF文件。我已经用Python做过这个,但对于我的用例来说速度太慢了。

英文:

I am trying to make a small tool to download images from websites and automatically convert them to PDF. I have tried looking for go lang libraries to convert images to pdf however most of them are related to converting to pdf to images and even in the libraries such as Maroto and GofPdf they don't go into details on how to convert a directory full of images into a pdf file. I have done this in python but it's super slow for my use case.

答案1

得分: 1

PdfCpu工作得很好:

pdfcpu import out.pdf a.jpg b.jpg

https://pdfcpu.io/generate/import

英文:

PdfCpu works great:

pdfcpu import out.pdf a.jpg b.jpg

https://pdfcpu.io/generate/import

huangapple
  • 本文由 发表于 2021年10月9日 06:59:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/69502463.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定