0

我在 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 缺少哪些设置?有没有办法强制它使用法律?或者,至少要从 PDF 文档中提取页面大小?

4

0 回答 0