update 20260412
This commit is contained in:
13
ZZPDFTest/Form1.Designer.cs
generated
13
ZZPDFTest/Form1.Designer.cs
generated
@@ -40,6 +40,7 @@
|
||||
this.button5 = new System.Windows.Forms.Button();
|
||||
this.button6 = new System.Windows.Forms.Button();
|
||||
this.button7 = new System.Windows.Forms.Button();
|
||||
this.button8 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
@@ -152,11 +153,22 @@
|
||||
this.button7.UseVisualStyleBackColor = true;
|
||||
this.button7.Click += new System.EventHandler(this.button7_Click);
|
||||
//
|
||||
// button8
|
||||
//
|
||||
this.button8.Location = new System.Drawing.Point(21, 223);
|
||||
this.button8.Name = "button8";
|
||||
this.button8.Size = new System.Drawing.Size(75, 23);
|
||||
this.button8.TabIndex = 8;
|
||||
this.button8.Text = "button8";
|
||||
this.button8.UseVisualStyleBackColor = true;
|
||||
this.button8.Click += new System.EventHandler(this.button8_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1465, 854);
|
||||
this.Controls.Add(this.button8);
|
||||
this.Controls.Add(this.button7);
|
||||
this.Controls.Add(this.button6);
|
||||
this.Controls.Add(this.button5);
|
||||
@@ -182,6 +194,7 @@
|
||||
private System.Windows.Forms.Button button5;
|
||||
private System.Windows.Forms.Button button6;
|
||||
private System.Windows.Forms.Button button7;
|
||||
private System.Windows.Forms.Button button8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ using System.Dynamic;
|
||||
using Model;
|
||||
using System.Drawing.Text;
|
||||
using System.Xml.Linq;
|
||||
using Syncfusion.
|
||||
|
||||
|
||||
namespace ZZPDFTest
|
||||
@@ -465,6 +466,23 @@ namespace ZZPDFTest
|
||||
}
|
||||
}
|
||||
|
||||
private void button8_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (WordDocument document = new WordDocument(Path.GetFullPath(@"../../Data/Input.docx"), FormatType.Docx))
|
||||
{
|
||||
//Instantiation of DocToPDFConverter for Word to PDF conversion
|
||||
using (DocToPDFConverter converter = new DocToPDFConverter())
|
||||
{
|
||||
//Converts Word document into PDF document
|
||||
using (PdfDocument pdfDocument = converter.ConvertToPDF(document))
|
||||
{
|
||||
//Saves the PDF document
|
||||
pdfDocument.Save(Path.GetFullPath(@"../../Sample.pdf"));
|
||||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user