Printing without ShowDialog gives blank pages Printing without ShowDialog gives blank pages wpf wpf

Printing without ShowDialog gives blank pages


Try doing a Measure, Arrange, and UpdateLayout right before the printvisual, like this:

DV.Measure(new System.Windows.Size(PD.PrintableAreaWidth,              PD.PrintableAreaHeight));DV.Arrange(new System.Windows.Rect(new System.Windows.Point(0, 0),              DV.DesiredSize));DV.UpdateLayout();PD.PrintVisual(DV, "TEST");