WPF のPrintDialog
クラス (PresentationFramework.dll、v4.0.30319 の名前空間 System.Windows.Controls) で印刷しようとしています。これは私が使用するコードです:
private void PrintMe()
{
var dlg = new PrintDialog();
if (dlg.ShowDialog() == true)
{
dlg.PrintVisual(new System.Windows.Shapes.Rectangle
{
Width = 100,
Height = 100,
Fill = System.Windows.Media.Brushes.Red
}, "test");
}
}
問題は、「Microsoft XPS Document Writer」に選択した用紙サイズに関係なく、生成された XPS の幅と高さは常に「レター」用紙タイプです。
これは、XPS パッケージ内にある XAML コードです。
<FixedPage ... Width="816" Height="1056">