经过一番研究,我得出的结论是,FPDF 的 ASP 组件版本存在导致此行为的错误。
FPDF Library - PDF Generator 网站论坛上有一个有趣的帖子 - [ASP] Pb avec PDF de 2 pages 描述了您的确切问题,他们得出的结论是 FPDF 组件的 ASP 版本存在导致问题的错误。
也许如果您向我们展示您的 fpdf.asp 包含文件,我们可能会提供更多帮助,作为线程中提到的 OP
“我解决了。我不知道怎么解决的,但我解决了。”
建议可以修复。
编辑:
我认为这可能是您使用的 ASP FPDF 已有 10 多年的历史并且似乎没有得到维护。
/****************************************************************************
* *
* Software : FPDF for Asp *
* Version : 1.01 beta *
* Date : 2003/11/15 *
* Author : Lorenzo Abbati *
* License : Freeware *
* Site : http://www.aspxnet.it *
* *
*****************************************************************************
* *
* Author (PHP Class) : Olivier Plathey *
* Site (PHP Class) : http://www.fpdf.org *
* *
*****************************************************************************
* *
* You may use and modify this software as you wish. *
* *
****************************************************************************/
最新下载好像是v1.01
引用的网站http://www.aspxnet.it似乎没什么用处。
过去,当谈到经典 ASP 时,我发现 AspPDF by Persits Software inc 在动态构建 PDF 时非常有用。它不像 ASP FPDF 那样免费,但它确实可以工作,并且会不断更新和支持。可能值得一看,而不是尝试挖掘 fpdf.asp 以找到 .Image 错误的原因。
更新:
认为问题出在this._out 和缓冲区的构建方式上,因为这可以解释为什么输出一张图像而没有输出另一张图像。例如,如果缓冲区被重置。不幸的是,解决这个问题的唯一方法是挖掘源代码。
this.Image=function Image(xfile , xx , xy , xw , xh , xtype , xlink)
{
if (arguments.length<5){xh=0};
if (arguments.length<6){xtype=""};
if (arguments.length<7){xlink=""};
if(!lib.isset(this.images[xfile]))
{
if(xtype=="")
{
xpos=lib.strrpos(xfile,".");
if(!xpos)this.Error("Image file has no extension and no type was specified: " + xfile);
xtype=lib.substr(xfile,xpos+1);
}
xtype=xtype.toLowerCase();
if(xtype=="jpg" || xtype=="jpeg") xinfo=this._parsejpg(xfile);
else this.Error("Unsupported image file type: " + xtype);
xinfo["i"]=lib.count(this.images)+1;
this.images[xfile]=xinfo;
}
else
xinfo=this.images[xfile];
if(xw==0)xw=xh*xinfo["w"]/xinfo["h"];
if(xh==0)xh=xw*xinfo["h"]/xinfo["w"];
this._out(lib.sprintf("q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q",xw*this.k,xh*this.k,xx*this.k,(this.h-(xy+xh))*this.k,xinfo["i"]));
if(xlink)this.Link(xx,xy,xw,xh,xlink);
}