简体   繁体   English

在远程服务器中下载pdf文件时出现html2pdf错误

[英]Html2pdf error when downloading a pdf file in remote server

I'm using yii with html2pdf version 4.03 for downloading pdf documents in my project. 我正在yii和html2pdf 4.03版中下载我项目中的pdf文档。 The pdf documents consist of tables with many rows because they are reports. pdf文档由具有许多行的表组成,因为它们是报表。 In my localhost, the download is fine. 在我的本地主机中,下载正常。 But when I do that in remote server, it can't be downloaded. 但是,当我在远程服务器上执行此操作时,无法下载它。

I used Firefox to download it. 我使用Firefox下载它。 When I downloaded it, it prompted an alert message saying that I can't download because the source file cannot be read. 当我下载它时,它提示一条警告消息,提示我无法下载,因为无法读取源文件。 When I force to download it (by pressing refresh button in firefox's download list), the pdf file is there. 当我强制下载它时(通过在firefox的下载列表中按“刷新”按钮),就存在pdf文件。 When I tried to open it, it says that the file is corrupted. 当我尝试打开它时,它说文件已损坏。

If I delete a few rows, it can be downloaded just fine. 如果我删除几行,就可以下载了。 Strangely, even if I didn't delete the rows, they are still in one page. 奇怪的是,即使我没有删除这些行,它们仍然在一页中。 So the problem shouldn't be about "table row that doesn't fit in one page", should it? 因此,问题不应该是与“一页中不适合的表格行”有关吗?

What could be the problem? 可能是什么问题呢? Could anyone help me with this please? 有人可以帮我吗?

UPDATES 更新

when I print it in browser instead of downloading, firefox prompts an error like below: 当我在浏览器中打印而不是下载它时,firefox提示如下错误:

Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

Please contact the website owners to inform them of this problem.

Still don't know how to solve this though... 还是不知道该怎么解决...

保存生成的pdf,在文本编辑器中将其打开,然后查看错误消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM