diff --git a/MergePDF.sln b/MergePDF.sln index 7060b96..3b7fec8 100644 --- a/MergePDF.sln +++ b/MergePDF.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.27130.2026 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MergePDF", "MergePDF\MergePDF.csproj", "{8BF6B775-F54A-4590-959B-FD6D5AEC1280}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MergePDFTests", "MergePDFTests\MergePDFTests.csproj", "{116308E4-C514-461A-B222-AEC05F1DFEFC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {8BF6B775-F54A-4590-959B-FD6D5AEC1280}.Debug|Any CPU.Build.0 = Debug|Any CPU {8BF6B775-F54A-4590-959B-FD6D5AEC1280}.Release|Any CPU.ActiveCfg = Release|Any CPU {8BF6B775-F54A-4590-959B-FD6D5AEC1280}.Release|Any CPU.Build.0 = Release|Any CPU + {116308E4-C514-461A-B222-AEC05F1DFEFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {116308E4-C514-461A-B222-AEC05F1DFEFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {116308E4-C514-461A-B222-AEC05F1DFEFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {116308E4-C514-461A-B222-AEC05F1DFEFC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MergePDF/App.config b/MergePDF/App.config index 731f6de..ecdcf8a 100644 --- a/MergePDF/App.config +++ b/MergePDF/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/MergePDF/Form1.Designer.cs b/MergePDF/Form1.Designer.cs index c54441c..a1b39b9 100644 --- a/MergePDF/Form1.Designer.cs +++ b/MergePDF/Form1.Designer.cs @@ -34,9 +34,13 @@ private void InitializeComponent() this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); this.lblMergeAmount = new System.Windows.Forms.Label(); this.btnClearAll = new System.Windows.Forms.Button(); + this.flpFiles = new System.Windows.Forms.FlowLayoutPanel(); + this.btnAddFile = new System.Windows.Forms.Button(); + this.btnSaveFile = new System.Windows.Forms.Button(); + this.txtSaveFile = new System.Windows.Forms.TextBox(); + this.lblFileCount = new System.Windows.Forms.Label(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -84,28 +88,14 @@ private void InitializeComponent() // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // - // comboBox1 - // - this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(new object[] { - "2", - "3", - "4"}); - this.comboBox1.Location = new System.Drawing.Point(12, 63); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(604, 21); - this.comboBox1.TabIndex = 3; - this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); - // // lblMergeAmount // this.lblMergeAmount.AutoSize = true; - this.lblMergeAmount.Location = new System.Drawing.Point(9, 47); + this.lblMergeAmount.Location = new System.Drawing.Point(94, 44); this.lblMergeAmount.Name = "lblMergeAmount"; this.lblMergeAmount.Size = new System.Drawing.Size(213, 13); this.lblMergeAmount.TabIndex = 4; @@ -122,14 +112,62 @@ private void InitializeComponent() this.btnClearAll.UseVisualStyleBackColor = true; this.btnClearAll.Click += new System.EventHandler(this.btnClearAll_Click); // + // flpFiles + // + this.flpFiles.AutoScroll = true; + this.flpFiles.Location = new System.Drawing.Point(13, 68); + this.flpFiles.Name = "flpFiles"; + this.flpFiles.Size = new System.Drawing.Size(603, 203); + this.flpFiles.TabIndex = 6; + // + // btnAddFile + // + this.btnAddFile.Location = new System.Drawing.Point(13, 39); + this.btnAddFile.Name = "btnAddFile"; + this.btnAddFile.Size = new System.Drawing.Size(75, 23); + this.btnAddFile.TabIndex = 7; + this.btnAddFile.Text = "Add File"; + this.btnAddFile.UseVisualStyleBackColor = true; + this.btnAddFile.Click += new System.EventHandler(this.btnAddFile_Click); + // + // btnSaveFile + // + this.btnSaveFile.Location = new System.Drawing.Point(13, 282); + this.btnSaveFile.Name = "btnSaveFile"; + this.btnSaveFile.Size = new System.Drawing.Size(75, 23); + this.btnSaveFile.TabIndex = 8; + this.btnSaveFile.Text = "Save File at"; + this.btnSaveFile.UseVisualStyleBackColor = true; + this.btnSaveFile.Click += new System.EventHandler(this.btnSaveFile_Click); + // + // txtSaveFile + // + this.txtSaveFile.Location = new System.Drawing.Point(106, 285); + this.txtSaveFile.Name = "txtSaveFile"; + this.txtSaveFile.Size = new System.Drawing.Size(510, 20); + this.txtSaveFile.TabIndex = 9; + // + // lblFileCount + // + this.lblFileCount.AutoSize = true; + this.lblFileCount.Location = new System.Drawing.Point(308, 44); + this.lblFileCount.Name = "lblFileCount"; + this.lblFileCount.Size = new System.Drawing.Size(13, 13); + this.lblFileCount.TabIndex = 10; + this.lblFileCount.Text = "0"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(628, 481); + this.Controls.Add(this.lblFileCount); + this.Controls.Add(this.txtSaveFile); + this.Controls.Add(this.btnSaveFile); + this.Controls.Add(this.btnAddFile); + this.Controls.Add(this.flpFiles); this.Controls.Add(this.btnClearAll); this.Controls.Add(this.lblMergeAmount); - this.Controls.Add(this.comboBox1); this.Controls.Add(this.richConsole); this.Controls.Add(this.btnMergePdf); this.Controls.Add(this.menuStrip1); @@ -155,9 +193,13 @@ private void InitializeComponent() private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.Label lblMergeAmount; private System.Windows.Forms.Button btnClearAll; + private System.Windows.Forms.FlowLayoutPanel flpFiles; + private System.Windows.Forms.Button btnAddFile; + private System.Windows.Forms.Button btnSaveFile; + private System.Windows.Forms.TextBox txtSaveFile; + private System.Windows.Forms.Label lblFileCount; } } diff --git a/MergePDF/Form1.cs b/MergePDF/Form1.cs index ac317c6..20be783 100644 --- a/MergePDF/Form1.cs +++ b/MergePDF/Form1.cs @@ -20,14 +20,13 @@ public partial class Form1 : Form private List Textboxes { get; set; } private List FileDialogs { get; set; } - private List Documents { get; set; } - - // Create a document for the merged result. - private PdfDocument outDocument { get; set; } + private PdfMerger _pdfMerger; private OpenFileDialog openFileDialog { get; set; } private SaveFileDialog saveFileDialog { get; set; } + private int NumberOfFiles { get; set; } + public Form1() { InitializeComponent(); @@ -35,7 +34,7 @@ public Form1() Buttons = new List