Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php writeHTMLCell上的TCPDF回滚事务_Php_Tcpdf_Rollback - Fatal编程技术网

Php writeHTMLCell上的TCPDF回滚事务

Php writeHTMLCell上的TCPDF回滚事务,php,tcpdf,rollback,Php,Tcpdf,Rollback,我使用TCPDF遇到以下情况: 试图创建一个表,并通过计算每个writeHTMLCell 首先是守则: //使用额外的行测试缓冲区 $this->pdf->writeHTMLCell($w=0,$h=0,$x='',$y='',$html\u buffer.$row'',$border=0,$ln=1,$fill=1,$reseth=true,$align='',$autopadding=false); 如果($this->pdf->getY()pdf->getPageHeight()-100)

我使用TCPDF遇到以下情况: 试图创建一个表,并通过计算每个
writeHTMLCell

首先是守则:

//使用额外的行测试缓冲区
$this->pdf->writeHTMLCell($w=0,$h=0,$x='',$y='',$html\u buffer.$row'',$border=0,$ln=1,$fill=1,$reseth=true,$align='',$autopadding=false);
如果($this->pdf->getY()<($this->pdf->getPageHeight()-100)){//请注意小于运算符
//我们可能会添加更多的文本,所以请撤消该操作
$this->pdf->rollbackTransaction(true);
//并存储html
$html\u buffer.=$row;
}否则{
//我们超出了限制
$this->pdf->rollbackTransaction(true);
//写下最后一个已知的好表
$this->pdf->writeHTMLCell($w=0,$h=0,$x='',$y='',$html\u buffer'',$border=0,$ln=1,$fill=0,$reseth=true,$align='',$autopadding=false);
//添加新页面
$this->pdf->AddPage();
//结束此交易
$this->pdf->commitTransaction();
//启动新事务
$this->pdf->startTransaction();
//重置html缓冲区
$html_buffer='';
//将最后一页无法容纳的行添加到html缓冲区
$html\u buffer.=$row;
}
(这是从我这里得到的)

但输出pdf也显示了第一个
writeHTMLCell
的结果,该结果仅用于测试Y值。 看来回滚不起作用了

输出如下:

第1行
第1行
第2排
第1行
第2排
第3排
第1行
第2排
第3排
第4排
关于哪里出了问题有什么线索吗