Browse Source

Merge branch 'develop' of lyq/OneNote2PDF into master

天问 3 years ago
parent
commit
0c2ee64efb

+ 35 - 0
OneNote2PDF/App.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OneNote2PDF
+{
+    /// <summary>
+    /// 全局 app 对象
+    /// </summary>
+    class App
+    {
+        public string inputDir = "";
+        public string outputDir = "";
+
+        private static App app;
+        private static readonly object locker = new object(); // 对象锁标志
+
+        public static App getInstance()
+        {
+            if (app == null)
+            {
+                lock (locker) //标志对象加锁,多线程内部代码会挂起
+                {
+                    if (app == null)
+                    {
+                        app = new App();
+                    }
+                }
+            }
+            return app;
+        }
+    }
+}

+ 0 - 70
OneNote2PDF/Form1.Designer.cs

@@ -1,70 +0,0 @@
-namespace OneNote2PDF
-{
-    partial class Form1
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.btnConvert = new System.Windows.Forms.Button();
-            this.SuspendLayout();
-            // 
-            // panel1
-            // 
-            this.panel1.Location = new System.Drawing.Point(209, 171);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(200, 100);
-            this.panel1.TabIndex = 0;
-            // 
-            // btnConvert
-            // 
-            this.btnConvert.Location = new System.Drawing.Point(272, 309);
-            this.btnConvert.Name = "btnConvert";
-            this.btnConvert.Size = new System.Drawing.Size(75, 23);
-            this.btnConvert.TabIndex = 1;
-            this.btnConvert.Text = "转换";
-            this.btnConvert.UseVisualStyleBackColor = true;
-            // 
-            // Form1
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 450);
-            this.Controls.Add(this.btnConvert);
-            this.Controls.Add(this.panel1);
-            this.Name = "Form1";
-            this.Text = "Form1";
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.Button btnConvert;
-    }
-}
-

+ 199 - 0
OneNote2PDF/MainForm.Designer.cs

