diff --git a/PDF Merger/PDF Merger/AboutBox1.Designer.cs b/PDF Merger/PDF Merger/AboutBox1.Designer.cs index 6bcbf2e..e046064 100644 --- a/PDF Merger/PDF Merger/AboutBox1.Designer.cs +++ b/PDF Merger/PDF Merger/AboutBox1.Designer.cs @@ -86,7 +86,7 @@ private void InitializeComponent() this.labelProductName.Name = "labelProductName"; this.labelProductName.Size = new System.Drawing.Size(316, 23); this.labelProductName.TabIndex = 19; - this.labelProductName.Text = "PDF Merger"; + this.labelProductName.Text = "PDF Toolbox"; this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelVersion @@ -98,7 +98,7 @@ private void InitializeComponent() this.labelVersion.Name = "labelVersion"; this.labelVersion.Size = new System.Drawing.Size(316, 23); this.labelVersion.TabIndex = 0; - this.labelVersion.Text = "Version 1.0"; + this.labelVersion.Text = "Version 1.2"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelCompanyName diff --git a/PDF Merger/PDF Merger/Form1.Designer.cs b/PDF Merger/PDF Merger/Form1.Designer.cs index eee60cd..85359ae 100644 --- a/PDF Merger/PDF Merger/Form1.Designer.cs +++ b/PDF Merger/PDF Merger/Form1.Designer.cs @@ -30,7 +30,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.listBox1 = new System.Windows.Forms.ListBox(); + this.pdfList = new System.Windows.Forms.ListBox(); this.addBtn = new System.Windows.Forms.Button(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.removeBtn = new System.Windows.Forms.Button(); @@ -52,24 +52,25 @@ private void InitializeComponent() this.textToPDFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tectraWebsiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.gitHubPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveFileDialog2 = new System.Windows.Forms.SaveFileDialog(); this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog(); - this.gitHubPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // - // listBox1 + // pdfList // - this.listBox1.Font = new System.Drawing.Font("Open Sans", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.listBox1.FormattingEnabled = true; - this.listBox1.ItemHeight = 27; - this.listBox1.Location = new System.Drawing.Point(13, 72); - this.listBox1.Name = "listBox1"; - this.listBox1.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; - this.listBox1.Size = new System.Drawing.Size(462, 328); - this.listBox1.TabIndex = 0; + this.pdfList.Font = new System.Drawing.Font("Open Sans", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.pdfList.FormattingEnabled = true; + this.pdfList.ItemHeight = 27; + this.pdfList.Location = new System.Drawing.Point(13, 72); + this.pdfList.Name = "pdfList"; + this.pdfList.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; + this.pdfList.Size = new System.Drawing.Size(462, 328); + this.pdfList.TabIndex = 0; + this.pdfList.MouseHover += new System.EventHandler(this.listBox1_MouseHover); // // addBtn // @@ -182,7 +183,7 @@ private void InitializeComponent() this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 19); this.label1.TabIndex = 8; - this.label1.Text = "Version 1.1"; + this.label1.Text = "Version 1.2"; // // label2 // @@ -236,28 +237,28 @@ private void InitializeComponent() // imageToPDFToolStripMenuItem // this.imageToPDFToolStripMenuItem.Name = "imageToPDFToolStripMenuItem"; - this.imageToPDFToolStripMenuItem.Size = new System.Drawing.Size(216, 26); + this.imageToPDFToolStripMenuItem.Size = new System.Drawing.Size(224, 26); this.imageToPDFToolStripMenuItem.Text = "Image to PDF"; this.imageToPDFToolStripMenuItem.Click += new System.EventHandler(this.ImageToPDFToolStripMenuItem_Click); // // splitPDFToolStripMenuItem // this.splitPDFToolStripMenuItem.Name = "splitPDFToolStripMenuItem"; - this.splitPDFToolStripMenuItem.Size = new System.Drawing.Size(216, 26); + this.splitPDFToolStripMenuItem.Size = new System.Drawing.Size(224, 26); this.splitPDFToolStripMenuItem.Text = "Split PDF by pages"; this.splitPDFToolStripMenuItem.Click += new System.EventHandler(this.SplitPDFToolStripMenuItem_Click); // // richTextToPDFToolStripMenuItem // this.richTextToPDFToolStripMenuItem.Name = "richTextToPDFToolStripMenuItem"; - this.richTextToPDFToolStripMenuItem.Size = new System.Drawing.Size(216, 26); + this.richTextToPDFToolStripMenuItem.Size = new System.Drawing.Size(224, 26); this.richTextToPDFToolStripMenuItem.Text = "Create blank PDF"; this.richTextToPDFToolStripMenuItem.Click += new System.EventHandler(this.RichTextToPDFToolStripMenuItem_Click); // // textToPDFToolStripMenuItem // this.textToPDFToolStripMenuItem.Name = "textToPDFToolStripMenuItem"; - this.textToPDFToolStripMenuItem.Size = new System.Drawing.Size(216, 26); + this.textToPDFToolStripMenuItem.Size = new System.Drawing.Size(224, 26); this.textToPDFToolStripMenuItem.Text = "Text file to PDF"; this.textToPDFToolStripMenuItem.Click += new System.EventHandler(this.TextToPDFToolStripMenuItem_Click); // @@ -275,29 +276,29 @@ private void InitializeComponent() // tectraWebsiteToolStripMenuItem // this.tectraWebsiteToolStripMenuItem.Name = "tectraWebsiteToolStripMenuItem"; - this.tectraWebsiteToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.tectraWebsiteToolStripMenuItem.Size = new System.Drawing.Size(188, 26); this.tectraWebsiteToolStripMenuItem.Text = "John\'s Website"; this.tectraWebsiteToolStripMenuItem.Click += new System.EventHandler(this.TectraWebsiteToolStripMenuItem_Click); // + // gitHubPageToolStripMenuItem + // + this.gitHubPageToolStripMenuItem.Name = "gitHubPageToolStripMenuItem"; + this.gitHubPageToolStripMenuItem.Size = new System.Drawing.Size(188, 26); + this.gitHubPageToolStripMenuItem.Text = "GitHub Page"; + this.gitHubPageToolStripMenuItem.Click += new System.EventHandler(this.GitHubPageToolStripMenuItem_Click); + // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(221, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(185, 6); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(188, 26); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItem_Click); // - // gitHubPageToolStripMenuItem - // - this.gitHubPageToolStripMenuItem.Name = "gitHubPageToolStripMenuItem"; - this.gitHubPageToolStripMenuItem.Size = new System.Drawing.Size(224, 26); - this.gitHubPageToolStripMenuItem.Text = "GitHub Page"; - this.gitHubPageToolStripMenuItem.Click += new System.EventHandler(this.GitHubPageToolStripMenuItem_Click); - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -312,14 +313,14 @@ private void InitializeComponent() this.Controls.Add(this.clearBtn); this.Controls.Add(this.removeBtn); this.Controls.Add(this.addBtn); - this.Controls.Add(this.listBox1); + this.Controls.Add(this.pdfList); this.Controls.Add(this.menuStrip1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; this.MaximizeBox = false; this.Name = "Form1"; - this.Text = "PDF Toolbox v1.1"; + this.Text = "PDF Toolbox v1.2"; this.Load += new System.EventHandler(this.Form1_Load); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); @@ -330,7 +331,7 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.ListBox pdfList; private System.Windows.Forms.Button addBtn; private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.Button removeBtn; diff --git a/PDF Merger/PDF Merger/Form1.cs b/PDF Merger/PDF Merger/Form1.cs index c85651c..ce00439 100644 --- a/PDF Merger/PDF Merger/Form1.cs +++ b/PDF Merger/PDF Merger/Form1.cs @@ -27,24 +27,28 @@ public Form1() private void Button1_Click(object sender, EventArgs e) { //add pdf + openFileDialog1.Multiselect = true; + if (openFileDialog1.ShowDialog() == DialogResult.OK) { - //add selected PDF file to listbox - var file = openFileDialog1.FileName; - listBox1.Items.Add(file); + //add selected PDF files to listbox + foreach (var file in openFileDialog1.FileNames) + { + pdfList.Items.Add(file); + } } } private void RemoveBtn_Click(object sender, EventArgs e) { //remove pdf - ListBox.SelectedObjectCollection selectedItems = new ListBox.SelectedObjectCollection(listBox1); + ListBox.SelectedObjectCollection selectedItems = new ListBox.SelectedObjectCollection(pdfList); - if (listBox1.SelectedIndex != -1) + if (pdfList.SelectedIndex != -1) { //Removes item for (int i = selectedItems.Count - 1; i >= 0; i--) - listBox1.Items.Remove(selectedItems[i]); + pdfList.Items.Remove(selectedItems[i]); } else { @@ -57,17 +61,18 @@ private void ClearBtn_Click(object sender, EventArgs e) if (MessageBox.Show("Are you sure you want to clear the list box?", "PDF Merger", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //clears listbox items - listBox1.Items.Clear(); + pdfList.Items.Clear(); } } private void MergeBtn_Click(object sender, EventArgs e) { - if (listBox1.Items.Count > 1) + saveFileDialog1.Filter = "PDF Files (*.pdf)|*.pdf"; + if (pdfList.Items.Count > 1) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { - var List = listBox1.Items.Cast().ToList(); //creates list of items in listbox + var List = pdfList.Items.Cast().ToList(); //creates list of items in listbox PdfDocument outputDocument = new PdfDocument(); //creates output document @@ -103,22 +108,22 @@ private void UpBtn_Click(object sender, EventArgs e) public void MoveItem(int direction) { - if (listBox1.SelectedItem == null || listBox1.SelectedIndex < 0) + if (pdfList.SelectedItem == null || pdfList.SelectedIndex < 0) return; //no selected item - int newIndex = listBox1.SelectedIndex + direction; + int newIndex = pdfList.SelectedIndex + direction; - if (newIndex < 0 || newIndex >= listBox1.Items.Count) + if (newIndex < 0 || newIndex >= pdfList.Items.Count) return; - object selected = listBox1.SelectedItem; //selected item + object selected = pdfList.SelectedItem; //selected item //removing removable element - listBox1.Items.Remove(selected); + pdfList.Items.Remove(selected); //inserts in new location - listBox1.Items.Insert(newIndex, selected); + pdfList.Items.Insert(newIndex, selected); //restore selection - listBox1.SetSelected(newIndex, true); + pdfList.SetSelected(newIndex, true); } private void DownBtn_Click(object sender, EventArgs e) @@ -158,6 +163,8 @@ private void ImageToPDFToolStripMenuItem_Click(object sender, EventArgs e) private void SplitPDFToolStripMenuItem_Click(object sender, EventArgs e) { //Split PDF by pages + openFileDialog1.Multiselect = false; + if (openFileDialog1.ShowDialog() == DialogResult.OK) { //Creates folder browser dialog called folder @@ -278,5 +285,14 @@ private void GitHubPageToolStripMenuItem_Click(object sender, EventArgs e) //github Process.Start("https://github.com/johnspahr/pdftoolbox"); } + + private void listBox1_MouseHover(object sender, EventArgs e) + { + //When mouse is hovered + if (pdfList.SelectedItem != null) + { + toolTip1.SetToolTip(pdfList, pdfList.GetItemText(pdfList.SelectedItem)); + } + } } } \ No newline at end of file diff --git a/PDF Merger/PDF Merger/Form1.resx b/PDF Merger/PDF Merger/Form1.resx index fc0ac8f..0c617f8 100644 --- a/PDF Merger/PDF Merger/Form1.resx +++ b/PDF Merger/PDF Merger/Form1.resx @@ -145,6 +145,9 @@ AAAAAElFTkSuQmCC + + 346, 17 + 459, 17 diff --git a/PDF Merger/PDF Merger/bin/Debug/PDF Merger.exe b/PDF Merger/PDF Merger/bin/Debug/PDF Merger.exe index 32fb740..0afb824 100644 Binary files a/PDF Merger/PDF Merger/bin/Debug/PDF Merger.exe and b/PDF Merger/PDF Merger/bin/Debug/PDF Merger.exe differ diff --git a/PDF Merger/PDF Merger/bin/Debug/PDF Merger.pdb b/PDF Merger/PDF Merger/bin/Debug/PDF Merger.pdb index 9c5b662..6308658 100644 Binary files a/PDF Merger/PDF Merger/bin/Debug/PDF Merger.pdb and b/PDF Merger/PDF Merger/bin/Debug/PDF Merger.pdb differ diff --git a/PDF Merger/PDF Merger/bin/Release/PDF Merger.exe b/PDF Merger/PDF Merger/bin/Release/PDF Merger.exe index ab65ac8..00bf393 100644 Binary files a/PDF Merger/PDF Merger/bin/Release/PDF Merger.exe and b/PDF Merger/PDF Merger/bin/Release/PDF Merger.exe differ diff --git a/PDF Merger/PDF Merger/bin/Release/PDF Merger.pdb b/PDF Merger/PDF Merger/bin/Release/PDF Merger.pdb index eb8abc0..728e666 100644 Binary files a/PDF Merger/PDF Merger/bin/Release/PDF Merger.pdb and b/PDF Merger/PDF Merger/bin/Release/PDF Merger.pdb differ