PDF-Merge/MainForm.cs
efrick ea1de129ed Basic working program.
It will merge PDFs from a directory. Configuration is currently all
manual.
2024-08-01 16:16:53 -04:00

66 lines
1.8 KiB
C#

using System.Configuration;
namespace PDF_Merge
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"];
if (sourcePath != null)
{
if (sourcePath != "")
{
if (Directory.Exists(sourcePath))
{
pathLable.Text = pathLable.Text + sourcePath;
} else
{
pathLable.Text = "The configured path does not exist.";
}
} else
{
pathLable.Text = "The configured path is blank.";
}
} else
{
pathLable.Text = "No path has been configured.";
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string[] pdf_files = MergePDFs.CollectPdfFiles();
MergePDFs.MergePdfFiles(pdf_files, ConfigurationManager.AppSettings["PDF-Output"]);
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutBox1 AboutWindow = new AboutBox1();
AboutWindow.Show();
}
private void configureToolStripMenuItem_Click(object sender, EventArgs e)
{
ConfForm ConfForm = new ConfForm();
ConfForm.Show();
}
}
}