@@ -0,0 +1,199 @@
+namespace OneNote2PDF
+{
+    partial class MainForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.btnHome = new System.Windows.Forms.Button();
+            this.btnAbout = new System.Windows.Forms.Button();
+            this.btnConvert = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.button1 = new System.Windows.Forms.Button();
+            this.label3 = new System.Windows.Forms.Label();
+            this.tbOutputDir = new System.Windows.Forms.TextBox();
+            this.lbConvertResult = new System.Windows.Forms.Label();
+            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
+            this.tbInputDir = new System.Windows.Forms.TextBox();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panel1
+            // 
+            this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
+            this.panel1.Controls.Add(this.btnHome);
+            this.panel1.Controls.Add(this.btnAbout);
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(165, 459);
+            this.panel1.TabIndex = 0;
+            // 
+            // btnHome
+            // 
+            this.btnHome.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.btnHome.Location = new System.Drawing.Point(6, 120);
+            this.btnHome.Name = "btnHome";
+            this.btnHome.Size = new System.Drawing.Size(152, 37);
+            this.btnHome.TabIndex = 8;
+            this.btnHome.Text = "关于我们";
+            this.btnHome.UseVisualStyleBackColor = false;
+            // 
+            // btnAbout
+            // 
+            this.btnAbout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.btnAbout.Location = new System.Drawing.Point(6, 77);
+            this.btnAbout.Name = "btnAbout";
+            this.btnAbout.Size = new System.Drawing.Size(152, 37);
+            this.btnAbout.TabIndex = 7;
+            this.btnAbout.Text = "首页";
+            this.btnAbout.UseVisualStyleBackColor = false;
+            // 
+            // btnConvert
+            // 
+            this.btnConvert.Location = new System.Drawing.Point(425, 278);
+            this.btnConvert.Name = "btnConvert";
+            this.btnConvert.Size = new System.Drawing.Size(152, 37);
+            this.btnConvert.TabIndex = 1;
+            this.btnConvert.Text = "转换";
+            this.btnConvert.UseVisualStyleBackColor = true;
+            this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("SimSun", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(332, 62);
+            this.label1.Name = "label1";
+            this.label1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+            this.label1.Size = new System.Drawing.Size(274, 21);
+            this.label1.TabIndex = 2;
+            this.label1.Text = "OneNote Convert PDF Tool";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(256, 162);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(119, 12);
+            this.label2.TabIndex = 3;
+            this.label2.Text = "OneNote笔记文件夹:";
+            // 
+            // button1
+            // 
+            this.button1.Font = new System.Drawing.Font("SimSun", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.button1.Location = new System.Drawing.Point(630, 157);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(80, 23);
+            this.button1.TabIndex = 4;
+            this.button1.Text = "选择文件夹";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(310, 230);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(65, 12);
+            this.label3.TabIndex = 5;
+            this.label3.Text = "输出目录:";
+            // 
+            // tbOutputDir
+            // 
+            this.tbOutputDir.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.tbOutputDir.Font = new System.Drawing.Font("SimSun", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.tbOutputDir.Location = new System.Drawing.Point(381, 229);
+            this.tbOutputDir.Name = "tbOutputDir";
+            this.tbOutputDir.Size = new System.Drawing.Size(241, 15);
+            this.tbOutputDir.TabIndex = 6;
+            // 
+            // lbConvertResult
+            // 
+            this.lbConvertResult.AutoSize = true;
+            this.lbConvertResult.Location = new System.Drawing.Point(457, 332);
+            this.lbConvertResult.Name = "lbConvertResult";
+            this.lbConvertResult.Size = new System.Drawing.Size(0, 12);
+            this.lbConvertResult.TabIndex = 7;
+            // 
+            // tbInputDir
+            // 
+            this.tbInputDir.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.tbInputDir.Font = new System.Drawing.Font("SimSun", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.tbInputDir.Location = new System.Drawing.Point(381, 161);
+            this.tbInputDir.Name = "tbInputDir";
+            this.tbInputDir.Size = new System.Drawing.Size(241, 15);
+            this.tbInputDir.TabIndex = 9;
+            // 
+            // MainForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+            this.BackColor = System.Drawing.SystemColors.Control;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Controls.Add(this.tbInputDir);
+            this.Controls.Add(this.lbConvertResult);
+            this.Controls.Add(this.tbOutputDir);
+            this.Controls.Add(this.panel1);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.btnConvert);
+            this.Controls.Add(this.label2);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Name = "MainForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "OneNote转换工具";
+            this.Load += new System.EventHandler(this.MainForm_Load);
+            this.panel1.ResumeLayout(false);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Button btnConvert;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.TextBox tbOutputDir;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Button btnHome;
+        private System.Windows.Forms.Button btnAbout;
+        private System.Windows.Forms.Label lbConvertResult;
+        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
+        private System.Windows.Forms.TextBox tbInputDir;
+    }
+}
+

+ 88 - 0
OneNote2PDF/MainForm.cs

@@ -0,0 +1,88 @@
+using Aspose.Note;
+using Aspose.Note.Saving;
+using OneNote2PDF.Utils;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OneNote2PDF
+{
+    public partial class MainForm : Form
+    {
+        App app;
+
+        public MainForm()
+        {
+            InitializeComponent();
+        }
+
+        private void btnConvert_Click(object sender, EventArgs e)
+        {
+            // 判断输入 OneNote 笔记目录是否正确
+            if (app.inputDir!=null || app.inputDir!="")
+            {
+                lbConvertResult.Text = "正在转换中,请稍耐心等待...";
+                foreach (DirectoryInfo subDirInfo in (new DirectoryInfo(app.inputDir)).GetDirectories())
+                {
+                    string subDir = Path.Combine(app.outputDir, subDirInfo.Name); //输出目录
+                    if (!Directory.Exists(subDir))
+                    {
+                        Directory.CreateDirectory(subDir);
+                    }
+                    foreach (FileInfo file in subDirInfo.GetFiles())
+                    {
+                        //只有后缀为one的文件才处理
+                        if (file.Name.Substring(file.Name.Length - 3, 3) == "one")
+                        {
+                            // 异步执行
+                            ThreadStart starter = delegate {
+                                OneNoteUtils.One2PDF(file.FullName, Path.Combine(app.outputDir, subDirInfo.Name, file.Name.Substring(0, file.Name.Length - 4) + ".pdf"));
+                            };
+                            new Thread(starter).Start();
+                        }
+                        return;
+                    }
+                    lbConvertResult.Text = "全部转换成功";
+                }
+            }
+            else
+            {
+                MessageBox.Show("请先选择正确的 OneNote 笔记目录再执行转换。");
+            }
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            folderBrowserDialog1.Description = "请选择文件夹";
+            if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                if (string.IsNullOrEmpty(folderBrowserDialog1.SelectedPath))
+                {
+                    MessageBox.Show(this, "文件夹路径不能为空", "提示");
+                    return;
+                }
+                else
+                {
+                    app.inputDir = folderBrowserDialog1.SelectedPath;
+                    tbInputDir.Text = app.inputDir;
+                }
+            }
+
+        }
+
+        private void MainForm_Load(object sender, EventArgs e)
+        {
+            app = App.getInstance();//初始化app对象
+            tbOutputDir.Text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),"Output");
+            app.outputDir = tbOutputDir.Text;
+        }
+    }
+}

