Author: tilman
Date: Wed Sep 23 04:25:58 2026
New Revision: 1938447
Log:
PDFBOX-3293: remove trailing spaces to lessen actual commit
Modified:
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
Modified:
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
==============================================================================
---
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Wed Sep 23 04:20:06 2026 (r1938446)
+++
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Wed Sep 23 04:25:58 2026 (r1938447)
@@ -95,7 +95,7 @@ import org.apache.pdfbox.text.PDFTextStr
/**
* Display the page number and a page rendering.
- *
+ *
* @author Tilman Hausherr
* @author John Hewson
*/
@@ -305,7 +305,7 @@ public class PagePane implements ActionL
pageLabel.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 20));
pageLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
panel.add(pageLabel);
-
+
label = new JLabel();
label.addMouseMotionListener(this);
label.addMouseListener(this);
@@ -402,7 +402,7 @@ public class PagePane implements ActionL
{
zoomMenu.addMenuListeners(this);
zoomMenu.setEnableMenu(true);
-
+
rotationMenu = RotationMenu.getInstance();
rotationMenu.addMenuListeners(this);
rotationMenu.setEnableMenu(true);
@@ -419,7 +419,7 @@ public class PagePane implements ActionL
JMenu menuInstance = viewMenu.getMenu();
int itemCount = menuInstance.getItemCount();
-
+
for (int i = 0; i< itemCount; i++)
{
JMenuItem item = menuInstance.getItem(i);
@@ -442,7 +442,7 @@ public class PagePane implements ActionL
JMenu menuInstance = viewMenu.getMenu();
int itemCount = menuInstance.getItemCount();
-
+
for (int i = 0; i< itemCount; i++)
{
JMenuItem item = menuInstance.getItem(i);
@@ -722,13 +722,13 @@ public class PagePane implements ActionL
statuslabel.setText(labelText);
// debug overlays
- DebugTextOverlay debugText = new DebugTextOverlay(document,
pageIndex, scale,
+ DebugTextOverlay debugText = new DebugTextOverlay(document,
pageIndex, scale,
showTextStripper, showTextStripperBeads,
showFontBBox,
ViewMenu.isShowGlyphBounds());
Graphics2D g = image.createGraphics();
debugText.renderTo(g);
g.dispose();
-
+
return ImageUtil.getRotatedImage(image, rotation);
}
@@ -739,12 +739,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/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
==============================================================================
---
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Wed Sep 23 04:20:06 2026 (r1938446)
+++
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Wed Sep 23 04:25:58 2026 (r1938447)
@@ -134,15 +134,15 @@ 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;
private float xformScalingFactorX;
private float xformScalingFactorY;
-
+
// the page box to draw (usually the crop box but may be another)
private PDRectangle pageSize;
@@ -153,13 +153,13 @@ public class PageDrawer extends PDFGraph
// clipping winding rule used for the clipping path
private int clipWindingRule = -1;
private GeneralPath linePath = new GeneralPath();
-
+
// last clipping path
private List<Path2D> lastClips;
// clip when drawPage() is called, can be null, must be intersected when
clipping
private Shape initialClip;
-
+
// shapes of glyphs being drawn to be used for clipping
private List<Shape> textClippings;
@@ -167,7 +167,7 @@ public class PageDrawer extends PDFGraph
private final Map<PDFont, GlyphCache> glyphCaches = new HashMap<>();
private final TilingPaintFactory tilingPaintFactory = new
TilingPaintFactory(this);
-
+
private final Deque<TransparencyGroup> transparencyGroupStack = new
ArrayDeque<>();
// if greater zero the content is hidden and will not be rendered
@@ -203,7 +203,7 @@ public class PageDrawer extends PDFGraph
/**
* Return the AnnotationFilter.
- *
+ *
* @return the AnnotationFilter
*/
public AnnotationFilter getAnnotationFilter()
@@ -213,19 +213,19 @@ 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.
- *
+ *
* @return the parent renderer
*/
public final PDFRenderer getRenderer()
@@ -235,7 +235,7 @@ public class PageDrawer extends PDFGraph
/**
* Returns the underlying Graphics2D. May be null if drawPage has not yet
been called.
- *
+ *
* @return the underlying Graphics2D
*/
protected final Graphics2D getGraphics()
@@ -245,7 +245,7 @@ public class PageDrawer extends PDFGraph
/**
* Returns the current line path. This is reset to empty after each
fill/stroke.
- *
+ *
* @return the current line path
*/
protected final GeneralPath getLinePath()
@@ -263,7 +263,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.
@@ -321,13 +321,13 @@ public class PageDrawer extends PDFGraph
lastClips = null;
Shape savedInitialClip = initialClip;
initialClip = null;
-
+
boolean savedFlipTG = flipTG;
flipTG = true;
setRenderingHints();
processTilingPattern(pattern, color, colorSpace, patternMatrix);
-
+
flipTG = savedFlipTG;
graphics = savedGraphics;
linePath = savedLinePath;
@@ -338,15 +338,15 @@ 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.
* @return an AWT paint for the given PDColor
- *
+ *
* @throws IOException if the AWT paint could not be created
*/
protected Paint getPaint(PDColor color) throws IOException
@@ -385,7 +385,7 @@ public class PageDrawer extends PDFGraph
else
{
// uncolored tiling pattern
- return tilingPaintFactory.create(tilingPattern,
+ return tilingPaintFactory.create(tilingPattern,
patternSpace.getUnderlyingColorSpace(), color,
xform);
}
}
@@ -461,7 +461,7 @@ public class PageDrawer extends PDFGraph
{
endTextClip();
}
-
+
/**
* Begin buffering the text clipping path, if any.
*/
@@ -478,7 +478,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())
{
@@ -489,7 +489,7 @@ public class PageDrawer extends PDFGraph
state.intersectClippingPath(path);
textClippings = new ArrayList<>();
- // 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;
}
@@ -517,7 +517,7 @@ public class PageDrawer extends PDFGraph
/**
* Renders a glyph.
- *
+ *
* @param path the GeneralPath for the glyph
* @param font the font
* @param code character code
@@ -626,7 +626,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)
@@ -664,7 +664,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());
@@ -853,7 +853,7 @@ public class PageDrawer extends PDFGraph
graphics.setPaint(getNonStrokingPaint());
graphics.fill(shape);
}
-
+
linePath.reset();
if (noAntiAlias)
@@ -975,7 +975,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;
@@ -1018,7 +1018,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
@@ -1030,7 +1030,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)
{
@@ -1127,10 +1127,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().
@@ -1513,7 +1513,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());
@@ -1582,7 +1582,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;
@@ -1842,7 +1842,7 @@ public class PageDrawer extends PDFGraph
/**
* For advanced users, to extract the transparency group into a separate
graphics device.
- *
+ *
* @param form the transparency group to be extracted
* @param graphics the target graphics device
* @throws IOException if the transparency group could not be extracted
@@ -1946,7 +1946,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;
@@ -2051,8 +2051,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);
@@ -2105,7 +2105,7 @@ public class PageDrawer extends PDFGraph
((GroupGraphics) graphics).removeBackdrop(backdropImage,
backdropX, backdropY);
}
}
- finally
+ finally
{
flipTG = savedFlipTG;
lastClips = savedLastClips;
@@ -2120,7 +2120,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 = {1, 0};
@@ -2341,7 +2341,7 @@ public class PageDrawer extends PDFGraph
List<Boolean> visibles = new ArrayList<>(oCGs.size());
oCGs.forEach(prop -> visibles.add(!isHiddenOCG(prop)));
COSName visibilityPolicy = ocmd.getVisibilityPolicy();
-
+
// visible if any of the entries in OCGs are OFF
if (COSName.ANY_OFF.equals(visibilityPolicy))
{
Modified:
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
==============================================================================
---
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
Wed Sep 23 04:20:06 2026 (r1938446)
+++
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawerParameters.java
Wed Sep 23 04:25:58 2026 (r1938447)
@@ -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;
@@ -54,17 +54,17 @@ public final class PageDrawerParameters
/**
* Returns the page.
- *
+ *
* @return the page
*/
public PDPage getPage()
{
return page;
}
-
+
/**
* Returns the renderer.
- *
+ *
* @return the renderer
*/
PDFRenderer getRenderer()
@@ -74,7 +74,7 @@ public final class PageDrawerParameters
/**
* Returns whether to allow subsampling of images.
- *
+ *
* @return true if subsampling of images os allowed
*/
public boolean isSubsamplingAllowed()
@@ -99,7 +99,7 @@ public final class PageDrawerParameters
}
/**
- *
+ *
* @return the imageDownscalingOptimizationThreshold
*/