Out of memory Exception while printing in WPF
I was trying to print the set of 70 images in WPF. So I used Fixed document as I saw in many references and tried printing using the below code. private void button1_Click(object sender, RoutedEventArgs e) { PrintDialog d = new PrintDialog(); d.PrintDocument(PrintingDoc().DocumentPaginator, "test"); } private FixedDocument PrintingDoc() { FixedDocument document = new FixedDocument(); Visual viewerControl; string[] Documents = System.IO.Directory.GetFiles("../../U/"); DrawingVisual dv; DrawingContext context ; BitmapImage im ; foreach (string doc in Documents) { dv = new DrawingVisual();