Note: The PdfViewer is Beta Version. Some functions may not work well.
In some scenarios, developers need to design an ingenious GUI which can preview appointed pdf files, observe the details by zooming in and out, even directly print pdf files. To meet such requirement, there comes a new component - PdfViewer - which can achieve all those demands very well, it can be embedded in third-party software to view and print Pdf files, which has almost all Adobe Reader's functions. On the same time, it provides APIs to achieve the same functions. This component's features are listed below:
- Viewing Pdf file in visual mode embedded to other software;
- Zooming Pdf pages ;
- Printing Pdf files: print all pages or just an appointed page scale;
Respectively We provide a run time figure effect in .NET Version and Java Version to illustrate how PdfViewer get to work.
The following points about PdfViewer should be kept in mind when using Aspose.Pdf.Kit for printing.
Currently PdfViewer supports versions 1.5 or below of PDF (Adobe Acrobat 6.0). Using PdfViewer with PDF files having version 1.6 can have unexpected results. Development is currently underway to support higher versions of PDF in the future.
When printing a PDF document using PdfViewer it should be kept in mind that PdfViewer does not offer the same quality as that of Adobe Acrobat Reader. This is due to the difference in the underlying technique employed by PdfViewer for printing. Efforts are underway to improve the quality of the print. However customers are advised in their best interests to thoroughly evaluate the quality of the print and ensure that it meets their requirements before deciding to purchase Aspose.Pdf.Kit for printing purposes.
After through testing it has been observed that on the average the conversion rate of PdfViewer is 2 seconds per page. To avoid any inconvenience, customers are advised to thoroughly test PdfViewer on a sample set of PDF files that they intend to use PdfViewer with, on the target system, to get an idea of actual time.
During installation of Aspose.Pdf.Kit on 64-bit Windows Vista Ultimate platform, a number of customers have encountered the following problem “The Installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869.”. For instructions on how to solve this problem please refer to the post http://www.aspose.com/Community/forums/thread/68837.aspx
While execution, if you encounter the error “System.IO.IOException: Uncomplete Installation!”, it means that the privilege level of the user account which is used to execute the application is not high enough. This is usually solved by a simple restart of the machine.
Code Snippet
[C#]
Aspose.Pdf.Kit.PdfViewer viewer = new Aspose.Pdf.Kit.Viewer();
//Open a Pdf file
viewer.OpenPdfFile("ToPrint.pdf");
//Print the Pdf document using default printer
viewer.PrintDocument();
//Close the current Pdf file
viewer.ClosePdfFile();
[VB]
Dim viewer As Aspose.Pdf.Kit.PdfViewer = New Aspose.Pdf.Kit.PdfViewer
'Open a Pdf file
viewer.OpenPdfFile("ToPrint.pdf")
'Print the Pdf document using default printer
viewer.PrintDocument()
'Close the current Pdf file
viewer.ClosePdfFile()
[Java]
Aspose.Pdf.Kit.PdfViewer viewer = new Aspose.Pdf.Kit.Viewer();
//Open a Pdf file
viewer.openPdfFile("ToPrint.pdf");
//Print the Pdf document using default printer
viewer.print();
//Close the current Pdf file
viewer.closePdfFile();
To get more programme details about PdfViewer , please visit our online API documents.