+ 243 - 0
OneNote2PDF/MainForm.resx

@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>25, 10</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAABAAEALi4AAAEAGADAGgAAFgAAACgAAAAuAAAAXAAAAAEAGAAAAAAAmBoAAAAAAAAAAAAAAAAAAAAA
+        AAD/////////////////////////////////////////////////////////////////////////////
+        ///////////+/v3+/fz//////////////////////////////v3+/fz/////////////////////////
+        //////////////////////////8AAP//////////////////////////////////////////////////
+        //////////////////////////////////7+/P///v////z59PDkyefSpeTKleXNnezbuPfw4///////
+        //7+/f/+/f///////////////////////////////////////////wAA////////////////////////
+        /////////////////////////////////////////////////////v7+/v38////9/Hk3b17y5ctxIkP
+        w4cJw4YJw4YJxIcLx48c1KlS7Nu5////////////////////////////////////////////////////
+        AAD////////////////////////////////////////////////////+/v7+/f79/P39/P3+/f7/////
+        //7////n0aPIkR/DhgfFixTHjhrHjRXGixLGjBTIjxnIjxrFiQ7DhwrWrl338OH//////v7/////////
+        //////////////////////////8AAP////////////////////////////////7+/v39/f38/f38/f/+
+        //////////////////////z8++7q+Ny9fsOGBsaMFsiQHc2UE8iQFsuZMdCiQ86eO8iRH8OGCcaMFMmS
+        H8CAAObPn/////79/P///////////////////////////////////wAA/////////////f39/fz9/fz9
+        /v7+////////////////////////9fL14tniybrLtJi3onaihFGUn2RPyIwJxo0cyZEXyZEXomM7nm1/
+        +/r3/f3//Pr79e7i5c2fzJo2vn4A3b6A/////Pz7/f79/f39/f39/v7/////////////////////////
+        AAD////////////////////////////6+/rq5OvXyNi7pcGigaqQYJaBR4V4M3xuK3ZsK3NsKHuEQmPI
+        jxTIjxvJkBbCiB6MTmVtJ3+TYpr////+/v////////7////++/Lw3aj+/fr////////////////////+
+        /v7///////////////////////8AAP////////r5+t3S3sixyK2PsJhum4lSi3s8fnQwdnAod28rdnIw
+        d3k0e3s5fXw7gH09f3c3grN5McyTE8eOGMaNGIdIaHU0hXg1d4VSi8q2ycuxysqyysqxycmwxsu0zs65
+        2seyyNCwzr3Cw47RodnK2trH2/Py9P////38/f39/f///////////wAA/f39////2s7bby1zcit2bitz
+        ci13djF7eTd9ejp/fDt+ezt/ejp/eTaBdzaBdzd/czGFh0hpyZAVxowazJMSllhVby2LdjWBdjSCeTp/
+        fEZ+f0aCfUWBf0WCf0aCf0WBfEN9g0aFd0h8QZFdOLFbTIhkcTV0mWyb//////7//v7+////////////
+        AAD9/f3////ZzNt1Mnh/O4J7O397O396On15OX15OH15OH15OH14N36AQXCDRGyERG2AQHKkaELMkxLH
+        jhjBhx6KTGKJSmaRU2CDQWGPX5T+//77+/z7+/v7/Pz7/Pz6+/v////y+PRmv4FAsWJKrmhDuGVWpnB0
+        PniFS4qVZ5nZy9f////+/v7///8AAP39/f///9rM23Exd3s5gHk4fXk4fXk4fXk4fXk4fXk4fXo5fHY1
+        gIpLZMOKGsiPFsWMGciPF8eOGMeOGMaNGMePF8yTEsiQGIVDXo5gmP/////+//////////7///////v9
+        +3PCizmoW0iuZ0WuZUasZUKzY0qaZamar6x5rXU7efPv8v////7+/gAA/f39////2szbbzF3eTmAeTh9
+        eTh9eTh9eTh9eTh9eTh9eTh9ejl8dDOEiktlxYwZyZEVxo0ax44Yx44Yxo0ZyZAWxYwaiUpobyuBi1uM
+        5Nzk49nj4tnj49rj4tfj6drpgcmWOaxcSbJpRa5lRa5lRa5lQ65kPbRgWMV20OnYe0SA2c3Z/////f39
+        AAD9/f3////azNtvMXd5OYB5OH15OH15OH15OH15OH15OH15OH15OH16Ont0MoSHSGjEihvKkRXGjRnG
+        jRnIkBfHjhiLTGRzMoR8Onx5Mn1tJm1sJXBpJm9rJnBsJHBJbV4yolQ9m1xCoWBGr2ZFrWVFsGZWrXFT
+        lmxouoF/xJRyRHrUwdX////9/P0AAP39/f///9rM228xd3k5gHk4fXk4fXk4fXk4fXk4fXk4fXk4fXk4
+        fXk4fXs6e3Qzg4ZHasOKHcqRFceOGMiPFo1OYXQyhHs7fHYzeoRQicKrxMKnxMGpw8KoxL+tw7bEvre8
+        vsO5x4eqlj2tX0OrY1W9c7+5w4A+gvr5+vr7+nhAfdG90v////38/QAA/f39////2szbbzF3eTmAeTh9
+        eTh9eTh9eTh9ezt+ezt/eTh9eTh9eTh9eTh9ezt7djSFhENtwYcey5ITj1FeczKEejp7ejt+cy93lGSU
+        //////7//////////////////////f/9asKEQKxhO6hdf8+V2sbaeD98+fn5+Pr5d0B90LzS/////fz9
+        AAD9/f3////azNtvMXd5OYB5OH15OH14OH55NnxwK3dyKnd4Nn15OH93OH17OX95MX1xM3JwNYGJSmiR
+        U1p1MIZ6Ont5N359NX9zMniPXpP28/X17/T18PT08PTy7/Lx7PH87PqQzKI3p1lLsGo4p1rM8NXdx914
+        PXz59/n5+fl6QX3Sv9L////9/P0AAP39/f///9rM228xd3k5gHk4fXk5fXc1fYI+haeAqayKrH9Egng0
+        fnk8fXMteZlqm97U3u/s7aN7rm0nfH48fXo2fnY+e2xTdn0vf3o0gHk1f3Q4enU4eXg5fYE7g4BCg2KE
+        dT+vYEqvaTmpW3TAi////9LC1HpAfPv7+/j3+Xg8fNbG1v////38/QAA/f39////2szbbzF3eTmAeTh9
+        ejl+dDN3iFOO/f7++/v6h1GKeDF8fDp/dDd44Nfg////////sImxcip1ezx/fDB+V4NtQrZjV3xsdVl/
+        poCpr4Wwr4WvoH2jcmx9S5FlQLNiSq9pPqtfUbNu5vLq////08TUeDp83dHdw6zEcjx46uTq/////v3+
+        AAD9/f3////azNtvMXd5OYB5OH16On52MXqKUY/7+/v49/iET4h5NX1uLnWlfKf////69/r///+sia9u
+        K3Z/M4Jcdm9AuWNHq2ZCtGNGtGZjxH9zy4xxyopbwXhEuGZEsmVIrGc6qlxPsm3Z7t/////////Vx9Vx
+        MXaTbJN7SH57Q4T29Pb////+/v4AAP39/f///9rM228xd3k5gHk4fXo6fnYxeolTjf3+/fr6+oNRh3Yx
+        fHk5fOTd5P////z6/P///6uJr20qdn42gWVkc0inZkG2Y0WvZUWsZUCpYT2oXj2oXkKqYkeuZkW1ZkC2
+        YnDDiOb16v////v8/P///9TD1HRBe/v9/O7q73U8d+DU4P////39/QAA/f39////2szbbzF3eTmAeTh9
+        ejp+djF6iVON/f79+vr6hlOJbiZuqYaq/////Pv8/fz9////q4mvbil2fDqBfDB+dUF6XHdvSqFnQ7Bj
+        PaxePa5fPa5fPaxeP6RfSYtkXVltilOOiU+NlnWZ/v/+////1MLVez6A+fj6+/v7ekJ81MHV/////fz9
+        AAD9/f3////azNtvMXd5OYB5OH16On52MXqJUo39/v36+vqDTIt2N3ro5Oj////X0Njy8PP///+qia5u
+        KXZ9OoF4On16Nn59MH92OXtzW3x/lY16nIl6m4mBj4yLeJGVYpeYXpmQX5OJVo2ef6H9/v3////Tw9R6
+        P377+vv6+vp7QX/SvdL////9/P0AAP39/f///9rM228xd3k5gHk4fXo6fnYxeolSjf3+/f38/XpAgamK
+        rP////Pw85RzlfXy9f///6uJr24pdnw6gXk4fXk5fXk8fnQueJNelP/+///4///5///6///+////////
+        //////////////39/f///9PD1Ho/fvr5+/v8+3xCf9G80f////38/QAA/f39////2szbbzF3eTmAeTh9
+        ejp+djF6iVKN/f/9+fb5h1qI6ODo////vKS/fEWB+/v7////q4mvbil2fDqBeTh9eTh9ejp+cy94kGWT
+        //////7//////////////////////////////////f39////08PUekB++vn6+/v7ekF+0b7T/////fz9
+        AAD9/f3////azNtvMXd5OYB5OH16On52MXqJU43////x7vHAsb/////29faCSIaFSYn4+fj///+ria9u
+        KXZ9OoF5OH15OH15OX14NXyCRIWkeaaieKSjeaWkeKWjeKWjeaWjeKWkeqagc6Kvk7L9/v3////Tw9R6
+        P376+fv6+/p5QH3Vw9f////9/P0AAP39/f///9rM228xd3k5gHk4fXo6fnYxeolTjvz9/P39/ff19///
+        /7umvWwkcYhSjff29v///6uJr24pdn06gXk4fXk4fXk4fXk3fXs5gHxCgH1AgHxCfn1Cf31Cf31Cf31C
+        f35EgHg6eo9mkv7+/v///9TD1ntCf/39/erl63Q6d+PX5P////79/gAA/f39////2szbbzF3eTmAeTh9
+        ejp+djF6iVOO+/z7////////9fL1hkyJdi16g1CL9/X2////qoiubil2fDqBeTh9eTh9ejp+dC94kl+V
+        +vz6+Pf4+Pf5+Pj5+fj5+fj5+Pj5+fj5+Pf5+vn6/fz9////0sLUaiJuiFaKdj95hE6L+/v6//////7/
+        AAD9/f3////azNtvMXd5OYB5OH16On52MXqKU435+fr8+vz///+4obhuK3Z6Nn6CTIn08vT///+rh65u
+        KXZ8OoF5OH15OH16On5zL3eVYpb//////v/////////////////////////////////+/v7////r5uu2
+        nbi8ob6edqB8Q4Hz8PP////+/v4AAP39/f///9rM228xd3k5gHk4fXo5fnQyeYlTkvv7/P////Dt8H5H
+        gXY3fHc0fIBNhvTz9P///6+HsHIoeHs7f3k4fXk4fXo5fnY0e4RLirmdvrmcvbicvbidvbidvbmdvrmd
+        vbmfvLWbucSxxf////////////7+/v////Lw8nY9etvL3P////39/QAA/f39////2szbbzF3eTmAeTh9
+        eTl9dzV8g0KFso+4vqLDnHahdS96ezt/dzR8fkiE3dTd+/z7qYWscCt0fjp/eTh9eTh9eTh9ejl+dTR7
+        ciZ2bypyayxxbCxybCtybCtybCtybi10ZiNuh1KJ/////////v7+/Pv8//7/9/b2e0J/0r/U/////fz9
+        AAD9/f3////azNtvMXd5OYB5OH15OH14OH56NnxuKXVvJ3FzLnl4On95OHx5OH55N353OXl7Rn9/P4N5
+        N3x6OH15OH15OH16On50MHmMW5Lo4erm3ejl3efl3ujl3ujl3ejl3ufm4Obk3uXr5uv////////////+
+        /v7////4+Ph6QX7QvdL////9/P0AAP39/f///9rM228xd3k5gHk4fXk4fXk4fXk4fXs7fnw8f3s6fnk4
+        fXk4fXk4fXk4fXk3fng1fHg2fHk4fXk4fXk4fXk4fXo6fnMvd5Vklv////7+////////////////////
+        //////////////////////////7+/v////j4+HpBftC80v////38/QAA/f39////2szbbzF3eTmAeTh9
+        eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTl9eTh9eTh9eTh9eTh9eTh9ejl+dTJ6iVSM
+        1cbW1sHW08PU08PV08PV08PV08PV08PV0cDT28/c//////////7//fz9////9/f3e0GA0r7T/////fz9
+        AAD9/f3////azNtvMXd5OYB5OH15OH15OH15OH15OH15OH15OH15OH15OH15OH15OH15OH15OH15OH15
+        OH15OH15OH15OH15OH16OX52MntmJGlqI25oJWtpJWxpJWxpJWxpJWxqJ21jG2aAUoL//////v/////+
+        /v7////39fd6RXnVx9b////9/P0AAP39/f///9rM228xd3k5gHk4fXk4fXk4fXk4fXk4fXk4fXk4fXk4
+        fXk4fXk4fXk4fXk4fXk4fXk4fXk4fXk4fXk4fXk4fXo5fnUyeYhWjNfJ2NbG19bG1tfG19fG19bG19fH
+        1tfH19XE1d3S3f////////j2+OXc5Ovk68GoxGsycenl6v////79/gAA/f39////2szbcTF3ejmAeTh9
+        eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9eTh9ejp+cy93k2OY
+        //////7//////////////////////////////////fz9////1cjVcS53ej5/dz55t5q6/////v7+////
+        AAD9/f3////Zzdt1M3l/O4J6O396On55OX15OH15OH15OH15OH15OH15OH15OH15OH15OH15OH15OH15
+        OH15OH15OH15OH16On5zL3iSY5b//////v/////////////////////////////////9/f3////VxtZy
+        O37l3Ob6+fr///////////////8AAP38/f///9jL2mwncHMqdnAsdXUweXg1fHo5fns7f3w7f3s7fno6
+        fXo4fnk4fXk4fXk4fXk4fnk4fXk4fXk4fXk4fXk4fXk4fXk3fXs9goZWiIVViYRUiYVTioVTioVTioVT
+        ioVTiYRTiYVUiYZUiIdZjHpBgI9ilf/////+//39/v///////////wAA//7/////9/T30L7SuZq6oHmj
+        jluSgUOEdjN4cSxzcSl2cSx4dDN6eTZ+eTl/ejuAejqBejmBejl9eTh9eTh9eTh9eTh9ejl+djN7h02J
+        v6a+vaG/u6K9u6K9u6K9u6K+vKK+vKO+vKO/vaXAv6jBwKnEybLJ7+nt/////v3+////////////////
+        AAD////////////////////////9/v3y7/Lg1ODLtMqukrOWb52GUYp3PX1zMHdwKXZwKXZzLnl3NHt6
+        OH57O397O396O357PH9zL3eUZpf////+/v7/////////////////////////////////////////////
+        /v////////////////////////8AAP////////7//v38/f38/f39/f////////////////////////v6
+        +uzl7NnJ2L+qwqeGq5ZlmYFJhHY2eXAtdHAqdHMqd3YyenItd5VjmP////z7/f38/f38/f38/f38/f38
+        /f38/f38/f38/f38/f38/f38/f7+/v///////////////////////wAA////////////////////////
+        /////v7+/v3+/fz9/fz9/v3+////////////////////////9vT25Nvkz77QuJy6onmkj1yRezh8kGOS
+        /////v7+////////////////////////////////////////////////////////////////////////
+        AAD//////////////////////////////////////////////////v/+/v79/P39/P39/P3+/v//////
+        ///////////////+//7u6e7m3+b/////////////////////////////////////////////////////
+        //////////////////////////8AAP//////////////////////////////////////////////////
+        //////////////////////7+/v79/v38/f38/f79/v//////////////////////////////////////
+        /////////////////////////////////////////////////////wAA////////////////////////
+        /////////////////////////////////////////////////////////////////////////v7+/v7+
+        ////////////////////////////////////////////////////////////////////////////////
+        AAD/////////////////////////////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        //////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+</value>
+  </data>
+</root>

