using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Globalization;
using System.Windows.Forms;

namespace O2S.Samples.PDFView4NET.Bookmarks
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            pdfDocument.FilePath = "..\\SupportFiles\\Bookmarks.pdf";
        }

        private void btnBrowse_Click(object sender, EventArgs e)
        {
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                txtPDFFile.Text = ofd.FileName;
                pdfDocument.FilePath = ofd.FileName;
            }
        }

        private void btnFirst_Click(object sender, EventArgs e)
        {
            pdfPageView.GoToFirstPage();
        }

        private void btnPrev_Click(object sender, EventArgs e)
        {
            pdfPageView.GoToPrevPage();
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            pdfPageView.GoToNextPage();
        }

        private void btnLast_Click(object sender, EventArgs e)
        {
            pdfPageView.GoToLastPage();
        }

        private void cbxZoom_SelectedIndexChanged(object sender, EventArgs e)
        {
            pdfPageView.Zoom = float.Parse(cbxZoom.Text, CultureInfo.InvariantCulture);
        }
    }
}