我正在尝试使用 Flow Document 打印一些段落和图像,如下面的代码所示
Paragraph invoiceID = new Paragraph(new Run("Invoice No : "+ txtInvoiceID.Text));
Paragraph qty001 = new Paragraph(new Run("Quantity : " + qtyText.Text));
Paragraph date001 = new Paragraph(new Run("Date : " +txtInvoiceDate.Text));
Section sec = new Section();
sec.Blocks.Add(invoiceID);
sec.Blocks.Add(qty001);
sec.Blocks.Add(date001);
FlowDocument fd = new FlowDocument();
PrintDialog pd = new PrintDialog();
fd.PageHeight = pd.PrintableAreaHeight;
fd.PageWidth = pd.PrintableAreaWidth;
fd.PagePadding = new Thickness(50);
fd.ColumnWidth = pd.PrintableAreaWidth;
fd.Blocks.Add(sec);
fd.Blocks.Add(new BlockUIContainer(barCodeImage));
IDocumentPaginatorSource dps = fd;
pd.PrintDocument(dps.DocumentPaginator,"Desciption");
我知道图像已被进程锁定,但我如何才能解锁此图像?
请提供任何帮助
谢谢
贾扎布