Example #1
0
        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;
        }
Example #2
0
        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");
            }
        }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string filePath = "../uploads/hetong/" + Session["hetong"].ToString();

        PDFPreview.Priview(this, filePath);
    }
Example #4
0
    protected void btnPDF_Click(object sender, EventArgs e)
    {
        string filePath = Server.MapPath("~") + @"\DemoFiles\Test.pdf";

        PDFPreview.Priview(this, filePath);
    }