導航:首頁 > 文檔加密 > windowsformspdf

windowsformspdf

發布時間:2024-07-20 06:36:26

㈠ vb.net 導出pdf

利用DataWindow.net在 vb.net 下導出PDF格式文件
利用datawindow.net,導出PDF文件,實現前提:
1.安裝Acrobat Distiller虛擬列印機,注意要用datawindow.net提供的列印驅動,在c:\program files\sybase\datawindow.net2.0\driver中,在文章最後,我會提供一個靜態安裝虛擬列印機的批處理文件,方便安裝。
2.安裝Ghostscript 7.05 ,在網上找,免費的。
3.導出PDF文件前,一要指定虛擬列印機名,其次導出格式為PDF(Export.PDF.Method=Distill!),另外還要指定 PDF.Distill.CustomPostScript=Yes。
具體代碼如下:
''' <summary>
''' 導出文件
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click
Try
Dim strFilename, strPrinter As String
Dim saveDg As New SaveFileDialog
strPrinter = Me.dwPrint.Describe("DataWindow.Print.PrinterName")
saveDg.FileName = Me.dwPrint.Tag.ToString
saveDg.Filter = "Pdf文件|*.pdf|Excel文件|*.xls|所有文件|*.*"
If saveDg.ShowDialog = Windows.Forms.DialogResult.OK Then
strFilename = saveDg.FileName
If strFilename.IndexOf(".pdf") > 0 Then
Me.dwPrint.Modify("DataWindow.Print.PrinterName='Acrobat Distiller'")
Me.dwPrint.Modify("DataWindow.Export.PDF.Method=Distill!")
Me.dwPrint.Modify("DataWindow.Export.PDF.Distill.CustomPostScript=Yes")
Me.dwPrint.SaveAs(strFilename, Sybase.DataWindow.FileSaveAsType.Pdf, True)
ElseIf strFilename.IndexOf(".xls") > 0 Then
Me.dwPrint.SaveAs(strFilename, Sybase.DataWindow.FileSaveAsType.Excel, True)
End If
Me.dwPrint.Modify("DataWindow.Print.PrinterName='" + strPrinter + "'")
MessageBox.Show("導出成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub

4 批處理文件(實現靜默安裝)

閱讀全文

與windowsformspdf相關的資料

熱點內容
演算法設計的最終形態是代碼 瀏覽:260
程序員社團招新橫幅 瀏覽:236
拖鞋解壓視頻大全 瀏覽:885
租伺服器主機鏈接軟體叫什麼 瀏覽:854
交叉編譯工具的linux版本號 瀏覽:154
python開發應用軟體 瀏覽:30
hdl綜合器與c編譯器的區別 瀏覽:897
編譯原理最左推導代碼 瀏覽:700
加密三 瀏覽:128
通過編譯鏈接後形成的可執行程序 瀏覽:680
怎麼用matlab編程 瀏覽:781
解壓助眠小動物吃東西 瀏覽:341
外圓倒角60度編程視頻 瀏覽:491
vcc編譯沒問題運行跳不見 瀏覽:750
ada編譯成dll 瀏覽:473
單片機代碼跳掉 瀏覽:450
程序員談薪水壓價 瀏覽:864
榮耀10青春版支持方舟編譯啊 瀏覽:161
最優估計pdf 瀏覽:829
androiddrawtext字體 瀏覽:672