I am writing a web application that will, amongst a lot of other things, produce a list of PDF files:
public JsonResult BulkPrintExemptions()
{
List<FileContentResult> retValues = new List<FileContentResult>();
var results = db.Permits.Where(m => m.Year == DateTime.Now.Year).Where(e => e.RecordDeleted == false).ToList();
foreach (var result in results)
{
retValues.Add(GetPDF(result, "Exemption"));
}
return Json(retValues, JsonRequestBehavior.AllowGet);
}
The list will be a minimum of about 400 PDF documents, and the user wants to automatically print them without any interaction on her part.
Once I return that List of FileContentResults, how do I automagically send it to the user's default printer?
I am fairly certain I just need to loop through the list and call Acrobat Reader for each one; I'm just at a loss as to how to do that through javascript.
How do I do that? Or, alternatively, I'm open to better options.
Full disclosure, to assist with options:
This is an MVC application in C#. The enduser has Adobe Acrobat Reader (at least) installed, as it's a default on the "Office Desktop" image.
Edit to add: The PDF files are coming from SSRS, if that makes any difference.