Skip to content

Commit

Permalink
GH-314 make adjustments for Tm reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Corless committed Feb 10, 2024
1 parent 3430caa commit d709980
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ public void setLastTokenPosition(int position, Integer token) throws IOException
(position - lastTokenPosition));
lastTokenPosition = position;
} else if (token == T_STAR || token == TD || token == Td) {
// relative operators, so adjust for the redacted content.
writeLastTjOffset();
lastTjOffset = 0;
burnedContentOutputStream.write(originalContentStreamBytes, lastTokenPosition,
(position - lastTokenPosition));
lastTokenPosition = position;
} else if (token == BT) {
} else if (token == BT || token == Tm) {
// hard reset, new coordinate system
lastTjOffset = 0;
}
lastTextPosition = position;
Expand All @@ -137,7 +139,7 @@ private void writeLastTjOffset() throws IOException {
}

private boolean isTextLayoutToken(int token) {
return token == Tj || token == TJ || token == Td || token == TD || token == T_STAR || token == BT;
return token == Tj || token == TJ || token == Td || token == TD || token == Tm || token == T_STAR || token == BT;
}

/**
Expand Down

0 comments on commit d709980

Please sign in to comment.