Xamarin 使用编程webview打印uwp应用程序
我有一个简单的Xamarin 使用编程webview打印uwp应用程序,xamarin,printing,uwp,Xamarin,Printing,Uwp,我有一个简单的WebView像: var webView = new Xamarin.Forms.WebView { Source = new HtmlWebViewSource { Html = @$" <!DOCTYPE html>
WebView
像:
var webView = new Xamarin.Forms.WebView
{
Source = new HtmlWebViewSource
{
Html = @$"
<!DOCTYPE html>
<html>
<body>
<table border = '1'; style='width:265; height:189;'>
<caption>SLOT CARD</caption>
<thead>
<tr>
<th>QR</th>
<th>Data</th>
</tr>
</thead>
<tbody>
<tr>
<td>test1</td>
<td>
value1
value2
value3
</td>
</tr>
</tbody>
</table>
</body>
</html>
"
}
};
如何将我的webview附加到那里?可能吗?问候
注*:我的webview concist仅在一页中显示,并带有短表。。。webview中的最大表格大小为:265px 189px关于打印适用于android onlt@Sushingover的UWP webview,存在许多问题。您可以查看
PrintDocument document = new PrintDocument();
document.PrinterSettings.PrinterName = "Test";
document.PrinterSettings.DefaultPageSettings.PaperSize = document.PrinterSettings.PaperSizes[0];
document.PrinterSettings.DefaultPageSettings.Margins = new Margins(1, 1, 1, 1);
document.Print();