Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Print( OtherDoc otherDoc )
- {
- try
- {
- using ( FileStream sourceFile = new FileStream( otherDoc.Uri, FileMode.Open, FileAccess.ReadWrite, FileShare.None ) )
- {
- var pdfDoc = new PDF.Document(sourceFile, otherDoc.Password);
- this.PrintDoc( pdfDoc );
- }
- this.PrintResult = PdfPrintResult.Success;
- }
- catch ( System.UnauthorizedAccessException )
- {
- this.PrintResult = PdfPrintResult.EditFail;
- }
- catch ( System.Exception e )
- {
- this.PrintResult = PdfPrintResult.GeneralFail;
- this.PrintError = e.Message;
- }
- }
- private void PrintDoc( PDF.Document pdfDoc )
- {
- PDF.Printing.PrintSettings printSettings = new PDF.Printing.PrintSettings();
- pdfDoc.Print( printSettings );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement