I'm trying to send multiple files from one folder to printer. Now, I can send just one file from folder to printer. However I want to print the files from the folder. I'm using ASPOSE.PDF I was trying to modify the following code but without success:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aspose.Pdf;
using System.Drawing;
using Aspose.Pdf.Facades;
namespace Printer
class Program
{
static void Main(string[] args)
{
PdfViewer viewer = new PdfViewer();
viewer.BindPdf(@"C:\Printing\Hello.pdf");
System.Drawing.Printing.PrinterSettings printersetting = new System.Drawing.Printing.PrinterSettings();
printersetting.Copies = 1; //specify number of copies
printersetting.PrinterName = "Conan-printer"; // name of default printer to be used
System.Drawing.Printing.PageSettings pagesetting = new System.Drawing.Printing.PageSettings();
pagesetting.PaperSource = printersetting.PaperSources[1]; //assign paper source to pagesettings object
//you can either specify the index of the tray or you can loop through the trays as well.
viewer.PrintDocumentWithSettings(pagesetting, printersetting);
viewer.Close();
}
}
}