I create several pdf's using Amyuni and some of those pdf's needs to be physical printed. In the feature list of PDF Converter it says Amyuni can print to a physical printer.
I'm looking for some C# code which is doing this, can anybody provide me with some?
Thanks in advanced.
Paul
The Netherlands
[C#, physical printer]How to print to a physical printer?
I have been able to print a pdf by using the following code.
But have been unable to get the printer dialog to show so my users can change printers.
public override void PrintPDF()
{
// get default printer values;
PrintDocument objPrintDocDefault = new PrintDocument();
string strDefaultPrinter = objPrintDocDefault.PrinterSettings.PrinterName;
CDIntf.PDFDocumentControl pdfDocNet2 = new CDIntf.PDFDocumentControl();
pdfDocNet2.SetLicenseKey(Declarations.LicensedTo, Declarations.ActivationCode);
// file to open for printing
pdfDocNet2.Open(m_parentForm.DecompressedPath + @"\Final.pdf", "");
// Print the pdf
pdfDocNet2.Print(strDefaultPrinter, 1, 2, 1);
}
Does anyone know how to get the printer dialog to show?
But have been unable to get the printer dialog to show so my users can change printers.
public override void PrintPDF()
{
// get default printer values;
PrintDocument objPrintDocDefault = new PrintDocument();
string strDefaultPrinter = objPrintDocDefault.PrinterSettings.PrinterName;
CDIntf.PDFDocumentControl pdfDocNet2 = new CDIntf.PDFDocumentControl();
pdfDocNet2.SetLicenseKey(Declarations.LicensedTo, Declarations.ActivationCode);
// file to open for printing
pdfDocNet2.Open(m_parentForm.DecompressedPath + @"\Final.pdf", "");
// Print the pdf
pdfDocNet2.Print(strDefaultPrinter, 1, 2, 1);
}
Does anyone know how to get the printer dialog to show?
Hello
1) Below is a sample code snippet to print using the Print() method of the PDF Converter
CDIntf.PDFDocumentControl PDF1 = new CDIntf.PDFDocumentControl();
PDF1.Open("c:\\temp\\PreAppend.pdf","");
//PDF1.Print(PrinterName, Startpage, EndPage, copies);
//Leaving printername as blank prints to the systems default printer
PDF1.Print("", 1, 5, 1);
2) To have the users select a printer from a list of printers you will need to use the Windows PrinterSettings.InstalledPrinters Property.
You can find a good example of this at the following link: http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
Hope that helps
1) Below is a sample code snippet to print using the Print() method of the PDF Converter
CDIntf.PDFDocumentControl PDF1 = new CDIntf.PDFDocumentControl();
PDF1.Open("c:\\temp\\PreAppend.pdf","");
//PDF1.Print(PrinterName, Startpage, EndPage, copies);
//Leaving printername as blank prints to the systems default printer
PDF1.Print("", 1, 5, 1);
2) To have the users select a printer from a list of printers you will need to use the Windows PrinterSettings.InstalledPrinters Property.
You can find a good example of this at the following link: http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
Hope that helps