HTML +图像+ CSS使用Google Drive API进行PDF处理

问题描述:

我知道可以使用Google云端硬盘将HTML文件转换为PDF格式(使用Google云端硬盘的HTML2PDF API ),但我想知道这个HTML是否有图片和CSS文件是可能的,以及如何做到这一点。

I know it's possible to convert an HTML file to PDF using Google Drive (HTML2PDF using Google Drive API) but I'd like to know if this HTML has images and CSS files is possible and how to do that.

您需要将HTML转换为文档并将其导出为PDF。在文档转换期间,大部分非平凡风格正在被修剪。基本的着色,大小和定位将会得到。导出的PDF是Docs文件的PDF版本。图片将被保留。

You need convert HTML to a Docs file and export it as PDF. During the docs conversion most of the non-trivial styles are being trimmed. Basic coloring, sizing and positioning will all you'll get. The exported PDF is the Docs' file's PDF version. Images will be preserved though.

您可以在drive.google上将 html 文件上传到Google Drive .com转换设置并查看结果。

You can make experiments by uploading your html files to Google Drive on drive.google.com with conversion settings on and see the results.