使用 Silverlight 5 和 VB.Net,我尝试将 LayoutRoot 中的 4 个网格打印到 4 张单独的纸上,如下所示,但我只打印了最后一个网格。我明白为什么会这样,但我应该怎么做呢?我将网格缩放到其原始大小的 75%,因为这使它们可以横向放置在纵向的纸张上。
谢谢。
Imports System.Windows.Printing
Partial Public Class MainPage
Inherits UserControl
Public WithEvents pd As New PrintDocument
Public Sub New()
InitializeComponent()
End Sub
Private Sub Button1_Click(sender As Object, ByVal e As RoutedEventArgs) Handles Button1.Click
pd.Print("My Test Print")
Call ScaleUp()
End Sub
Private Sub pd_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Handles pd.PrintPage
Dim ScaleDown As New ScaleTransform
ScaleDown.ScaleX = "0.75"
ScaleDown.ScaleY = "0.75"
CompChartGrid.RenderTransform = ScaleDown
AttChartGrid.RenderTransform = ScaleDown
CompDetGrid.RenderTransform = ScaleDown
AttDetGrid.RenderTransform = ScaleDown
e.PageVisual = CompChartGrid
e.HasMorePages = True
e.PageVisual = AttChartGrid
e.HasMorePages = True
e.PageVisual = CompDetGrid
e.HasMorePages = True
e.PageVisual = AttDetGrid
e.HasMorePages = False
End Sub
End Class