How to programmatically (C# .NET) print a pdf file directly to the printer?

Hi,

I'm a software developer looking at trying out one of your items. I'm developing WPF apps (and ASP.NET) on VS 2015 and need a solid process to print .PDF files to the printers of my choice. That means I'm looking for an SDK that will do this. I don't need any UI from you. I don't want any PDF shell coming up in the background and need the capability to print multiple copies of documents quickly and silently in the background.

What product can do this for me and how can I get a test run of an SDK in c# so I can try this out? I should know pretty quickly if we'll purchase or not.

Thanks
Customer
-----------------------------------------------

Thanks for your message, PDFPrint SDK will meet your requirements, you can call PDFPrint SDK from your C# code to print PDF files to Windows Printer silently,

https://www.verypdf.com/app/pdf-print-cmd/try-and-buy.html#buy-sdk
https://www.verypdf.com/pdfprint/pdfprint_sdk.zip

Youc an use call PDFPrint SDK from C# by following sample source code,

private static string LicenseKey = null;
private static string PrintCommandTemplate = "pdfprint -$ \"[LicenseKey]\" -printer \"<PrinterName>\" \"<DocFullPath>\"";

[DllImport("pdfprintsdk.dll")]
public static extern int VeryPDF_PDFPrint(string CommandLine);

public static long PrintDoc(string FullDocumentName, string PrinterName)
{
    string PrintCommand = PrintCommandTemplate;
    if (LicenseKey != null)
        PrintCommand = PrintCommand.Replace("[LicenseKey]", LicenseKey);
    else
        PrintCommand = PrintCommand.Replace("[LicenseKey]",
           "XXXXXXXXXXXXXXXX");
    PrintCommand = PrintCommand.Replace("<PrinterName>",
           PrinterName).Replace("<DocFullPath>", FullDocumentName);

    MessageBox.Show(PrintCommand);
    return VeryPDF_PDFPrint(PrintCommand);
}

private void button1_Click(object sender, EventArgs e)
{
    string appPath = Path.GetDirectoryName(Application.ExecutablePath);
    string strPDFFile = (appPath + "\\readme.pdf");
    long nRet = PrintDoc(strPDFFile, "docPrint");
    MessageBox.Show(nRet.ToString());
}

VeryPDF

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: -1 (from 1 vote)
How to programmatically (C# .NET) print a pdf file directly to the printer?, 10.0 out of 10 based on 1 rating

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!