Browse Source

Refactor: simplify semantic tag handling and remove redundant artifact backgrounds in layers

Marcin Ziąbek 3 months ago
parent
commit
257686f92d

+ 1 - 1
Source/QuestPDF/Drawing/DocumentGenerator.cs

@@ -566,7 +566,7 @@ namespace QuestPDF.Drawing
 
 
             static IEnumerable<SkPdfTag> GetSkiaTagFor(Element element)
             static IEnumerable<SkPdfTag> GetSkiaTagFor(Element element)
             {
             {
-                if (element is SemanticTag semanticTag && semanticTag.Id > 0)
+                if (element is SemanticTag { Id: > 0 } semanticTag)
                 {
                 {
                     var result = SkPdfTag.Create(semanticTag.Id, semanticTag.TagType, semanticTag.Alt, semanticTag.Lang);
                     var result = SkPdfTag.Create(semanticTag.Id, semanticTag.TagType, semanticTag.Alt, semanticTag.Lang);
                     result.SetChildren(GetSkiaTagFor(semanticTag.Child).ToArray());
                     result.SetChildren(GetSkiaTagFor(semanticTag.Child).ToArray());

+ 0 - 3
Source/QuestPDF/Elements/Page.cs

@@ -37,12 +37,10 @@ namespace QuestPDF.Elements
                 {
                 {
                     layers.Layer()
                     layers.Layer()
                         .ZIndex(int.MinValue)
                         .ZIndex(int.MinValue)
-                        .ArtifactBackground()
                         .Background(BackgroundColor);
                         .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);
@@ -85,7 +83,6 @@ namespace QuestPDF.Elements
                     
                     
                     layers
                     layers
                         .Layer()
                         .Layer()
-                        .ArtifactPaginationWatermark()
                         .Repeat()
                         .Repeat()
                         .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Foreground.ToString())
                         .DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Foreground.ToString())
                         .Element(Foreground);
                         .Element(Foreground);