du31992 2019-01-18 06:32 采纳率: 0%
浏览 936

加载PDF文档时发生错误

I would like you to help me with this problem.

I have some time working with a project in Laravel 5.6. This week I installed the barryvdh / laravel-dompdf package via composer as indicated in the documentation. I added the respective service provider in the config \ app.php file.

When trying to use the package for the first time I get the following error in Chrome: "An error occurred while loading the PDF document"

When I download the document and visualize it with a text editor, I realize that the only thing that is wrong with the file is that it lacks the first line:% PDF-1.3. When adding said line manually the document is "fixed".

To continue testing, I installed a new laravel project, and then I installed the package and created a route with the same code from the previous project. To my surprise, this project does load the PDF document in Chrome.

Please give me some idea of ​​what things I can review.

Thank you very much

  • 写回答

1条回答 默认 最新

  • dongmangji0950 2019-01-18 19:08
    关注

    I have already solved it. The cause of the problem was that the config/app.php configuration file did not have the <?php line at startup, and this was what caused the problem.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于下拉菜单选项关联的问题
  • ¥15 如何修改pca中的feature函数
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R