html:如何在不破坏格式的情况下将非常大的html文件拆分成碎片

时间:2021-09-24 19:35:38

I have a large html file, downloaded from some place. I need to convert it to pdf eventually. Is there a way to split it into several html smaller parts (e.g. kind of a pagination).

我有一个大的html文件,从某个地方下载。我最终需要将其转换为pdf。有没有办法将它分成几个较小的部分(例如一种分页)。

(I do not control the part of creating html file, so can do nothing on server side)

(我不控制创建html文件的部分,所以在服务器端无能为力)

1 个解决方案

#1


1  

It sounds like it would be a tedious manual process to me. Consider html2pdf and other similar utilities to convert the entire chunk into a PDF, then doing the pagination using pdftk.

听起来这对我来说是一个繁琐的手动过程。考虑使用html2pdf和其他类似的实用程序将整个块转换为PDF,然后使用pdftk进行分页。

If the CSS includes any print style definitions, that might be of use. But generally it's not possible to automate would be my answer.

如果CSS包含任何可能有用的打印样式定义。但一般来说,自动化不可能是我的答案。

#1


1  

It sounds like it would be a tedious manual process to me. Consider html2pdf and other similar utilities to convert the entire chunk into a PDF, then doing the pagination using pdftk.

听起来这对我来说是一个繁琐的手动过程。考虑使用html2pdf和其他类似的实用程序将整个块转换为PDF,然后使用pdftk进行分页。

If the CSS includes any print style definitions, that might be of use. But generally it's not possible to automate would be my answer.

如果CSS包含任何可能有用的打印样式定义。但一般来说,自动化不可能是我的答案。