I want to force a PDF to print from browser by clicking a link. It says here that embedding javascript using a PDF toolkit can make this possible, 开发者_如何学JAVAso would anyone know if/how this can be done with Aspose?
Found the answer, brilliantly simple and works a treat! (You can also use a stream instead of a path name in OpenPdfFile)
//create PdfViewer object
PdfViewer viewer = new PdfViewer();
//open input PDF file
viewer.OpenPdfFile(@"c:\input.pdf");
//print PDF document
viewer.PrintDocument();
//close PDF file
viewer.ClosePdfFile();
精彩评论