比spire.pdf速度更快:EVO PDF Print Crack

适用于 .NET 的 EVO PDF 打印
EVO PDF Print 可用于任何类型的 .NET 应用程序,以静默打印 PDF 文档而不显示任何打印对话框。它可以集成到任何 .NET 应用程序中,包括 ASP.NET 网站和桌面应用程序,以便为您的应用程序添加 PDF 打印功能。您可以在打印过程中选择打印机、纸张尺寸、方向、页边距、添加水印和图章。


适用于 .NET 的 EVO PDF 打印
EVO PDF Print 可用于任何类型的 .NET 应用程序,无需显示任何打印对话框即可静默打印 PDF 文档。与现有 .NET 应用程序的集成非常容易,无需安装。下载的存档包含 .NET 程序集和演示应用程序。示例文件夹中提供了演示应用程序的完整 C# 源代码。您可以选择打印机,设置纸张大小、方向和边距,以彩色或灰度打印,选择要打印的 PDF 页面范围。

EVO PDF Print 不依赖于 Adob​​e Reader 或其他第三方工具。
从文件、流或内存缓冲区打印 PDF 文档
静默打印,不显示任何打印对话框
不依赖于 Adob​​e Reader 或其他第三方工具
允许您选择要用于打印的打印机
允许您选择纸张大小、方向和页边距
打印受密码保护的 PDF 文档
在打印过程中添加水印和图章
仅打印一定范围的 PDF 页面
获取 PDF 文档中的页数
支持 .NET 4.0 框架和更高
版本所有功能的文档和 C# 示例

Code Sample - Print PDF Documents
The code below was taken from the PDF Print demo application available for download in the PDF Print product package. In this sample an instance of the PdfPrint class is constructed and used to silently print a selected PDF document.
private void btnPrintPdf_Click(object sender, EventArgs e)
{
    if (pdfFileTextBox.Text.Trim().Equals(String.Empty))
    {
        MessageBox.Show("Please choose a source PDF file", "Choose PDF file", MessageBoxButtons.OK);
        return;
    }

    // the source pdf file
    string pdfFileName = pdfFileTextBox.Text.Trim();

    // start page number
    int startPageNumber = int.Parse(textBoxStartPage.Text.Trim());
    // end page number
    // when it is 0 the conversion will continue up to the end of document
    int endPageNumber = 0;
    if (textBoxEndPage.Text.Trim() != String.Empty)
        endPageNumber = int.Parse(textBoxEndPage.Text.Trim());

    // create the PDF printer 
    PdfPrint pdfPrint = new PdfPrint();

    // set the license key
    pdfPrint.LicenseKey = "oy08LDo/LDwsOiI8LD89Ij0+IjU1NTUsPA==";

    // set the document name
    pdfPrint.DocumentName = "PDF Silent Printing";

    // enable or disable color printing
    pdfPrint.DefaultPageSettings.Color = cbPrintColor.Checked;

    // set the PDF printing color and resolution
    pdfPrint.Color = GetSelectedPrintColor();
    pdfPrint.Resolution = int.Parse(textBoxResolution.Text);

    // select the printer
    string selectedPrinterName = GetSelectedPrinterName();
    if (selectedPrinterName != null)
        pdfPrint.PrinterSettings.PrinterName = selectedPrinterName;

    // set paper size
    PaperSize selectedPaperSize = GetSelectedPaperSize();
    if (selectedPaperSize != null)
        pdfPrint.DefaultPageSettings.PaperSize = selectedPaperSize;

    // set paper orientation
    pdfPrint.DefaultPageSettings.Landscape = GetSelectedPageOrientation() == "Landscape";

    // set paper margins 
    pdfPrint.DefaultPageSettings.Margins = new Margins((int)(float.Parse(leftMarginTextBox.Text) * 100),
        (int)(float.Parse(rightMarginTextBox.Text) * 100),
        (int)(float.Parse(topMarginTextBox.Text) * 100),
        (int)(float.Parse(bottomMarginTextBox.Text) * 100));

    // the demo output directory
    string outputDirectory = Path.Combine(Application.StartupPath, @"DemoFiles\Output");

    Cursor = Cursors.WaitCursor;

    try
    {
        pdfPrint.Print(pdfFileName, startPageNumber, endPageNumber);
    }
    catch (Exception ex)
    {
        // The conversion failed
        MessageBox.Show(String.Format("An error occurred. {0}", ex.Message), "Error");
        return;
    }
    finally
    {
        Cursor = Cursors.Arrow;
    }

    MessageBox.Show("Print Completed", "Print Completed", MessageBoxButtons.OK);
}

猜你喜欢

转载自blog.csdn.net/john_dwh/article/details/130185839