FPDF 与经典 ASP,图像错误
让我们在这篇文章的序言中说...是的,我知道在当今时代,我对于使用经典 ASP 已经是个恐龙了!
我正在使用 FPDF.asp 即时生成 PDF。
在我的测试服务器上一切正常并且符合预期。然而,在我的实时服务器上,如果我尝试将图像输出为 PDF 的一部分,则会遇到错误。我知道语法是正确的,因为它在测试服务器上正常工作。
我在实时服务器上收到的错误是:“文件不以 '%PDF-' 开头。”
如果我注释掉添加图像的行,文件就会正确加载并且不会出现错误!
有谁知道在实时服务器上可能需要纠正什么才能消除这个问题???
任何帮助将不胜感激。
米奇
Let's preface this post by saying... Yes, I know I'm a dinosaur for using Classic ASP in this day and age!
I'm using FPDF.asp to generate a PDF on the fly.
Everything works fine and as expected on my test server. On my live server, however, I encounter an error, if I try to output an image as part of my PDF. I know the syntax is correct, since it works on the test server as it should.
The error I receive on my live server is: "File does not begin with '%PDF-'."
If I comment out the line that adds the image, the file loads up properly and error-free!
Does anyone have any idea, as to what may need to be corrected on the live server to eliminate this problem???
Any help would be most appreciated.
Mitch
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新!
不知道为什么有图像或没有图像会产生影响,但解决方案是我在输出中混合了一些 HTML 代码,这导致 FPDF 在包含图像时失败。
删除 HTML 代码,问题解决!
-米奇
Update!
Not sure why having an image or not makes the difference, BUT the solution turned out to be that I had some HTML code mixed in with the output and this caused FPDF to fail when an image was included.
Removed the HTML code and problem solved!
-Mitch