weixin_33725722 2016-10-10 16:03 采纳率: 0%
浏览 33

DomPdf pdf创建进度

How can I get the progress of dompdf. I have a lot of html that is being converted into pdf using dompdf. Because the HTML is a lot it takes a while so I want to know if its possible to get the progress and display it to the user.


According to suggestion I have decided to use a spinner. But I need to know when the file is received by the user. I'm using this code to generate the pdf which is copied from here:

$dompdf = new Dompdf();
$dompdf->loadHtml('hello world');

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');

// Render the HTML as PDF

// Output the generated PDF to Browser

The pdf is generated when a user presses a link that executes this code. The pdf downloads and shows in the downloads section.

Edit 2: Now I am trying to handle the download with ajax. I am receiving the data and I can see it when I do console.log() but how do I get the file to be saved in the users downloads?? Thanks

  • 写回答



      相关推荐 更多相似问题


      • ¥15 Android URL如何转成视频/音频,可行吗?
      • ¥20 SQL数据查询,子查询
      • ¥15 c++字符串分割问题
      • ¥15 关于#sql#的问题:没有用命令关闭cdc,手动把系统表开启的cdc右键删除了
      • ¥15 vue+uniapp
      • ¥15 android freedom
      • ¥15 使用自定义的类型代替内置类型可行吗
      • ¥15 关于STM32的SPI和ENDAT接口编码器通信的问题
      • ¥15 关于#pdfbox#生成的PDF文件正常,转图片中文乱码的问题,如何解决?
      • ¥15 ADS中有关DAC控件的使用问题