Hi! When sending the HTMLeditor content to a webview for printing the generated PDF doesn't have colors.
See the example PDF file.
I'm using this code
TestScript
Original
Output
Solution?
See the example PDF file.
I'm using this code
code:
WebView1.LoadHtml (HTMLeditor.HtmlText)
PrintWebView(WebView1)
print:
Sub PrintWebView(w As WebView)
Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob
PJ.ShowPageSetupDialog(Null)
PJ.ShowPrintDialog(Null)
Dim WVJO As JavaObject = w
WVJO.RunMethodJO("getEngine",Null).RunMethod("print",Array(PJ.GetObject))
PJ.EndJob
End Sub
TestScript
script:
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th:nth-child(even),td:nth-child(even) {
background-color: #D6EEEE;
}
</style>
</head>
<body>
<h2>Striped Table</h2>
<p>For zebra-striped tables, use the nth-child() selector and add a background-color to all even (or odd) table rows:</p>
<table style="width:100%">
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
<th>FRI</th>
<th>SAT</th>
<th>SUN</th>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
Original
Output
Solution?
Attachments
Last edited: