Skip to content

Commit 414a0e4

Browse files
committed
Move linkAnnotation inside Block-elements kids list in tag hierarchy
DEVSIX-1229
1 parent 9426ea0 commit 414a0e4

File tree

2 files changed

+4
-35
lines changed

2 files changed

+4
-35
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/BlockRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ public void draw(DrawContext drawContext) {
468468
logger.error(LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
469469
return;
470470
}
471-
applyDestinationsAndAnnotation(drawContext);
472471

473472
PdfDocument document = drawContext.getDocument();
474473
boolean isTagged = drawContext.isTaggingEnabled() && getModelElement() instanceof IAccessibleElement;
@@ -500,6 +499,8 @@ public void draw(DrawContext drawContext) {
500499
}
501500
}
502501

502+
applyDestinationsAndAnnotation(drawContext);
503+
503504
boolean isRelativePosition = isRelativePosition();
504505
if (isRelativePosition) {
505506
applyRelativePositioningTranslation(false);

layout/src/main/java/com/itextpdf/layout/renderer/TableRenderer.java

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,6 @@ public LayoutResult layout(LayoutContext layoutContext) {
890890
*/
891891
@Override
892892
public void draw(DrawContext drawContext) {
893-
applyDestinationsAndAnnotation(drawContext);
894893
PdfDocument document = drawContext.getDocument();
895894
boolean isTagged = drawContext.isTaggingEnabled() && getModelElement() instanceof IAccessibleElement;
896895
boolean ignoreTag = false;
@@ -915,47 +914,16 @@ public void draw(DrawContext drawContext) {
915914
applyGeneratedAccessibleAttributes(tagPointer, layoutAttributes);
916915
}
917916

918-
boolean relativePosition = isRelativePosition();
919-
if (relativePosition) {
920-
applyRelativePositioningTranslation(false);
921-
}
922-
923-
beginElementOpacityApplying(drawContext);
924-
drawBackground(drawContext);
925-
drawBorder(drawContext);
926-
drawChildren(drawContext);
927-
drawPositionedChildren(drawContext);
928-
endElementOpacityApplying(drawContext);
929-
930-
if (relativePosition) {
931-
applyRelativePositioningTranslation(true);
932-
}
917+
super.draw(drawContext);
933918

934919
tagPointer.moveToParent();
935920

936921
boolean toRemoveConnectionsWithTag = isLastRendererForModelElement && ((Table) getModelElement()).isComplete();
937922
if (toRemoveConnectionsWithTag) {
938923
tagPointer.removeElementConnectionToTag(accessibleElement);
939924
}
940-
flushed = true;
941925
} else {
942-
boolean relativePosition = isRelativePosition();
943-
if (relativePosition) {
944-
applyRelativePositioningTranslation(false);
945-
}
946-
947-
beginElementOpacityApplying(drawContext);
948-
drawBackground(drawContext);
949-
drawBorder(drawContext);
950-
drawChildren(drawContext);
951-
drawPositionedChildren(drawContext);
952-
endElementOpacityApplying(drawContext);
953-
954-
if (relativePosition) {
955-
applyRelativePositioningTranslation(true);
956-
}
957-
958-
flushed = true;
926+
super.draw(drawContext);
959927
}
960928
}
961929

0 commit comments

Comments
 (0)