Author: tilman
Date: Wed Sep 23 04:26:02 2026
New Revision: 1938448
Log:
PDFBOX-3293: remove trailing spaces to lessen actual commit
Modified:
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
Modified:
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
==============================================================================
---
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Wed Sep 23 04:25:58 2026 (r1938447)
+++
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Wed Sep 23 04:26:02 2026 (r1938448)
@@ -84,7 +84,7 @@ import org.apache.pdfbox.pdmodel.interac
/**
* Display the page number and a page rendering.
- *
+ *
* @author Tilman Hausherr
* @author John Hewson
*/
@@ -293,7 +293,7 @@ public class PagePane implements ActionL
pageLabel.setFont(new Font(Font.MONOSPACED, Font.BOLD, 30));
pageLabel.setBackground(Color.GREEN);
panel.add(pageLabel);
-
+
label = new JLabel();
label.addMouseMotionListener(this);
label.addMouseListener(this);
@@ -356,7 +356,7 @@ public class PagePane implements ActionL
{
zoomMenu.addMenuListeners(this);
zoomMenu.setEnableMenu(true);
-
+
rotationMenu = RotationMenu.getInstance();
rotationMenu.addMenuListeners(this);
rotationMenu.setEnableMenu(true);
@@ -368,7 +368,7 @@ public class PagePane implements ActionL
renderDestinationMenu = RenderDestinationMenu.getInstance();
renderDestinationMenu.addMenuListeners(this);
renderDestinationMenu.setEnableMenu(true);
-
+
PDFDebugger.allowSubsampling.addActionListener(this);
PDFDebugger.repairAcroFormMenuItem.setEnabled(true);
@@ -649,12 +649,12 @@ public class PagePane implements ActionL
{
BufferedImage image = get();
- // We cannot use "label.setIcon(new ImageIcon(get()))" here
- // because of blurry upscaling in JDK9. Instead, the label is
now created with
+ // We cannot use "label.setIcon(new ImageIcon(get()))" here
+ // because of blurry upscaling in JDK9. Instead, the label is
now created with
// a smaller size than the image to compensate that the
// image is scaled up with some screen configurations (e.g.
125% on windows).
// See PDFBOX-3665 for more sample code and discussion.
- label.setSize((int) Math.ceil(image.getWidth() /
defaultTransform.getScaleX()),
+ label.setSize((int) Math.ceil(image.getWidth() /
defaultTransform.getScaleX()),
(int) Math.ceil(image.getHeight() /
defaultTransform.getScaleY()));
label.setIcon(new HighResolutionImageIcon(image,
label.getWidth(), label.getHeight()));
label.setText(null);
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Wed Sep 23 04:25:58 2026 (r1938447)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Wed Sep 23 04:26:02 2026 (r1938448)
@@ -139,9 +139,9 @@ public class PageDrawer extends PDFGraph
// parent document renderer - note: this is needed for not-yet-implemented
resource caching
private final PDFRenderer renderer;
-
+
private final boolean subsamplingAllowed;
-
+
// the graphics device to draw to, xform is the initial transform of the
device (i.e. DPI)
private Graphics2D graphics;
private AffineTransform xform;
@@ -170,11 +170,11 @@ public class PageDrawer extends PDFGraph
// glyph cache
private final Map<PDFont, Glyph2D> fontGlyph2D = new HashMap<PDFont,
Glyph2D>();
-
+
private final TilingPaintFactory tilingPaintFactory = new
TilingPaintFactory(this);
-
+
private final Deque<TransparencyGroup> transparencyGroupStack = new
ArrayDeque<TransparencyGroup>();
-
+
// if greater zero the content is hidden and will not be rendered
private int nestedHiddenOCGCount;
@@ -215,7 +215,7 @@ public class PageDrawer extends PDFGraph
/**
* Return the AnnotationFilter.
- *
+ *
* @return the AnnotationFilter
*/
public AnnotationFilter getAnnotationFilter()
@@ -225,16 +225,16 @@ public class PageDrawer extends PDFGraph
/**
* Set the AnnotationFilter.
- *
+ *
* <p>Allows to only render annotation accepted by the filter.
- *
+ *
* @param annotationFilter the AnnotationFilter
*/
public void setAnnotationFilter(AnnotationFilter annotationFilter)
{
this.annotationFilter = annotationFilter;
}
-
+
/**
* Returns the parent renderer.
*/
@@ -269,7 +269,7 @@ public class PageDrawer extends PDFGraph
/**
* Draws the page to the requested context.
- *
+ *
* @param g The graphics context to draw onto.
* @param pageSize The size of the page to draw.
* @throws IOException If there is an IO error while drawing the page.
@@ -344,12 +344,12 @@ public class PageDrawer extends PDFGraph
private float clampColor(float color)
{
- return color < 0 ? 0 : (color > 1 ? 1 : color);
+ return color < 0 ? 0 : (color > 1 ? 1 : color);
}
/**
* Returns an AWT paint for the given PDColor.
- *
+ *
* @param color The color to get a paint for. This can be an actual color
or a pattern.
* @throws IOException
*/
@@ -389,7 +389,7 @@ public class PageDrawer extends PDFGraph
else
{
// uncolored tiling pattern
- return tilingPaintFactory.create(tilingPattern,
+ return tilingPaintFactory.create(tilingPattern,
patternSpace.getUnderlyingColorSpace(), color,
xform);
}
}
@@ -465,7 +465,7 @@ public class PageDrawer extends PDFGraph
{
endTextClip();
}
-
+
/**
* Begin buffering the text clipping path, if any.
*/
@@ -482,7 +482,7 @@ public class PageDrawer extends PDFGraph
{
PDGraphicsState state = getGraphicsState();
RenderingMode renderingMode = state.getTextState().getRenderingMode();
-
+
// apply the buffered clip as one area
if (renderingMode.isClip() && !textClippings.isEmpty())
{
@@ -496,7 +496,7 @@ public class PageDrawer extends PDFGraph
state.intersectClippingPath(path);
textClippings = new ArrayList<Shape>();
- // PDFBOX-3681: lastClip needs to be reset, because after
intersection it is still the same
+ // PDFBOX-3681: lastClip needs to be reset, because after
intersection it is still the same
// object, thus setClip() would believe that it is cached.
lastClips = null;
}
@@ -523,7 +523,7 @@ public class PageDrawer extends PDFGraph
/**
* Render the font using the Glyph2D interface.
- *
+ *
* @param glyph2D the Glyph2D implementation provided a GeneralPath for
each glyph
* @param font the font
* @param code character code
@@ -599,7 +599,7 @@ public class PageDrawer extends PDFGraph
/**
* Provide a Glyph2D for the given font.
- *
+ *
* @param font the font
* @return the implementation of the Glyph2D interface for the given font
* @throws IOException if something went wrong
@@ -699,7 +699,7 @@ public class PageDrawer extends PDFGraph
}
}
}
- TransparencyGroup transparencyGroup = new TransparencyGroup(form,
true,
+ TransparencyGroup transparencyGroup = new TransparencyGroup(form, true,
softMask.getInitialTransformationMatrix(), backdropColor);
BufferedImage image = transparencyGroup.getImage();
if (image == null)
@@ -737,7 +737,7 @@ public class PageDrawer extends PDFGraph
Rectangle originalBounds = new Rectangle(gray.getWidth(),
gray.getHeight());
Rectangle2D transformedBounds =
at.createTransformedShape(originalBounds).getBounds2D();
-
at.preConcatenate(AffineTransform.getTranslateInstance(-transformedBounds.getMinX(),
+
at.preConcatenate(AffineTransform.getTranslateInstance(-transformedBounds.getMinX(),
-transformedBounds.getMinY()));
int width = (int) Math.ceil(transformedBounds.getWidth());
@@ -933,7 +933,7 @@ public class PageDrawer extends PDFGraph
graphics.setPaint(getNonStrokingPaint());
graphics.fill(shape);
}
-
+
linePath.reset();
if (noAntiAlias)
@@ -1055,7 +1055,7 @@ public class PageDrawer extends PDFGraph
getGraphicsState().intersectClippingPath(adjustClip(linePath));
}
- // PDFBOX-3836: lastClip needs to be reset, because after
intersection it is still the same
+ // PDFBOX-3836: lastClip needs to be reset, because after
intersection it is still the same
// object, thus setClip() would believe that it is cached.
lastClips = null;
@@ -1098,7 +1098,7 @@ public class PageDrawer extends PDFGraph
{
linePath.reset();
}
-
+
/**
* PDFBOX-5715 / PR#73: This was added to fix a problem with missing fine
lines when printing
* on MacOS. Lines vanish because CPrinterJob sets graphics scale to 1 for
Printable so after
@@ -1110,7 +1110,7 @@ public class PageDrawer extends PDFGraph
* <a href="https://github.com/apache/pdfbox/pull/173">here</a>.
*
* @param linePath
- * @return
+ * @return
*/
private GeneralPath adjustClip(GeneralPath linePath)
{
@@ -1208,10 +1208,10 @@ public class PageDrawer extends PDFGraph
{
// The earlier code for stencils (see "else") doesn't work
with patterns because the
// CTM is not taken into consideration.
- // this code is based on the fact that it is easily possible
to draw the mask and
+ // this code is based on the fact that it is easily possible
to draw the mask and
// the paint at the correct place with the existing code, but
not in one step.
// Thus what we do is to draw both in separate images, then
combine the two and draw
- // the result.
+ // the result.
// Note that the device scale is not used. In theory, some
patterns can get better
// at higher resolutions but the stencil would become more and
more "blocky".
// If anybody wants to do this, have a look at the code in
showTransparencyGroup().
@@ -1594,7 +1594,7 @@ public class PageDrawer extends PDFGraph
// will trigger the workaround. Because of the slowness we only do
it if the user
// expects quality rendering and interpolation.
Matrix imageTransformMatrix = new Matrix(imageTransform);
- Matrix graphicsTransformMatrix = new Matrix(originalTransform);
+ Matrix graphicsTransformMatrix = new Matrix(originalTransform);
float scaleX = Math.abs(imageTransformMatrix.getScalingFactorX() *
graphicsTransformMatrix.getScalingFactorX());
float scaleY = Math.abs(imageTransformMatrix.getScalingFactorY() *
graphicsTransformMatrix.getScalingFactorY());
@@ -1663,7 +1663,7 @@ public class PageDrawer extends PDFGraph
bim = new BufferedImage(imageWidth, imageHeight,
BufferedImage.TYPE_INT_RGB);
}
- // prepare transfer functions (either one per color or one for all)
+ // prepare transfer functions (either one per color or one for all)
// and maps (actually arrays[256] to be faster) to avoid calculating
values several times
Integer[] rMap;
Integer[] gMap;
@@ -1924,10 +1924,10 @@ public class PageDrawer extends PDFGraph
/**
* For advanced users, to extract the transparency group into a separate
graphics device.
- *
+ *
* @param form
* @param graphics
- * @throws IOException
+ * @throws IOException
*/
protected void showTransparencyGroupOnGraphics(PDTransparencyGroup form,
Graphics2D graphics)
throws IOException
@@ -2028,7 +2028,7 @@ public class PageDrawer extends PDFGraph
* masks.
* @throws IOException
*/
- private TransparencyGroup(PDTransparencyGroup form, boolean
isSoftMask, Matrix ctm,
+ private TransparencyGroup(PDTransparencyGroup form, boolean
isSoftMask, Matrix ctm,
PDColor backdropColor) throws IOException
{
Graphics2D savedGraphics = graphics;
@@ -2133,8 +2133,8 @@ public class PageDrawer extends PDFGraph
}
if (isSoftMask && backdropColor != null)
{
- // "If the subtype is Luminosity, the transparency group
XObject G shall be
- // composited with a fully opaque backdrop whose colour is
everywhere defined
+ // "If the subtype is Luminosity, the transparency group
XObject G shall be
+ // composited with a fully opaque backdrop whose colour is
everywhere defined
// by the soft-mask dictionary's BC entry."
g.setBackground(new Color(backdropColor.toRGB()));
g.clearRect(0, 0, width, height);
@@ -2187,7 +2187,7 @@ public class PageDrawer extends PDFGraph
((GroupGraphics) graphics).removeBackdrop(backdropImage,
backdropX, backdropY);
}
}
- finally
+ finally
{
flipTG = savedFlipTG;
lastClips = savedLastClips;
@@ -2202,7 +2202,7 @@ public class PageDrawer extends PDFGraph
}
// http://stackoverflow.com/a/21181943/535646
- private BufferedImage create2ByteGrayAlphaImage(int width, int height)
+ private BufferedImage create2ByteGrayAlphaImage(int width, int height)
{
// gray + alpha
int[] bandOffsets = new int[] {1, 0};
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
Wed Sep 23 04:25:58 2026 (r1938447)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
Wed Sep 23 04:26:02 2026 (r1938448)
@@ -25,7 +25,7 @@ import org.apache.pdfbox.pdmodel.PDPage;
* Parameters for a PageDrawer. This class ensures allows PDFRenderer and
PageDrawer to share
* private implementation data in a future-proof manner, while still allowing
end-users to create
* their own subclasses of PageDrawer.
- *
+ *
* @author John Hewson
*/
public final class PageDrawerParameters
@@ -33,7 +33,7 @@ public final class PageDrawerParameters
private final PDFRenderer renderer;
private final PDPage page;
private final boolean subsamplingAllowed;
- private final RenderDestination destination;
+ private final RenderDestination destination;
private final RenderingHints renderingHints;
private final float imageDownscalingOptimizationThreshold;
@@ -59,7 +59,7 @@ public final class PageDrawerParameters
{
return page;
}
-
+
/**
* Returns the renderer.
*/
@@ -93,7 +93,7 @@ public final class PageDrawerParameters
}
/**
- *
+ *
* @return the imageDownscalingOptimizationThreshold
*/