1

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, so would anyone know if/how this can be done with Aspose?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Jordan Wallwork
  • 3,116
  • 2
  • 24
  • 49

1 Answers1

2

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();
Jordan Wallwork
  • 3,116
  • 2
  • 24
  • 49