Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

System.InvalidOperationException: Specific element is already the logical child of another element. Disconnect is first.

$
0
0

Hello,

I am trying to print some paragraphs and image using Flow Document As shown in Code below...

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");


This Error is Showing While i am trying to add Image "barCodeImage",
Anyone can help me in this problem ???

 

Thanks

Jazaib Hussain



Viewing all articles
Browse latest Browse all 18858

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>