private void PreviewPDF(PassFile file) { MainWindowStackPanel.IsEnabled = false; string fileName = $"{PDFDirectory.FullName}\\{file.FileName}"; Uri url = new Uri($"file:///{fileName}", UriKind.Absolute); PDFPreview.Navigate(url); PDFPreview.Visibility = Visibility.Visible; }
private void PreviewPDF(PassFile file) { try { MainWindowStackPanel.IsEnabled = false; string fileName = file.GetFullPath(PDFDirectory); Uri url = new Uri($"file:///{fileName}", UriKind.Absolute); PDFPreview.Navigate(url); PDFPreview.Visibility = Visibility.Visible; } catch (Exception ex) { ShowErrorMessage(ex, "previewing PDF"); } }
protected void Page_Load(object sender, EventArgs e) { string filePath = "../uploads/hetong/" + Session["hetong"].ToString(); PDFPreview.Priview(this, filePath); }
protected void btnPDF_Click(object sender, EventArgs e) { string filePath = Server.MapPath("~") + @"\DemoFiles\Test.pdf"; PDFPreview.Priview(this, filePath); }