+ 15 - 0
OneNote2PDF/Model/Note.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OneNote2PDF.Model
+{
+    class Note
+    {
+        string title;
+        string fileName;
+        
+    }
+}

+ 29 - 5
OneNote2PDF/OneNote2PDF.csproj

@@ -32,7 +32,13 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationIcon>Resources\logo.ico</ApplicationIcon>
+  </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Aspose.Note, Version=18.11.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
+      <HintPath>..\packages\Aspose.Note.18.11.0\lib\net4.0\Aspose.Note.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
@@ -46,16 +52,26 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Form1.cs">
+    <Compile Include="App.cs" />
+    <Compile Include="MainForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
+    <Compile Include="MainForm.Designer.cs">
+      <DependentUpon>MainForm.cs</DependentUpon>
     </Compile>
+    <Compile Include="Model\Note.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="Form1.resx">
-      <DependentUpon>Form1.cs</DependentUpon>
+    <Compile Include="Utils\AsyncTaskQueue.cs" />
+    <Compile Include="Utils\OneNoteUtils.cs" />
+    <Compile Include="Views\About.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Views\About.Designer.cs">
+      <DependentUpon>About.cs</DependentUpon>
+    </Compile>
+    <EmbeddedResource Include="MainForm.resx">
+      <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
@@ -65,7 +81,12 @@
     <Compile Include="Properties\Resources.Designer.cs">
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
     </Compile>
