Author: tilman
Date: Wed Aug 27 18:52:34 2025
New Revision: 1928052
Log:
PDFBOX-5660: optimize, as suggested by Valery Bokov; closes #225
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
Wed Aug 27 18:52:30 2025 (r1928051)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
Wed Aug 27 18:52:34 2025 (r1928052)
@@ -286,17 +286,18 @@ public abstract class PDFStreamEngine
PDResources parent = pushResources(charProc);
Deque<PDGraphicsState> savedStack = saveGraphicsStack();
+ PDGraphicsState graphicsState = getGraphicsState();
// replace the CTM with the TRM
- getGraphicsState().setCurrentTransformationMatrix(textRenderingMatrix);
+ graphicsState.setCurrentTransformationMatrix(textRenderingMatrix);
// transform the CTM using the stream's matrix (this is the FontMatrix)
textRenderingMatrix.concatenate(charProc.getMatrix());
// note: we don't clip to the BBox as it is often wrong, see
PDFBOX-1917
- getGraphicsState().setTextMatrix(new Matrix());
- getGraphicsState().setTextLineMatrix(new Matrix());
+ graphicsState.setTextMatrix(new Matrix());
+ graphicsState.setTextLineMatrix(new Matrix());
try
{