如何使用WPF中的DevExpress PdfViewerControl打印Legal文档?

时间:2014-06-17 15:16:09

标签: wpf printing devexpress devexpress-wpf

我在WPF对话框中有以下PdfViewerControl:

            <dxpdf:PdfViewerControl Grid.Column="0"
                                Name="Viewer"
                                CommandBarStyle="None"
                                ZoomMode="FitToWidth"
                                Margin="5">

            <dxpdf:PdfViewerControl.RibbonTemplate>
                <DataTemplate>
                    <Grid>
                        <dxb:BarManager x:Name="PART_PdfBarManager">
                            <dxb:BarManager.Items>
                                <dxpdf:PrintDocumentBarItem Name="bPrint"
                                                            Command="{Binding Path=(dxpdf:PdfViewerControl.ActualViewer).ActualCommandProvider.PrintDocumentCommand, RelativeSource={RelativeSource TemplatedParent}}" />

                            </dxb:BarManager.Items>
                            <DockPanel>

                                <dxr:RibbonControl AllowCustomization="False"
                                                   DockPanel.Dock="Top"
                                                   RibbonHeaderVisibility="Collapsed"
                                                   RibbonStyle="Office2010"
                                                   ToolbarShowMode="Hide"
                                                   ShowApplicationButton="false"
                                                   Height="80">
                                    <dxr:RibbonDefaultPageCategory>
                                        <dxr:RibbonPage>

                                            <dxr:RibbonPageGroup>
                                                <dxb:BarItemLink BarItemName="bPrint" />
                                            </dxr:RibbonPageGroup>

                                        </dxr:RibbonPage>
                                    </dxr:RibbonDefaultPageCategory>
                                </dxr:RibbonControl>
                                <dxpdf:PdfPresenterControl
                                    BehaviorProvider="{Binding Path=(dxpdf:PdfViewerControl.ActualViewer).ActualBehaviorProvider, RelativeSource={RelativeSource Self}}"
                                    Document="{Binding Path=(dxpdf:PdfViewerControl.ActualViewer).Document, RelativeSource={RelativeSource Self}}"
                                    CurrentPageNumber="{Binding Path=(dxpdf:PdfViewerControl.ActualViewer).CurrentPageNumber, Mode=TwoWay, RelativeSource={RelativeSource Self}}"
                                    AllowCachePages="False"
                                    IsSearchControlVisible="{Binding Path=(dxpdf:PdfViewerControl.ActualViewer).IsSearchControlVisible, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
                            </DockPanel>
                        </dxb:BarManager>
                    </Grid>
                </DataTemplate>
            </dxpdf:PdfViewerControl.RibbonTemplate>

        </dxpdf:PdfViewerControl>

我将DocumentSource绑定到具有Legal页面大小(8.5 x 14)的PDF文件流。当我从PdfViewerControl打印时,生成的PDF始终具有Letter页面大小(8.5 x 11)。我缺少PdfViewerControl PrintCommand的哪些设置?有没有办法强迫它使用Legal?或者,至少从PDF文档中提取页面大小?

0 个答案:

没有答案