本文整理汇总了PHP中TCPDF_COLORS::_JScolor方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF_COLORS::_JScolor方法的具体用法?PHP TCPDF_COLORS::_JScolor怎么用?PHP TCPDF_COLORS::_JScolor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF_COLORS
的用法示例。
在下文中一共展示了TCPDF_COLORS::_JScolor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addfield
/**
* Adds a javascript form field.
* @param $type (string) field type
* @param $name (string) field name
* @param $x (int) horizontal position
* @param $y (int) vertical position
* @param $w (int) width
* @param $h (int) height
* @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
* @protected
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
protected function _addfield($type, $name, $x, $y, $w, $h, $prop)
{
if ($this->rtl) {
$x = $x - $w;
}
// the followind avoid fields duplication after saving the document
$this->javascript .= "if (getField('tcpdfdocsaved').value != 'saved') {";
$k = $this->k;
$this->javascript .= sprintf("f" . $name . "=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo() - 1, $x * $k, ($this->h - $y) * $k + 1, ($x + $w) * $k, ($this->h - $y - $h) * $k + 1) . "\n";
$this->javascript .= 'f' . $name . '.textSize=' . $this->FontSizePt . ";\n";
while (list($key, $val) = each($prop)) {
if (strcmp(substr($key, -5), 'Color') == 0) {
$val = TCPDF_COLORS::_JScolor($val);
} else {
$val = "'" . $val . "'";
}
$this->javascript .= 'f' . $name . '.' . $key . '=' . $val . ";\n";
}
if ($this->rtl) {
$this->x -= $w;
} else {
$this->x += $w;
}
$this->javascript .= '}';
}