Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在JavaScript中转换多页PDF中的HTML页面_Javascript_Jquery - Fatal编程技术网

如何在JavaScript中转换多页PDF中的HTML页面

如何在JavaScript中转换多页PDF中的HTML页面,javascript,jquery,Javascript,Jquery,我有下面的html页面 <html> <body> <img src="..."/> <img src="..."/> <img src="..."/> </body> </html> 我想制作此页面的pdf,但每个图像都应该在新页面上。您可以使用Javascript循环查看图像。 然后,对于每个图像存储,将其作为一个数据url,使用dom到图像 并使用pdfmake使用cs

我有下面的html页面

<html>
  <body>
    <img src="..."/>
    <img src="..."/>
    <img src="..."/>
  </body>
</html>


我想制作此页面的pdf,但每个图像都应该在新页面上。

您可以使用Javascript循环查看图像。 然后,对于每个图像存储,将其作为一个数据url,使用
dom到图像

并使用
pdfmake
使用css属性打印每个数据URL 前分页符:始终

请参见下面的HTML示例:

<html>
  <head>
   <style>
     .page-heading { page-break-before: always; }
   </style>
  </head>
  <body>
    <img src="..."/>    
    <div class="page-heading">
       <img src="..."/>
    </div>
    <div class="page-heading">
       <img src="..."/>
    </div>
  </body>
</html>

.页面标题{之前的分页符:始终;}