删除生成的PDF中输入标记的背景颜色

时间:2016-11-14 05:13:56

标签: tcpdf

我在使用TCPDF表单示例#14时遇到问题,我想删除输入标记的背景颜色,如此屏幕截图所示:

enter image description here

1 个答案:

答案 0 :(得分:0)

试试这个:

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
    for (UIView *subview in self.subviews) {
        if ([subview pointInside:[self convertPoint:point toView:subview] withEvent:event] && ![subview isKindOfClass:[UITableView class]]) {
            return NO;
        }
    }
    return YES;
}

或者这个:

// print some text
$text = 'This is an example of <strong>JavaScript</strong> usage on PDF documents.<br /><br />For more information check the source code of this example, the source code documentation for the <i>IncludeJS()</i> method and the <i>JavaScript for Acrobat API Reference</i> guide.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>';
$pdf->writeHTML($text, true, 0, true, 0);

$js = <<<EOD
var inputFields = document.getElementsByTagName("input");
for (var i = 0, length = inputFields.length; i < length; i++) {
    var inputField = inputFields[i];
    inputField.style.backgroundColor = "#ffffff";
}
EOD;

// set javascript
$pdf->IncludeJS($js);