更改itextsharp表格中的字体大小我已经弄清楚如何添加表格,并通过单击按钮打开PDF,但是表格太大,文本被包裹起来,难以阅读。我输入了这段代码,但表单字体没有任何反应。使用系统;使用System.Collections.Generic;使用System.ComponentModel;使用系统数据;使用系统绘图;使用System.Linq;使用系统文本;使用System.Windows.Forms;使用System.Data.SqlServerCe;使用System.IO;使用iTextSharp.text;使用iTextSharp.text.pdf;namespaceLewis_Warby_Airbrushing{publicpartialclassselectedorderForm:Form{publicselectedorderForm(stringstrValue){InitializeComponent();textBox1.Text=strValue;}数据表dt;privatevoidselectedorderForm_Load(objectsender,EventArgse){SqlCeConnectioncon=newSqlCeConnection(@"DataSource=|DataDirectory|LWADataBase.sdf;");SqlCeDataAdaptersda=newSqlCeDataAdapter("select*fromorderTBL",con);dt=新数据表();sda.填充(dt);dataGridView1.DataSource=dt;DataViewdv=newDataView(dt);dv.RowFilter="[OrderNumber]like'%"+textBox1.Text.Trim()+"%'";dataGridView1.DataSource=dv;}privatevoidpdfBTN_Click(objectsender,EventArgse){iTextSharp.text.FontfontTitle=FontFactory.GetFont("Arial",18,iTextSharp.text.Font.BOLD,BaseColor.BLACK);文档doc=newDocument(iTextSharp.text.PageSize.A4,10,10,10,10);PdfWriterwri=PdfWriter.GetInstance(doc,newFileStream("PurchaseOrder-"+textBox1.Text+".pdf",FileMode.Create));文档.Open();Paragraphtitle=newParagraph("PURCHASEORDER"+textBox1.Text+"nLewisWarbyAirbrushingn",fontTitle);title.Alignment=Element.ALIGN_CENTER;doc.Add(标题);title.SpacingAfter=15f;iTextSharp.text.FontfontTable=FontFactory.GetFont("宋体",5,iTextSharp.text.Font.NORMAL,BaseColor.BLACK);PdfPTable表=newPdfPTable(dataGridView1.Columns.Count);表.SpacingBefore=45f;table.TotalWidth=216f;table.DefaultCell.Phrase=newPhrase(){Font=fontTable};对于(intj=0;j
