Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用对话在C#中打印HTML字符串?_C#_Html_String - Fatal编程技术网

如何使用对话在C#中打印HTML字符串?

如何使用对话在C#中打印HTML字符串?,c#,html,string,C#,Html,String,我有一个C#格式的字符串,用HTML格式化。我想用对话在打印机上打印它。CSS中没有任何失真 String htmlText = "<table width='100%' cellpadding='0' cellspacing='0'> "+ "<tr>"+ " <th align = 'right' width='80%'>Total</th>"+ " <t

我有一个C#格式的字符串,用HTML格式化。我想用对话在打印机上打印它。CSS中没有任何失真

String htmlText = "<table width='100%' cellpadding='0' cellspacing='0'> "+
            "<tr>"+
             "   <th align = 'right' width='80%'>Total</th>"+
              "  <th align = 'right'>25100.00</th>"+
           " </tr>"+
       " </table>";
String htmlText=“”+
""+
“总计”+
"  25100.00"+
" "+
" ";

你能举一个例子说明“CSS中的失真”是什么意思吗?这意味着当我使用代码将代码保存到pdf中时。。。StringReader sr=新的StringReader(sb.ToString());文档pdfDoc=新文档(PageSize.A5、10f、10f、0f、0f);HTMLWorker htmlparser=新的HTMLWorker(pdfDoc);System.IO.FileStream fs=newfilestream(billSavePath+slNo+“.pdf”,FileMode.Create);PdfWriter writer=PdfWriter.GetInstance(pdfDoc,fs);。。。CSS道具。在sbis字符串bulder和str=sb.tostring()的位置无法工作