多くのテキスト/テキストボックス/コンボボックスがあり、ページの高さが高くなる可能性があるため、FlowDocument(FlowDocumentScrollViewerにラップされている)を印刷しようとしています!
私はこれを使用しています:
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"));
}
私のxamlは次のようになります:
<FlowDocumentScrollViewer Name="Scrollvvv" VerticalScrollBarVisibility="Auto">
<FlowDocument Name="flowDoc" PagePadding="10">
<Section>
<BlockUIContainer>
<Grid Name="grid_principale">
<!-- Lot of stuffs here -->
</Grid>
</BlockUIContainer>
</Section>
</FlowDocument>
</FlowDocumentScrollViewer>
問題は、すべてのデータを 1 ページに印刷することです。幅は問題ありません (余白を追加することもできますが、問題ありません)。ただし、すべてのコントロールを 1 ページの高さに収まるように圧縮します。
これを修正するには?この自動高さを無効にして、元のサイズを維持したいだけです。