瀏覽代碼

Enhance semantic structure by adding artifact backgrounds and pagination markers to layers in Page.cs

Marcin Ziąbek 3 月之前
父節點
當前提交
66f6a94ec1
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      Source/QuestPDF/Elements/Page.cs

+ 9 - 1
Source/QuestPDF/Elements/Page.cs

@@ -31,14 +31,19 @@ namespace QuestPDF.Elements
         {
         {
             container
             container
                 .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Page.ToString())
                 .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Page.ToString())
+                .SemanticDocument()
                 .ContentDirection(ContentDirection)
                 .ContentDirection(ContentDirection)
                 .DefaultTextStyle(DefaultTextStyle.DisableFontFeature(FontFeatures.StandardLigatures))
                 .DefaultTextStyle(DefaultTextStyle.DisableFontFeature(FontFeatures.StandardLigatures))
                 .Layers(layers =>
                 .Layers(layers =>
                 {
                 {
-                    layers.Layer().ZIndex(int.MinValue).Background(BackgroundColor);
+                    layers.Layer()
+                        .ZIndex(int.MinValue)
+                        .ArtifactBackground()
+                        .Background(BackgroundColor);
                     
                     
                     layers
                     layers
                         .Layer()
                         .Layer()
+                        .ArtifactBackground()
                         .Repeat()
                         .Repeat()
                         .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Background.ToString())
                         .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Background.ToString())
                         .Element(Background);
                         .Element(Background);
@@ -61,6 +66,7 @@ namespace QuestPDF.Elements
                         {
                         {
                             decoration
                             decoration
                                 .Before()
                                 .Before()
+                                .ArtifactPaginationHeader()
                                 .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Header.ToString())
                                 .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Header.ToString())
                                 .Element(Header);
                                 .Element(Header);
 
 
@@ -73,12 +79,14 @@ namespace QuestPDF.Elements
 
 
                             decoration
                             decoration
                                 .After()
                                 .After()
+                                .ArtifactPaginationFooter()
                                 .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Footer.ToString())
                                 .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Footer.ToString())
                                 .Element(Footer);
                                 .Element(Footer);
                         });
                         });
                     
                     
                     layers
                     layers
                         .Layer()
                         .Layer()
+                        .ArtifactPaginationWatermark()
                         .Repeat()
                         .Repeat()
                         .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Foreground.ToString())
                         .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Foreground.ToString())
                         .Element(Foreground);
                         .Element(Foreground);