I am trying to print my FlowDocument (which is wrapped in a FlowDocumentScrollViewer) because I have a lot of texts / Textbox / combobox and the page height can get high!
I use this:
PrintDialog printDialog = new PrintDialog(); if (printDialog.ShowDialog() == true) { Scrollvvv.Document.ColumnWidth = printDialog.PrintableAreaWidth; Scrollvvv.Document.ColumnGap = 0; printDialog.PrintDocument(((IDocumentPaginatorSource)Scrollvvv.Document).DocumentPaginator, ServicesLangue.RM.GetString("TITRE_MODIFIER_SALON_EXPOSANT")); }
My xaml looks like this:
<FlowDocumentScrollViewer Name="Scrollvvv" VerticalScrollBarVisibility="Auto"> <FlowDocument Name="flowDoc" PagePadding="10"> <Section> <BlockUIContainer> <Grid Name="grid_principale"> </Grid> </BlockUIContainer> </Section> </FlowDocument> </FlowDocumentScrollViewer>
The fact is that it prints all my data on 1 page, the width is fine (I can add some margin, but that's fine), but it compresses all my controls so that they fit one page in height.
How to fix it? I would just like to disable this auto height and keep the original size.
source share