|
@@ -27,6 +27,7 @@ using System.Collections;
|
|
using System.Data;
|
|
using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Diagnostics;
|
|
using System.Globalization;
|
|
using System.Globalization;
|
|
|
|
+using System.IO;
|
|
using System.Reflection.PortableExecutable;
|
|
using System.Reflection.PortableExecutable;
|
|
using Ubiety.Dns.Core;
|
|
using Ubiety.Dns.Core;
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
@@ -10798,45 +10799,7 @@ ORDER by gctggrc.id DESC
|
|
DocumentBuilder builder = new DocumentBuilder(doc);
|
|
DocumentBuilder builder = new DocumentBuilder(doc);
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- #region 设置页眉
|
|
+
|
|
-
|
|
|
|
- string voucherHeaderPath = $"./Images/VoucherHeader.png";
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
|
|
|
|
-
|
|
|
|
- builder.PageSetup.HeaderDistance = 42;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- Aspose.Words.Border borderHeader = null;
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- borderHeader = builder.ParagraphFormat.Borders.Bottom;
|
|
|
|
- }
|
|
|
|
- catch (Exception e)
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- borderHeader.Shadow = true;
|
|
|
|
- borderHeader.DistanceFromText = 2;
|
|
|
|
- borderHeader.LineStyle = Aspose.Words.LineStyle.Single;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (System.IO.File.Exists(voucherHeaderPath))
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- var image = Image.FromFile(voucherHeaderPath);
|
|
|
|
-
|
|
|
|
- builder.InsertImage(image, RelativeHorizontalPosition.Default, 1, RelativeVerticalPosition.Margin, 1, 1.20, 2.70, WrapType.Inline);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- #endregion
|
|
|
|
|
|
|
|
|
|
|
|
builder.MoveToDocumentStart();
|
|
builder.MoveToDocumentStart();
|
|
@@ -11222,17 +11185,52 @@ ORDER by gctggrc.id DESC
|
|
builder.Writeln("");
|
|
builder.Writeln("");
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
-
|
|
+
|
|
|
|
+ #region 设置页眉
|
|
|
|
+
|
|
|
|
+ builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
|
|
|
|
+ string voucherHeaderPath = $"./Images/VoucherHeader.png";
|
|
|
|
+ if (System.IO.File.Exists(voucherHeaderPath))
|
|
|
|
+ {
|
|
|
|
+ byte[] imageBytes = System.IO.File.ReadAllBytes(voucherHeaderPath);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Shape shape = builder.InsertImage(imageBytes);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
|
|
|
|
+ shape.RelativeVerticalPosition = RelativeVerticalPosition.TopMargin;
|
|
|
|
+ shape.Top = 50;
|
|
|
|
+ shape.Left = 0;
|
|
|
|
+ shape.Width = 81;
|
|
|
|
+ shape.Height = 36;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Aspose.Words.Border borderHeader = null;
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ borderHeader = builder.ParagraphFormat.Borders.Bottom;
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ borderHeader.Shadow = true;
|
|
|
|
+ borderHeader.DistanceFromText = 2;
|
|
|
|
+ borderHeader.LineStyle = Aspose.Words.LineStyle.Single;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|