+    <EmbeddedResource Include="Views\About.resx">
+      <DependentUpon>About.cs</DependentUpon>
+    </EmbeddedResource>
+    <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -79,5 +100,8 @@
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\logo.ico" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 1 - 1
OneNote2PDF/Program.cs

@@ -16,7 +16,7 @@ namespace OneNote2PDF
         {
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1());
+            Application.Run(new MainForm());
         }
     }
 }

+ 3 - 3
OneNote2PDF/Properties/AssemblyInfo.cs

@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("OneNote2PDF")]
-[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyCopyright("Copyright ©  ZhiZhou Technology 2021")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.1.0")]
+[assembly: AssemblyFileVersion("1.0.1.0")]

+ 28 - 26
OneNote2PDF/Properties/Resources.Designer.cs

@@ -8,10 +8,10 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace OneNote2PDF.Properties
-{
-
-
+namespace OneNote2PDF.Properties {
+    using System;
+    
+    
     /// <summary>
     ///   A strongly-typed resource class, for looking up localized strings, etc.
     /// </summary>
@@ -19,53 +19,55 @@ namespace OneNote2PDF.Properties
     // class via a tool like ResGen or Visual Studio.
     // To add or remove a member, edit your .ResX file then rerun ResGen
     // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
+    internal class Resources {
+        
         private static global::System.Resources.ResourceManager resourceMan;
-
+        
         private static global::System.Globalization.CultureInfo resourceCulture;
-
+        
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
+        internal Resources() {
         }
-
+        
         /// <summary>
         ///   Returns the cached ResourceManager instance used by this class.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
                     global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OneNote2PDF.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
         ///   Overrides the current thread's CurrentUICulture property for all
         ///   resource lookups using this strongly typed resource class.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+        /// </summary>
+        internal static System.Drawing.Icon logo {
+            get {
+                object obj = ResourceManager.GetObject("logo", resourceCulture);
+                return ((System.Drawing.Icon)(obj));
+            }
+        }
     }
 }

+ 12 - 5
OneNote2PDF/Properties/Resources.resx

@@ -46,7 +46,7 @@
     
     mimetype: application/x-microsoft.net.object.binary.base64
     value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
     
     mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
             : and then encoded with base64 encoding.
     -->
   <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
     <xsd:element name="root" msdata:IsDataSet="true">
       <xsd:complexType>
         <xsd:choice maxOccurs="unbounded">
@@ -68,9 +69,10 @@
               <xsd:sequence>
                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="name" use="required" type="xsd:string" />
               <xsd:attribute name="type" type="xsd:string" />
               <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="assembly">
@@ -85,9 +87,10 @@
                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
               <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
               <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="resheader">
@@ -109,9 +112,13 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

BIN
OneNote2PDF/Resources/logo.ico


+ 18 - 0
OneNote2PDF/Utils/AsyncTaskQueue.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace OneNote2PDF.Utils
+{
+    class AsyncTaskQueue
+    {
+
+        static void multiThread(string select,long num)
+        {
+            ThreadPool.SetMinThreads(500, 10);
+        }
+    }
+}

+ 46 - 0
OneNote2PDF/Utils/OneNoteUtils.cs

@@ -0,0 +1,46 @@
+using Aspose.Note;
+using Aspose.Note.Saving;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OneNote2PDF.Utils
+{
+    class OneNoteUtils
+    {
+
+        string dataDir = "";
+
+        /// <summary>
+        /// one 文件转化为 pdf
+        /// </summary>
+        /// <param name="inputFile"></param>
+        /// <param name="outputFile"></param>
+        /// <returns></returns>
+        public static bool One2PDF(string inputFile, string outputFile)
+        {
+            //异步执行
+            
+
+
+            Document oneFile = new Document(inputFile);
+            oneFile.Save(outputFile, SaveFormat.Pdf);
+            return true;
+        }
+
+        /// <summary>
+        /// one文件转化为html ,注意每个one文件分别存一个目录
+        /// </summary>
+        /// <param name="inputFile"></param>
+        /// <param name="outputFile"></param>
+        /// <returns></returns>
+        public static bool One2Html(string inputFile, string outputFile)
+        {
+            Document oneFile = new Document(inputFile);
+            oneFile.Save(outputFile, SaveFormat.Html);
+            return true;
+        }
+    }
+}

+ 46 - 0
OneNote2PDF/Views/About.Designer.cs

@@ -0,0 +1,46 @@
+namespace OneNote2PDF.Views
+{
+    partial class About
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.SuspendLayout();
+            // 
+            // About
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Name = "About";
+            this.Size = new System.Drawing.Size(680, 468);
+            this.Load += new System.EventHandler(this.About_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+    }
+}

+ 9 - 4
OneNote2PDF/Form1.cs → OneNote2PDF/Views/About.cs

@@ -1,20 +1,25 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Data;
 using System.Drawing;
+using System.Data;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
-namespace OneNote2PDF
+namespace OneNote2PDF.Views
 {
-    public partial class Form1 : Form
+    public partial class About : UserControl
     {
-        public Form1()
+        public About()
         {
             InitializeComponent();
         }
+
+        private void About_Load(object sender, EventArgs e)
+        {
+
+        }
     }
 }

+ 0 - 0
OneNote2PDF/Form1.resx → OneNote2PDF/Views/About.resx


+ 4 - 0
OneNote2PDF/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Aspose.Note" version="18.11.0" targetFramework="net461" />
+</packages>

+ 23 - 0
README.md

@@ -0,0 +1,23 @@
+# OneNote2PDF
+
+一直使用 Onenote 2016 做笔记,由于国内“众所周知”的原因, OneNote 网络同步很不好用,跨平台体验一直很差,有时候下班在地铁希望通过手机看看 OneNote 笔记,这些愿望都无法实现,遂开发这个工具实现 Onenote 文件 .one 批量转换为 pdf 等通用格式。这样就可以在其他平台方便查看了。
+
+## screenshot
+
+![](screenshot/BaiduHi_2021-1-12_19-43-11.png)
+
+
+## 遗留问题
+
+1、有用户需求,后续可以继续完善。
+
+2、采用 aspose.note 依赖,单个授权就是 399 美元。本项目开源版本未付费,所以转换后的 pdf 文件会有 aspose 网站的水印。
+
+致谢:
+
+https://docs.aspose.com/note/net/convert-onenote-documents-to-pdf-and-other-formats/
+
+
+
+
+

BIN
screenshot/BaiduHi_2021-1-12_19-43-11.png