Imports FarPoint.Win.Spread
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
For Each sheet As SheetView In Me.FpSpread1.Sheets
sheet.PrintInfo.HeaderHeight = 30
sheet.PrintInfo.PdfFileName = "D:\PrintPdf.pdf"
sheet.PrintInfo.PrintToPdf = True
sheet.PrintInfo.Opacity = 100
Next
Me.FpSpread1.PrintSheet(-1)
End Sub
Private Sub FpSpread1_PrintHeaderFooterArea(sender As Object, e As FarPoint.Win.Spread.PrintHeaderFooterAreaEventArgs) Handles FpSpread1.PrintHeaderFooterArea
'导出到PDF时,绘制的页眉好像被覆盖了,没法显示
If e.IsHeader Then
e.Graphics.DrawString("Test", New Font("Arial", 9), Brushes.Black, e.Rectangle)
End If
End Sub
End Class
PrintHeaderFooterArea 事件中绘制的内容在导出到pdf时没有效果
Spread.Net 6 版本 6.0.2005.2008
|
|