2016-11-14 2 views
1

でinputタグの背景色を削除し、私はこのスクリーンショットに見られるように、inputタグの背景色を削除する:私はTCPDFフォームの例#14を使用して問題を持って生成されたPDF

enter image description here

+0

、それはimpossibですあなたに手伝ってください。 – Jakuje

+0

https://github.com/tecnickcom/TCPDF/blob/master/examples/example_014.phpここにコード –

+0

があります。あなたは 'TextField()'を使ってそれを行うことはできません。 – Jakuje

答えて

0

てみてくださいこの1:

// 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); 

またはこの1:任意のコードなし

// define some HTML content with style 
$html = <<<EOF 
<!-- EXAMPLE OF CSS STYLE --> 
<style> 
    h1 { 
     color: navy; 
     font-family: times; 
     font-size: 24pt; 
     text-decoration: underline; 
    } 
    input { 
     background-color: red; 
     padding: 5px 10px; 
    } 
</style> 

<h1 class="title">Example of <i style="color:#990000">XHTML + CSS</i></h1> 
<input type="text" value="test.." /> 

EOF; 

// output the HTML content 
$pdf->writeHTML($html, true, false, true, false, ''); 
+0

デフォルトカラー(灰色)のみを透明にしたい場合は、ソリューションカラーでフォーカスを削除します。 –

+0

デフォルトの色はどのように設定されていますか? CSS経由ですか?あなたは単にデフォルトの色を "削除"することはできません。代わりにどの色を使用するかを指定する必要があります。ブラウザのデフォルトの色。白です。 –

+0

この色がどのように設定されているのかわかりません。色がどこに定義されているかを知るにはあなたの助けが必要です。あなたは私がpdfファイルだけでなくhtmlページについて話していることを理解していますか? –

関連する問題