生成代码时出现以下错误:
''page' 类型的句柄参数或选项的值错误为 0'
这似乎是唯一的问题,但我不知道我哪里出错了。任何人都可以在这里看到问题吗?
{
$qty = '1000';
//Open page once
$indoc = $p->open_pdi_document(APPLICATION_PATH.'/../library/pdfs/fc/FCMONARCHCKS_b.pdf', "");
$page = $p->open_pdi_page($indoc, 1, "");
$width = $p->pcos_get_number($indoc, "pages[0]/width");
$height = $p->pcos_get_number($indoc, "pages[0]/height");
// Looping thru the start Numbers
for ($i = $qty; $i >= 0; $i--) {
if($i == $qty){
$newNo1 = $this->orderData->check_number + $qty;
}
else
{
$newNo1 = $newNo1 - 1;
}
//Add page that was only opened once
$p->begin_page_ext($width, $height, "");
$p->fit_pdi_page($page,0,0,"");
$checkNumber_micr = $newNo1;
if(strlen($checkNumber_micr) == '3') {
$newNumber = "00000".$checkNumber_micr;
} elseif(strlen($checkNumber_micr) == '4') {
$newNumber = "0000".$checkNumber_micr;
} elseif(strlen($checkNumber_micr) == '5') {
$newNumber = "000".$checkNumber_micr;
} elseif(strlen($checkNumber_micr) == '6') {
$newNumber = "00".$checkNumber_micr;
} elseif(strlen($checkNumber_micr) == '7') {
$newNumber = "0".$checkNumber_micr;
}
$check_number ="C".$newNumber."C";
$helper->addTextBlock('check_number_1', $check_number);
$CN1 = $newNumber;
$helper->addTextBlock('CN1', $CN1);
$CN2 = $newNumber;
$helper->addTextBlock('CN2', $CN2);
$CN3 = $newNumber;
$helper->addTextBlock('CN3', $CN3);
$rep ="A121000248A";
$routing_number_1p = $rep;
$helper->addTextBlock('routing_number_1', $routing_number_1p);
$rep2 = "C 4124521923C";
$bank_number_1p = $rep2;
$helper->addTextBlock('bank_account_1', $bank_number_1p);
$p->end_page_ext("");
}
$p->close_pdi_page($inpage);
}
//Close Page Manually not using helper
$p->end_document("");
$p->close_pdi_document($indoc);
$p->delete();