原創|其它|編輯:郝浩|2011-09-14 10:57:57.000|閱讀 927 次
概述:在這篇文章中,我們將解釋如何從Adobe Acrobat Automation移植到Aspose.Pdf for .NET。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
在這篇文章中,我們將解釋如何從Adobe Acrobat Automation移植到Aspose.Pdf for .NET。
Adobe Acrobat Automation允許你以代碼方式執行PDF文件中的各項任務。Aspose.Pdf for .NET也同樣提供了以程序方式來執行PDF操作的功能。然而,Aspose.Pdf for .NET比Adobe Acrobat Automation更易于使用。Aspose.Pdf for .NET采用可托管的代碼編寫,可以作為一個單獨的.Net程序集安裝和部署,而Adobe Acrobat Automation基于Com組件,需要在他們所使用的機器上注冊。值得注意的是,Aspose.Pdf for .NET完全支持32位和64位,比Adobe Acrobat Automation更加快速。
我們已經選擇了一個簡單的例子,來幫助您了解從Adobe Acrobat Automation移植到Aspose.Pdf for .NET。并且在這個例子中,我們將使用Adobe Acrobat Automation和Aspose.Pdf for .NET這兩種組件向您展示如何打印一個PDF文件。
下面的代碼片段演示如何使用Adobe Acrobat Automation打印PDF文件。
[C#]
//create AcroPDF object
AcroPDFLib.AcroPDF pdf = new AcroPDFLib.AcroPDF();
//set source PDF file
pdf.src = @"c:\input.pdf";
//print all pages
pdf.printAll();
[VB.NET]
'create AcroPDF object
Dim pdf As New AcroPDFLib.AcroPDF()
'set source PDF file
pdf.src = "c:\input.pdf"
'print all pages
pdf.printAll()
下面的代碼片段演示如何使用Aspose.Pdf for .NET中的Aspose.Pdf.Facades命名空間打印PDF文件。
[C#]
//create PdfViewer object
PdfViewer viewer = new PdfViewer();
//open input PDF file
viewer.OpenPdfFile(@"c:\input.pdf");
//print PDF document
viewer.PrintDocument();
//close PDF file
viewer.ClosePdfFile();
[VB.NET]
//create PdfViewer object
PdfViewer viewer = new PdfViewer();
//open input PDF file
viewer.OpenPdfFile(@"c:\input.pdf");
//print PDF document
viewer.PrintDocument();
//close PDF file
viewer.ClosePdfFile();
通過本篇文章,我們可以發現從Adobe Acrobat Automation 移植到Aspose.Pdf for .NET是一件的多么簡單的事情。我們也可以得出這樣的結論,使用Aspose.Pdf for .NET實現PDF打印,除了在一個地方的擁有所有的PDF處理功能外,而且以單個程序集的形式,我們還可以獲得.net技術的所有優勢。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網