proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/IntPoint.java | IntPoint | equals | class IntPoint extends Point
{
private static final Logger LOG = LogManager.getLogger(IntPoint.class);
IntPoint(int x, int y)
{
super(x, y);
}
@Override
public int hashCode()
{
return 89 * (623 + this.x) + this.y;
}
@Override
public boolean equals(Object obj)
... |
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
if (obj instanceof Point2D)
{
// hitting this branch means that the warning on top of ... | 124 | 151 | 275 | <methods>public void <init>() ,public void <init>(java.awt.Point) ,public void <init>(int, int) ,public boolean equals(java.lang.Object) ,public java.awt.Point getLocation() ,public double getX() ,public double getY() ,public void move(int, int) ,public void setLocation(java.awt.Point) ,public void setLocation(int, int... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Line.java | Line | calcLine | class Line
{
private final Point point0;
private final Point point1;
private final float[] color0;
private final float[] color1;
protected final Set<Point> linePoints; // all the points in this rasterized line
/**
* Constructor of class Line.
*
* @param p0 one end of a line
... |
Set<Point> points = new HashSet<>(3);
int dx = Math.abs(x1 - x0);
int dy = Math.abs(y1 - y0);
int sx = x0 < x1 ? 1 : -1;
int sy = y0 < y1 ? 1 : -1;
int err = dx - dy;
while (true)
{
points.add(new IntPoint(x0, y0));
if (x0 == x1 &&... | 752 | 220 | 972 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType1.java | PDShadingType1 | setMatrix | class PDShadingType1 extends PDShading
{
private COSArray domain = null;
/**
* Constructor using the given shading dictionary.
*
* @param shadingDictionary the dictionary for this shading
*/
public PDShadingType1(COSDictionary shadingDictionary)
{
super(shadingDictionary);
... |
COSArray matrix = new COSArray();
double[] values = new double[6];
transform.getMatrix(values);
for (double v : values)
{
matrix.add(new COSFloat((float) v));
}
getCOSObject().setItem(COSName.MATRIX, matrix);
| 474 | 86 | 560 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public static org.apache.pdfbox.pdmodel.graphics.shading.PDShading create(org.apache.pdfbox.cos.COSDictionary) throws java.io.IOException,public float[] evalFunction(float) throws java.io.IOException,public float[] evalFunction(floa... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType2.java | PDShadingType2 | getDomain | class PDShadingType2 extends PDShading
{
private COSArray coords = null;
private COSArray domain = null;
private COSArray extend = null;
/**
* Constructor using the given shading dictionary.
*
* @param shadingDictionary the dictionary for this shading
*/
public PDShadingType2(CO... |
if (domain == null)
{
domain = getCOSObject().getCOSArray(COSName.DOMAIN);
}
return domain;
| 681 | 43 | 724 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public static org.apache.pdfbox.pdmodel.graphics.shading.PDShading create(org.apache.pdfbox.cos.COSDictionary) throws java.io.IOException,public float[] evalFunction(float) throws java.io.IOException,public float[] evalFunction(floa... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType4.java | PDShadingType4 | collectTriangles | class PDShadingType4 extends PDTriangleBasedShadingType
{
private static final Logger LOG = LogManager.getLogger(PDShadingType4.class);
/**
* Constructor using the given shading dictionary.
*
* @param shadingDictionary the dictionary for this shading
*/
public PDShadingType4(CO... |
int bitsPerFlag = getBitsPerFlag();
COSDictionary dict = getCOSObject();
if (!(dict instanceof COSStream))
{
return Collections.emptyList();
}
PDRange rangeX = getDecodeForParameter(0);
PDRange rangeY = getDecodeForParameter(1);
if (rangeX ... | 473 | 1,256 | 1,729 | <methods>public int getBitsPerComponent() ,public int getBitsPerCoordinate() ,public java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform, org.apache.pdfbox.util.Matrix) throws java.io.IOException,public org.apache.pdfbox.pdmodel.common.PDRange getDecodeForParameter(int) ,public int getNumberOfColorCompone... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType5.java | PDShadingType5 | collectTriangles | class PDShadingType5 extends PDTriangleBasedShadingType
{
/**
* Constructor using the given shading dictionary.
*
* @param shadingDictionary the dictionary for this shading
*/
public PDShadingType5(COSDictionary shadingDictionary)
{
super(shadingDictionary);
}
... |
COSDictionary dict = getCOSObject();
if (!(dict instanceof COSStream))
{
return Collections.emptyList();
}
PDRange rangeX = getDecodeForParameter(0);
PDRange rangeY = getDecodeForParameter(1);
if (rangeX == null || rangeY == null ||
... | 897 | 703 | 1,600 | <methods>public int getBitsPerComponent() ,public int getBitsPerCoordinate() ,public java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform, org.apache.pdfbox.util.Matrix) throws java.io.IOException,public org.apache.pdfbox.pdmodel.common.PDRange getDecodeForParameter(int) ,public int getNumberOfColorCompone... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java | PatchMeshesShadingContext | calcPixelTable | class PatchMeshesShadingContext extends TriangleBasedShadingContext
{
/**
* patch list
*/
private List<Patch> patchList;
/**
* Constructor creates an instance to be used for fill operations.
*
* @param shading the shading type to be used
* @param colorModel the color model... |
Map<Point, Integer> map = new HashMap<>();
for (Patch it : patchList)
{
super.calcPixelTable(it.listOfTriangles, map, deviceBounds);
}
return map;
| 382 | 62 | 444 | <methods>public final java.awt.image.Raster getRaster(int, int, int, int) <variables>private Map<java.awt.Point,java.lang.Integer> pixelTable |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingPaint.java | RadialShadingPaint | createContext | class RadialShadingPaint extends ShadingPaint<PDShadingType3>
{
private static final Logger LOG = LogManager.getLogger(RadialShadingPaint.class);
/**
* Constructor.
*
* @param shading the shading resources
* @param matrix the pattern matrix concatenated with that of the parent conte... |
try
{
return new RadialShadingContext(shading, cm, xform, matrix, deviceBounds);
}
catch (IOException e)
{
LOG.error("An error occurred while painting", e);
return new Color(0, 0, 0, 0).createContext(cm, deviceBounds, userBounds, xform... | 240 | 105 | 345 | <methods>public org.apache.pdfbox.util.Matrix getMatrix() ,public org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType3 getShading() <variables>protected final non-sealed org.apache.pdfbox.util.Matrix matrix,protected final non-sealed org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType3 shading |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/ShadingContext.java | ShadingContext | convertToRGB | class ShadingContext implements PaintContext
{
private float[] background;
private int rgbBackground;
private final PDShading shading;
private ColorModel outputColorModel;
private PDColorSpace shadingColorSpace;
/**
* Constructor.
*
* @param shading the shading type to be used
... |
int normRGBValues;
float[] rgbValues = shadingColorSpace.toRGB(values);
normRGBValues = (int) (rgbValues[0] * 255);
normRGBValues |= (int) (rgbValues[1] * 255) << 8;
normRGBValues |= (int) (rgbValues[2] * 255) << 16;
return normRGBValues;
| 614 | 116 | 730 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/TriangleBasedShadingContext.java | TriangleBasedShadingContext | calcPixelTable | class TriangleBasedShadingContext extends ShadingContext
{
// map of pixels within triangles to their RGB color
private Map<Point, Integer> pixelTable;
/**
* Constructor.
*
* @param shading the shading type to be used
* @param cm the color model to be used
* @param xform transforma... |
for (ShadedTriangle tri : triangleList)
{
int degree = tri.getDeg();
if (degree == 2)
{
Line line = tri.getLine();
for (Point p : line.linePoints)
{
map.put(p, evalFunctionAndConvertToRGB(line.calcCo... | 882 | 733 | 1,615 | <methods>public void <init>(org.apache.pdfbox.pdmodel.graphics.shading.PDShading, java.awt.image.ColorModel, java.awt.geom.AffineTransform, org.apache.pdfbox.util.Matrix) throws java.io.IOException,public void dispose() ,public java.awt.image.ColorModel getColorModel() <variables>private float[] background,private java... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type1ShadingContext.java | Type1ShadingContext | getRaster | class Type1ShadingContext extends ShadingContext
{
private static final Logger LOG = LogManager.getLogger(Type1ShadingContext.class);
private PDShadingType1 type1ShadingType;
private AffineTransform rat;
private final float[] domain;
/**
* Constructor creates an instance to be used for fill o... |
WritableRaster raster = getColorModel().createCompatibleWritableRaster(w, h);
int[] data = new int[w * h * 4];
float[] values = new float[2];
for (int j = 0; j < h; j++)
{
for (int i = 0; i < w; i++)
{
int index = (j * w + i) * 4;
... | 598 | 569 | 1,167 | <methods>public void <init>(org.apache.pdfbox.pdmodel.graphics.shading.PDShading, java.awt.image.ColorModel, java.awt.geom.AffineTransform, org.apache.pdfbox.util.Matrix) throws java.io.IOException,public void dispose() ,public java.awt.image.ColorModel getColorModel() <variables>private float[] background,private java... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type1ShadingPaint.java | Type1ShadingPaint | createContext | class Type1ShadingPaint extends ShadingPaint<PDShadingType1>
{
private static final Logger LOG = LogManager.getLogger(Type1ShadingPaint.class);
/**
* Constructor.
*
* @param shading the shading resources
* @param matrix the pattern matrix concatenated with that of the parent content stream
... |
try
{
return new Type1ShadingContext(shading, cm, xform, matrix);
}
catch (IOException e)
{
LOG.error("An error occurred while painting", e);
return new Color(0, 0, 0, 0).createContext(cm, deviceBounds, userBounds, xform, hints);
}
... | 215 | 92 | 307 | <methods>public org.apache.pdfbox.util.Matrix getMatrix() ,public org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType1 getShading() <variables>protected final non-sealed org.apache.pdfbox.util.Matrix matrix,protected final non-sealed org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType1 shading |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type4ShadingPaint.java | Type4ShadingPaint | createContext | class Type4ShadingPaint extends ShadingPaint<PDShadingType4>
{
private static final Logger LOG = LogManager.getLogger(Type4ShadingPaint.class);
/**
* Constructor.
*
* @param shading the shading resources
* @param matrix the pattern matrix concatenated with that of the parent content stream
... |
try
{
return new Type4ShadingContext(shading, cm, xform, matrix, deviceBounds);
}
catch (IOException e)
{
LOG.error("An error occurred while painting", e);
return new Color(0, 0, 0, 0).createContext(cm, deviceBounds, userBounds, xform, hints);... | 215 | 95 | 310 | <methods>public org.apache.pdfbox.util.Matrix getMatrix() ,public org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType4 getShading() <variables>protected final non-sealed org.apache.pdfbox.util.Matrix matrix,protected final non-sealed org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType4 shading |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingPaint.java | Type5ShadingPaint | createContext | class Type5ShadingPaint extends ShadingPaint<PDShadingType5>
{
private static final Logger LOG = LogManager.getLogger(Type5ShadingPaint.class);
/**
* Constructor.
*
* @param shading the shading resources
* @param matrix the pattern matrix concatenated with that of the parent content stream
... |
try
{
return new Type5ShadingContext(shading, cm, xform, matrix, deviceBounds);
}
catch (IOException e)
{
LOG.error("An error occurred while painting", e);
return new Color(0, 0, 0, 0).createContext(cm, deviceBounds, userBounds, xform, hints);... | 215 | 95 | 310 | <methods>public org.apache.pdfbox.util.Matrix getMatrix() ,public org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType5 getShading() <variables>protected final non-sealed org.apache.pdfbox.util.Matrix matrix,protected final non-sealed org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType5 shading |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type6ShadingPaint.java | Type6ShadingPaint | createContext | class Type6ShadingPaint extends ShadingPaint<PDShadingType6>
{
private static final Logger LOG = LogManager.getLogger(Type6ShadingPaint.class);
/**
* Constructor.
*
* @param shading the shading resources
* @param matrix the pattern matrix concatenated with that of the parent content stream
... |
try
{
return new Type6ShadingContext(shading, cm, xform, matrix, deviceBounds);
}
catch (IOException e)
{
LOG.error("An error occurred while painting", e);
return new Color(0, 0, 0, 0).createContext(cm, deviceBounds, userBounds, xform, hints);... | 215 | 95 | 310 | <methods>public org.apache.pdfbox.util.Matrix getMatrix() ,public org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType6 getShading() <variables>protected final non-sealed org.apache.pdfbox.util.Matrix matrix,protected final non-sealed org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType6 shading |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type7ShadingPaint.java | Type7ShadingPaint | createContext | class Type7ShadingPaint extends ShadingPaint<PDShadingType7>
{
private static final Logger LOG = LogManager.getLogger(Type7ShadingPaint.class);
/**
* Constructor.
*
* @param shading the shading resources
* @param matrix the pattern matrix concatenated with that of the parent content stream
... |
try
{
return new Type7ShadingContext(shading, cm, xform, matrix, deviceBounds);
}
catch (IOException e)
{
LOG.error("An error occurred while painting", e);
return new Color(0, 0, 0, 0).createContext(cm, deviceBounds, userBounds, xform, hints);... | 215 | 95 | 310 | <methods>public org.apache.pdfbox.util.Matrix getMatrix() ,public org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType7 getShading() <variables>protected final non-sealed org.apache.pdfbox.util.Matrix matrix,protected final non-sealed org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType7 shading |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Vertex.java | Vertex | toString | class Vertex
{
final Point2D point;
final float[] color;
Vertex(Point2D p, float[] c)
{
point = p;
color = c.clone();
}
@Override
public String toString()
{<FILL_FUNCTION_BODY>}
} |
StringBuilder sb = new StringBuilder();
for (float f : color)
{
if (sb.length() > 0)
{
sb.append(' ');
}
sb.append(String.format("%3.2f", f));
}
return "Vertex{ " + point + ", colors=[" + sb + "] }";
| 85 | 91 | 176 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDSoftMask.java | PDSoftMask | create | class PDSoftMask implements COSObjectable
{
/**
* Creates a new soft mask.
*
* @param dictionary SMask
*
* @return the newly created instance of PDSoftMask
*/
public static PDSoftMask create(COSBase dictionary)
{<FILL_FUNCTION_BODY>}
private static final Logge... |
if (dictionary instanceof COSName)
{
if (COSName.NONE.equals(dictionary))
{
return null;
}
else
{
LOG.warn("Invalid SMask {}", dictionary);
return null;
}
}
... | 1,056 | 156 | 1,212 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDTextState.java | PDTextState | clone | class PDTextState implements Cloneable
{
private float characterSpacing = 0;
private float wordSpacing = 0;
private float horizontalScaling = 100;
private float leading = 0;
private PDFont font;
private float fontSize;
private RenderingMode renderingMode = RenderingMode.FILL;
private flo... |
try
{
return (PDTextState)super.clone();
}
catch (CloneNotSupportedException e)
{
// should not happen
throw new RuntimeException(e);
}
| 1,156 | 57 | 1,213 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/PlainText.java | Paragraph | getLines | class Paragraph
{
private final String textContent;
Paragraph(String text)
{
textContent = text;
}
/**
* Get the paragraph text.
*
* @return the text.
*/
String getText()
{
return textContent;
... |
BreakIterator iterator = BreakIterator.getLineInstance();
iterator.setText(textContent);
final float scale = fontSize/FONTSCALE;
int start = iterator.first();
int end = iterator.next();
float lineWidth = 0;
List<Line> textLines = ne... | 203 | 645 | 848 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/PlainTextFormatter.java | Builder | processLines | class Builder
{
// required parameters
private final PDAppearanceContentStream contents;
// optional parameters
private AppearanceStyle appearanceStyle;
private boolean wrapLines = false;
private float width = 0f;
private PlainText textContent;
priva... |
float wordWidth;
float lastPos = 0f;
float startOffset = 0f;
float interWordSpacing = 0f;
for (Line line : lines)
{
switch (textAlignment)
{
case CENTER:
startOffset = (width - line.getWidth())/2;
... | 1,033 | 450 | 1,483 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDAction.java | PDAction | getNext | class PDAction implements PDDestinationOrAction
{
/**
* The type of PDF object.
*/
public static final String TYPE = "Action";
/**
* The action dictionary.
*/
protected final COSDictionary action;
/**
* Default constructor.
*/
public PDAction()
{
actio... |
List<PDAction> retval = null;
COSBase next = action.getDictionaryObject(COSName.NEXT);
if( next instanceof COSDictionary )
{
PDAction pdAction = PDActionFactory.createAction( (COSDictionary) next );
retval = new COSArrayList<>(pdAction, next, action, COSName.NEXT... | 738 | 221 | 959 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionEmbeddedGoTo.java | PDActionEmbeddedGoTo | setDestination | class PDActionEmbeddedGoTo extends PDAction
{
/**
* This type of action this object represents.
*/
public static final String SUB_TYPE = "GoToE";
/**
* Default constructor.
*/
public PDActionEmbeddedGoTo()
{
setSubType(SUB_TYPE);
}
/**
* Constructor.
*... |
if (d instanceof PDPageDestination)
{
PDPageDestination pageDest = (PDPageDestination) d;
COSArray destArray = pageDest.getCOSObject();
if (!destArray.isEmpty())
{
COSBase page = destArray.getObject(0);
if (!(page instanceo... | 1,094 | 143 | 1,237 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public List<org.apache.pdfbox.pdmodel.interactive.action.PDAction> getNext() ,public final java.lang.String getSubType() ,public final java.lang.String getType() ,public voi... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionFactory.java | PDActionFactory | createAction | class PDActionFactory
{
/**
* Utility Class.
*/
private PDActionFactory()
{
//utility class
}
/**
* This will create the correct type of action based on the type specified
* in the dictionary.
*
* @param action An action dictionary.
*
* @return An act... |
PDAction retval = null;
if( action != null)
{
String type = action.getNameAsString(COSName.S);
if (type != null)
{
switch (type)
{
case PDActionJavaScript.SUB_TYPE:
retval = new PDAct... | 131 | 524 | 655 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionGoTo.java | PDActionGoTo | setDestination | class PDActionGoTo extends PDAction
{
/**
* This type of action this object represents.
*/
public static final String SUB_TYPE = "GoTo";
/**
* Default constructor.
*/
public PDActionGoTo()
{
setSubType( SUB_TYPE );
}
/**
* Constructor.
*
* @param ... |
if (d instanceof PDPageDestination)
{
PDPageDestination pageDest = (PDPageDestination) d;
COSArray destArray = pageDest.getCOSObject();
if (!destArray.isEmpty())
{
COSBase page = destArray.getObject(0);
if (!(page instanceo... | 320 | 144 | 464 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public List<org.apache.pdfbox.pdmodel.interactive.action.PDAction> getNext() ,public final java.lang.String getSubType() ,public final java.lang.String getType() ,public voi... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionJavaScript.java | PDActionJavaScript | getAction | class PDActionJavaScript extends PDAction
{
/**
* This type of action this object represents.
*/
public static final String SUB_TYPE = "JavaScript";
/**
* Constructor #1.
*/
public PDActionJavaScript()
{
setSubType( SUB_TYPE );
}
/**
* Constructor.
*
... |
COSBase base = action.getDictionaryObject( COSName.JS );
if (base instanceof COSString)
{
return ((COSString)base).getString();
}
else if (base instanceof COSStream)
{
return ((COSStream)base).toTextString();
}
else
{
... | 290 | 95 | 385 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public List<org.apache.pdfbox.pdmodel.interactive.action.PDAction> getNext() ,public final java.lang.String getSubType() ,public final java.lang.String getType() ,public voi... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionLaunch.java | PDActionLaunch | setOpenInNewWindow | class PDActionLaunch extends PDAction
{
/**
* This type of action this object represents.
*/
public static final String SUB_TYPE = "Launch";
/**
* Default constructor.
*/
public PDActionLaunch()
{
setSubType( SUB_TYPE );
}
/**
* Constructor.
*
* ... |
if (null == value)
{
getCOSObject().removeItem(COSName.NEW_WINDOW);
return;
}
switch (value)
{
case USER_PREFERENCE:
getCOSObject().removeItem(COSName.NEW_WINDOW);
break;
case SAME_WINDOW:
... | 1,667 | 180 | 1,847 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public List<org.apache.pdfbox.pdmodel.interactive.action.PDAction> getNext() ,public final java.lang.String getSubType() ,public final java.lang.String getType() ,public voi... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionRemoteGoTo.java | PDActionRemoteGoTo | getOpenInNewWindow | class PDActionRemoteGoTo extends PDAction
{
/**
* This type of action this object represents.
*/
public static final String SUB_TYPE = "GoToR";
/**
* Default constructor.
*/
public PDActionRemoteGoTo()
{
setSubType( SUB_TYPE );
}
/**
* Constructor.
*
... |
if (getCOSObject().getDictionaryObject(COSName.NEW_WINDOW) instanceof COSBoolean)
{
COSBoolean b = (COSBoolean) getCOSObject().getDictionaryObject(COSName.NEW_WINDOW);
return b.getValue() ? OpenMode.NEW_WINDOW : OpenMode.SAME_WINDOW;
}
return OpenMode.USER_PREFER... | 909 | 108 | 1,017 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public List<org.apache.pdfbox.pdmodel.interactive.action.PDAction> getNext() ,public final java.lang.String getSubType() ,public final java.lang.String getType() ,public voi... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionURI.java | PDActionURI | getURI | class PDActionURI extends PDAction
{
/**
* This type of action this object represents.
*/
public static final String SUB_TYPE = "URI";
/**
* Default constructor.
*/
public PDActionURI()
{
setSubType(SUB_TYPE);
}
/**
* Constructor.
*
* @param a The... |
COSBase base = action.getDictionaryObject(COSName.URI);
if (base instanceof COSString)
{
byte[] bytes = ((COSString) base).getBytes();
if (bytes.length >= 2)
{
// UTF-16 (BE)
if ((bytes[0] & 0xFF) == 0xFE && (bytes[1] & 0xFF) =... | 512 | 221 | 733 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public List<org.apache.pdfbox.pdmodel.interactive.action.PDAction> getNext() ,public final java.lang.String getSubType() ,public final java.lang.String getType() ,public voi... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDTargetDirectory.java | PDTargetDirectory | setPageNumber | class PDTargetDirectory implements COSObjectable
{
private final COSDictionary dict;
/**
* Default constructor, creates target directory.
*/
public PDTargetDirectory()
{
dict = new COSDictionary();
}
/**
* Create a target directory from an existing dictionary.
*
... |
if (pageNumber < 0)
{
dict.removeItem(COSName.P);
}
else
{
dict.setInt(COSName.P, pageNumber);
}
| 1,796 | 56 | 1,852 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationCaret.java | PDAnnotationCaret | setRectDifferences | class PDAnnotationCaret extends PDAnnotationMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Caret";
private PDAppearanceHandler customAppearanceHandler;
public PDAnnotationCaret()
{
getCOSObject().setName(COSName.SUBTYPE, SUB_TYPE);
}
/**... |
COSArray margins = new COSArray();
margins.add(new COSFloat(differenceLeft));
margins.add(new COSFloat(differenceTop));
margins.add(new COSFloat(differenceRight));
margins.add(new COSFloat(differenceBottom));
getCOSObject().setItem(COSName.RD, margins);
| 768 | 101 | 869 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getBorderStyle() ,public float getConstantOpacity() ,public java.util.Calendar getCreationDate() ,public org.apache.pdfbox.pdmodel.interactive.annotatio... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationCircle.java | PDAnnotationCircle | constructAppearances | class PDAnnotationCircle extends PDAnnotationSquareCircle
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Circle";
private PDAppearanceHandler customAppearanceHandler;
public PDAnnotationCircle()
{
super(SUB_TYPE);
}
/**
* Creates a circle ... |
if (customAppearanceHandler == null)
{
PDCircleAppearanceHandler appearanceHandler = new PDCircleAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams();
... | 302 | 84 | 386 | <methods>public abstract void constructAppearances() ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderEffectDictionary getBorderEffect() ,public org.apache.pdfbox.pdmodel.graphics.color.PDColor getInteriorColor() ,public org.apache.pdfbox.pdmodel.common.PDRectangle getRectDifference() ,public float[] ge... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFileAttachment.java | PDAnnotationFileAttachment | constructAppearances | class PDAnnotationFileAttachment extends PDAnnotationMarkup
{
/**
* See get/setAttachmentName.
*/
public static final String ATTACHMENT_NAME_PUSH_PIN = "PushPin";
/**
* See get/setAttachmentName.
*/
public static final String ATTACHMENT_NAME_GRAPH = "Graph";
/**
* See get/se... |
if (customAppearanceHandler == null)
{
PDFileAttachmentAppearanceHandler appearanceHandler = new PDFileAttachmentAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppeara... | 834 | 86 | 920 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getBorderStyle() ,public float getConstantOpacity() ,public java.util.Calendar getCreationDate() ,public org.apache.pdfbox.pdmodel.interactive.annotatio... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationHighlight.java | PDAnnotationHighlight | constructAppearances | class PDAnnotationHighlight extends PDAnnotationTextMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Highlight";
private PDAppearanceHandler customAppearanceHandler;
/**
* Constructor.
*/
public PDAnnotationHighlight()
{
super(SUB_TY... |
if (customAppearanceHandler == null)
{
PDHighlightAppearanceHandler appearanceHandler = new PDHighlightAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams... | 293 | 84 | 377 | <methods>public float[] getQuadPoints() ,public final void setQuadPoints(float[]) <variables> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationInk.java | PDAnnotationInk | getInkList | class PDAnnotationInk extends PDAnnotationMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Ink";
private PDAppearanceHandler customAppearanceHandler;
/**
* Constructor.
*/
public PDAnnotationInk()
{
getCOSObject().setName(COSName.SUBT... |
COSArray array = getCOSObject().getCOSArray(COSName.INKLIST);
if (array != null)
{
float[][] inkList = new float[array.size()][];
for (int i = 0; i < array.size(); ++i)
{
COSBase base2 = array.getObject(i);
if (base2 instanceof... | 654 | 174 | 828 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getBorderStyle() ,public float getConstantOpacity() ,public java.util.Calendar getCreationDate() ,public org.apache.pdfbox.pdmodel.interactive.annotatio... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationPolyline.java | PDAnnotationPolyline | setStartPointEndingStyle | class PDAnnotationPolyline extends PDAnnotationMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "PolyLine";
private PDAppearanceHandler customAppearanceHandler;
/**
* Constructor.
*/
public PDAnnotationPolyline()
{
getCOSObject().s... |
String actualStyle = style == null ? PDAnnotationLine.LE_NONE : style;
COSArray array = getCOSObject().getCOSArray(COSName.LE);
if (array == null || array.isEmpty())
{
array = new COSArray();
array.add(COSName.getPDFName(actualStyle));
array.add(COSNa... | 1,342 | 154 | 1,496 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getBorderStyle() ,public float getConstantOpacity() ,public java.util.Calendar getCreationDate() ,public org.apache.pdfbox.pdmodel.interactive.annotatio... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationPopup.java | PDAnnotationPopup | getParent | class PDAnnotationPopup extends PDAnnotation
{
private static final Logger LOG = LogManager.getLogger(PDAnnotationPopup.class);
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Popup";
/**
* Constructor.
*/
public PDAnnotationPopup()
{
getCOSO... |
try
{
PDAnnotation ann = PDAnnotation.createAnnotation(getCOSObject()
.getDictionaryObject(COSName.PARENT, COSName.P));
if (!(ann instanceof PDAnnotationMarkup))
{
LOG.error("parent annotation is of type {} but should be of type PD... | 484 | 183 | 667 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public void constructAppearances(org.apache.pdfbox.pdmodel.PDDocument) ,public void constructAppearances() ,public static org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation createAnnotation(org.apache.pdfbox.cos.COSBase) ... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationSound.java | PDAnnotationSound | constructAppearances | class PDAnnotationSound extends PDAnnotationMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Sound";
private PDAppearanceHandler customAppearanceHandler;
public PDAnnotationSound()
{
getCOSObject().setName(COSName.SUBTYPE, SUB_TYPE);
}
/**... |
if (customAppearanceHandler == null)
{
PDSoundAppearanceHandler appearanceHandler = new PDSoundAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams();
... | 311 | 82 | 393 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getBorderStyle() ,public float getConstantOpacity() ,public java.util.Calendar getCreationDate() ,public org.apache.pdfbox.pdmodel.interactive.annotatio... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationSquare.java | PDAnnotationSquare | constructAppearances | class PDAnnotationSquare extends PDAnnotationSquareCircle
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Square";
private PDAppearanceHandler customAppearanceHandler;
public PDAnnotationSquare()
{
super(SUB_TYPE);
}
/**
* Creates a squ... |
if (customAppearanceHandler == null)
{
PDSquareAppearanceHandler appearanceHandler = new PDSquareAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams();
... | 303 | 82 | 385 | <methods>public abstract void constructAppearances() ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderEffectDictionary getBorderEffect() ,public org.apache.pdfbox.pdmodel.graphics.color.PDColor getInteriorColor() ,public org.apache.pdfbox.pdmodel.common.PDRectangle getRectDifference() ,public float[] ge... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationSquiggly.java | PDAnnotationSquiggly | constructAppearances | class PDAnnotationSquiggly extends PDAnnotationTextMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Squiggly";
private PDAppearanceHandler customAppearanceHandler;
/**
* Constructor.
*/
public PDAnnotationSquiggly()
{
super(SUB_TYPE)... |
if (customAppearanceHandler == null)
{
PDSquigglyAppearanceHandler appearanceHandler = new PDSquigglyAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams()... | 301 | 86 | 387 | <methods>public float[] getQuadPoints() ,public final void setQuadPoints(float[]) <variables> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationStrikeout.java | PDAnnotationStrikeout | constructAppearances | class PDAnnotationStrikeout extends PDAnnotationTextMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "StrikeOut";
private PDAppearanceHandler customAppearanceHandler;
/**
* Constructor.
*/
public PDAnnotationStrikeout()
{
super(SUB_TY... |
if (customAppearanceHandler == null)
{
PDStrikeoutAppearanceHandler appearanceHandler = new PDStrikeoutAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams... | 301 | 88 | 389 | <methods>public float[] getQuadPoints() ,public final void setQuadPoints(float[]) <variables> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationText.java | PDAnnotationText | constructAppearances | class PDAnnotationText extends PDAnnotationMarkup
{
private PDAppearanceHandler customAppearanceHandler;
/*
* The various values of the Text as defined in the PDF 1.7 reference Table 172
*/
/**
* Constant for the name of a text annotation.
*/
public static final String NAME_COMMENT... |
if (customAppearanceHandler == null)
{
PDTextAppearanceHandler appearanceHandler = new PDTextAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams();
... | 1,557 | 82 | 1,639 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getBorderStyle() ,public float getConstantOpacity() ,public java.util.Calendar getCreationDate() ,public org.apache.pdfbox.pdmodel.interactive.annotatio... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationUnderline.java | PDAnnotationUnderline | constructAppearances | class PDAnnotationUnderline extends PDAnnotationTextMarkup
{
/**
* The type of annotation.
*/
public static final String SUB_TYPE = "Underline";
private PDAppearanceHandler customAppearanceHandler;
/**
* Constructor.
*/
public PDAnnotationUnderline()
{
super(SUB_TY... |
if (customAppearanceHandler == null)
{
PDUnderlineAppearanceHandler appearanceHandler = new PDUnderlineAppearanceHandler(this, document);
appearanceHandler.generateAppearanceStreams();
}
else
{
customAppearanceHandler.generateAppearanceStreams... | 293 | 84 | 377 | <methods>public float[] getQuadPoints() ,public final void setQuadPoints(float[]) <variables> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceCharacteristicsDictionary.java | PDAppearanceCharacteristicsDictionary | getColor | class PDAppearanceCharacteristicsDictionary implements COSObjectable
{
private final COSDictionary dictionary;
/**
* Constructor.
*
* @param dict dictionary
*/
public PDAppearanceCharacteristicsDictionary(COSDictionary dict)
{
this.dictionary = dict;
}
/**
* ... |
COSArray cs = getCOSObject().getCOSArray(itemName);
if (cs != null)
{
PDColorSpace colorSpace;
switch (cs.size())
{
case 1:
colorSpace = PDDeviceGray.INSTANCE;
break;
case 3:
colorSpace =... | 1,295 | 165 | 1,460 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceEntry.java | PDAppearanceEntry | getSubDictionary | class PDAppearanceEntry implements COSObjectable
{
private COSDictionary entry;
private PDAppearanceEntry()
{
}
/**
* Constructor for reading.
*
* @param entry the dictionary of the appearance entry
*/
public PDAppearanceEntry(COSDictionary entry)
{
this.entry ... |
if (!isSubDictionary())
{
throw new IllegalStateException("This entry is not an appearance subdictionary");
}
COSDictionary dict = entry;
Map<COSName, PDAppearanceStream> map = new HashMap<>();
for (COSName name : dict.keySet())
{
COSStr... | 470 | 179 | 649 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java | PDBorderStyleDictionary | getWidth | class PDBorderStyleDictionary implements COSObjectable
{
/*
* The various values of the style for the border as defined in the PDF 1.6 reference Table 8.13
*/
/**
* Constant for the name of a solid style.
*/
public static final String STYLE_SOLID = "S";
/**
* Constant for the... |
if (getCOSObject().getDictionaryObject(COSName.W) instanceof COSName)
{
// replicate Adobe behavior although it contradicts the specification
// https://github.com/mozilla/pdf.js/issues/10385
return 0;
}
return getCOSObject().getFloat(COSName.W, 1);
... | 1,080 | 95 | 1,175 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/AnnotationBorder.java | AnnotationBorder | getAnnotationBorder | class AnnotationBorder
{
float[] dashArray = null;
boolean underline = false;
float width = 0;
// return border info. BorderStyle must be provided as parameter because
// method is not available in the base class
static AnnotationBorder getAnnotationBorder(PDAnnotation annotation,
P... |
AnnotationBorder ab = new AnnotationBorder();
if (borderStyle == null)
{
COSArray border = annotation.getBorder();
if (border.size() >= 3 && border.getObject(2) instanceof COSNumber)
{
ab.width = ((COSNumber) border.getObject(2)).floatValue();... | 100 | 378 | 478 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDCaretAppearanceHandler.java | PDCaretAppearanceHandler | generateNormalAppearance | class PDCaretAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDCaretAppearanceHandler.class);
public PDCaretAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDCaretAppearanceHandler(PDAnnotation annotati... |
PDAnnotationCaret annotation = (PDAnnotationCaret) getAnnotation();
try (PDAppearanceContentStream contentStream = getNormalAppearanceAsContentStream())
{
contentStream.setStrokingColor(getColor());
contentStream.setNonStrokingColor(getColor());
setOpacity(c... | 197 | 657 | 854 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDCircleAppearanceHandler.java | PDCircleAppearanceHandler | generateNormalAppearance | class PDCircleAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDCircleAppearanceHandler.class);
public PDCircleAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDCircleAppearanceHandler(PDAnnotation ... |
float lineWidth = getLineWidth();
PDAnnotationCircle annotation = (PDAnnotationCircle) getAnnotation();
try (PDAppearanceContentStream contentStream = getNormalAppearanceAsContentStream())
{
boolean hasStroke = contentStream.setStrokingColorOnDemand(getColor());
... | 526 | 816 | 1,342 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDFileAttachmentAppearanceHandler.java | PDFileAttachmentAppearanceHandler | generateNormalAppearance | class PDFileAttachmentAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDFileAttachmentAppearanceHandler.class);
public PDFileAttachmentAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDFileAttachmentApp... |
PDAnnotationFileAttachment annotation = (PDAnnotationFileAttachment) getAnnotation();
PDRectangle rect = getRectangle();
if (rect == null)
{
return;
}
try (PDAppearanceContentStream contentStream = getNormalAppearanceAsContentStream())
{
s... | 1,523 | 251 | 1,774 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDInkAppearanceHandler.java | PDInkAppearanceHandler | generateNormalAppearance | class PDInkAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDInkAppearanceHandler.class);
public PDInkAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDInkAppearanceHandler(PDAnnotation annotation, PDDo... |
PDAnnotationInk ink = (PDAnnotationInk) getAnnotation();
PDColor color = ink.getColor();
if (color == null || color.getComponents().length == 0)
{
return;
}
// PDF spec does not mention /Border for ink annotations, but it is used if /BS is not available
... | 201 | 846 | 1,047 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLinkAppearanceHandler.java | PDLinkAppearanceHandler | generateNormalAppearance | class PDLinkAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDLinkAppearanceHandler.class);
public PDLinkAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDLinkAppearanceHandler(PDAnnotation annotati... |
PDAnnotationLink annotation = (PDAnnotationLink) getAnnotation();
PDRectangle rect = annotation.getRectangle();
if (rect == null)
{
// 660402-p1-AnnotationEmptyRect.pdf has /Rect entry with 0 elements
return;
}
// Adobe doesn't generate an appear... | 529 | 931 | 1,460 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDPolygonAppearanceHandler.java | PDPolygonAppearanceHandler | generateNormalAppearance | class PDPolygonAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDPolygonAppearanceHandler.class);
public PDPolygonAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDPolygonAppearanceHandler(PDAnnotation ... |
PDAnnotationPolygon annotation = (PDAnnotationPolygon) getAnnotation();
float lineWidth = getLineWidth();
PDRectangle rect = annotation.getRectangle();
if (rect == null)
{
return;
}
// Adjust rectangle even if not empty
// CTAN-example-Annota... | 741 | 1,029 | 1,770 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquareAppearanceHandler.java | PDSquareAppearanceHandler | generateNormalAppearance | class PDSquareAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDSquareAppearanceHandler.class);
public PDSquareAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDSquareAppearanceHandler(PDAnnotat... |
float lineWidth = getLineWidth();
PDAnnotationSquare annotation = (PDAnnotationSquare) getAnnotation();
try (PDAppearanceContentStream contentStream = getNormalAppearanceAsContentStream())
{
boolean hasStroke = contentStream.setStrokingColorOnDemand(getColor());
... | 522 | 451 | 973 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java | PDSquigglyAppearanceHandler | generateNormalAppearance | class PDSquigglyAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDSquigglyAppearanceHandler.class);
public PDSquigglyAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDSquigglyAppearanceHandler(PDAnnotat... |
PDAnnotationSquiggly annotation = (PDAnnotationSquiggly) getAnnotation();
PDRectangle rect = annotation.getRectangle();
if (rect == null)
{
return;
}
float[] pathsArray = annotation.getQuadPoints();
if (pathsArray == null)
{
return... | 206 | 1,492 | 1,698 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDStrikeoutAppearanceHandler.java | PDStrikeoutAppearanceHandler | generateNormalAppearance | class PDStrikeoutAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDStrikeoutAppearanceHandler.class);
public PDStrikeoutAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDStrikeoutAppearanceHandler(PDAnn... |
PDAnnotationStrikeout annotation = (PDAnnotationStrikeout) getAnnotation();
PDRectangle rect = annotation.getRectangle();
if (rect == null)
{
return;
}
float[] pathsArray = annotation.getQuadPoints();
if (pathsArray == null)
{
retu... | 209 | 1,365 | 1,574 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDUnderlineAppearanceHandler.java | PDUnderlineAppearanceHandler | generateNormalAppearance | class PDUnderlineAppearanceHandler extends PDAbstractAppearanceHandler
{
private static final Logger LOG = LogManager.getLogger(PDUnderlineAppearanceHandler.class);
public PDUnderlineAppearanceHandler(PDAnnotation annotation)
{
super(annotation);
}
public PDUnderlineAppearanceHandler(PDAnn... |
PDAnnotationUnderline annotation = (PDAnnotationUnderline) getAnnotation();
PDRectangle rect = annotation.getRectangle();
if (rect == null)
{
return;
}
float[] pathsArray = annotation.getQuadPoints();
if (pathsArray == null)
{
retu... | 201 | 1,303 | 1,504 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation) ,public void <init>(org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, org.apache.pdfbox.pdmodel.PDDocument) <variables>protected static final Set<java.lang.String> ANGLED_STYLES,static final double ARROW_ANGLE,protec... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/COSFilterInputStream.java | COSFilterInputStream | read | class COSFilterInputStream extends FilterInputStream
{
private int[][] ranges;
private int range;
private long position = 0;
public COSFilterInputStream(InputStream in, int[] byteRange)
{
super(in);
calculateRanges(byteRange);
}
public COSFilterInputStream(byte[... |
if ((this.range == -1 || getRemaining() <= 0) && !nextRange())
{
return -1; // EOF
}
int result = super.read();
this.position++;
return result;
| 719 | 70 | 789 | <methods>public int available() throws java.io.IOException,public void close() throws java.io.IOException,public synchronized void mark(int) ,public boolean markSupported() ,public int read() throws java.io.IOException,public int read(byte[]) throws java.io.IOException,public int read(byte[], int, int) throws java.io.I... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDPropBuild.java | PDPropBuild | getApp | class PDPropBuild implements COSObjectable
{
private final COSDictionary dictionary;
/**
* Default constructor.
*/
public PDPropBuild()
{
dictionary = new COSDictionary();
dictionary.setDirect(true); // the specification claim to use direct objects
}
/**
* Constr... |
PDPropBuildDataDict app = null;
COSDictionary appDic = dictionary.getCOSDictionary(COSName.APP);
if (appDic != null)
{
app = new PDPropBuildDataDict(appDic);
}
return app;
| 842 | 77 | 919 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSeedValueMDP.java | PDSeedValueMDP | setP | class PDSeedValueMDP
{
private final COSDictionary dictionary;
/**
* Default constructor.
*/
public PDSeedValueMDP()
{
dictionary = new COSDictionary();
dictionary.setDirect(true);
}
/**
* Constructor.
*
* @param dict The signature dictionary.
*/
... |
if (p < 0 || p > 3)
{
throw new IllegalArgumentException("Only values between 0 and 3 nare allowed.");
}
dictionary.setInt(COSName.P, p);
| 305 | 55 | 360 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions.java | SignatureOptions | close | class SignatureOptions implements Closeable
{
private COSDocument visualSignature;
private int preferredSignatureSize;
private int pageNo;
// the pdf to be read
// this is done analog to PDDocument
private RandomAccessRead pdfSource = null;
public static final int DEFAULT_SIGNATURE_SIZE = ... |
try
{
if (visualSignature != null)
{
visualSignature.close();
}
}
finally
{
if (pdfSource != null)
{
pdfSource.close();
}
}
| 874 | 68 | 942 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/PDFTemplateCreator.java | PDFTemplateCreator | buildPDF | class PDFTemplateCreator
{
private final PDFTemplateBuilder pdfBuilder;
private static final Logger LOG = LogManager.getLogger(PDFTemplateCreator.class);
/**
* Constructor.
*
* @param templateBuilder the template builder
*/
public PDFTemplateCreator(PDFTemplateBuilder templateBuild... |
LOG.info("pdf building has been started");
PDFTemplateStructure pdfStructure = pdfBuilder.getStructure();
// we create array of [Text, ImageB, ImageC, ImageI]
pdfBuilder.createProcSetArray();
//create page
pdfBuilder.createPage(properties);
PDPage page ... | 350 | 1,092 | 1,442 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/PDVisibleSigProperties.java | PDVisibleSigProperties | buildSignature | class PDVisibleSigProperties
{
private String signerName;
private String signerLocation;
private String signatureReason;
private boolean visualSignEnabled;
private int page;
private int preferredSize;
private InputStream visibleSignature;
private PDVisibleSignDesigner pdVisibleSignature... |
PDFTemplateBuilder builder = new PDVisibleSigBuilder();
PDFTemplateCreator creator = new PDFTemplateCreator(builder);
setVisibleSignature(creator.buildPDF(getPdVisibleSignature()));
| 1,178 | 53 | 1,231 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java | PDDestination | create | class PDDestination implements PDDestinationOrAction
{
/**
* This will create a new destination depending on the type of COSBase
* that is passed in.
*
* @param base The base level object.
*
* @return A new destination.
*
* @throws IOException If the base cannot be converted... |
PDDestination retval = null;
if( base == null )
{
//this is ok, just return null.
}
else if (base instanceof COSArray
&& ((COSArray) base).size() > 1
&& ((COSArray) base).getObject(1) instanceof COSName)
{
COSArra... | 128 | 500 | 628 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDNamedDestination.java | PDNamedDestination | getNamedDestination | class PDNamedDestination extends PDDestination
{
private COSBase namedDestination;
/**
* Constructor.
*
* @param dest The named destination.
*/
public PDNamedDestination( COSString dest )
{
namedDestination = dest;
}
/**
* Constructor.
*
* @param dest... |
String retval = null;
if( namedDestination instanceof COSString )
{
retval = ((COSString)namedDestination).getString();
}
else if( namedDestination instanceof COSName )
{
retval = ((COSName)namedDestination).getName();
}
return re... | 462 | 87 | 549 | <methods>public non-sealed void <init>() ,public static org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination create(org.apache.pdfbox.cos.COSBase) throws java.io.IOException<variables> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDPageDestination.java | PDPageDestination | getPage | class PDPageDestination extends PDDestination
{
/**
* Storage for the page destination.
*/
protected final COSArray array;
/**
* Constructor to create empty page destination.
*
*/
protected PDPageDestination()
{
array = new COSArray();
}
/**
* Construc... |
PDPage retval = null;
if (!array.isEmpty())
{
COSBase page = array.getObject( 0 );
if( page instanceof COSDictionary )
{
retval = new PDPage( (COSDictionary)page );
}
}
return retval;
| 1,128 | 81 | 1,209 | <methods>public non-sealed void <init>() ,public static org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination create(org.apache.pdfbox.cos.COSBase) throws java.io.IOException<variables> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDPageFitDestination.java | PDPageFitDestination | setFitBoundingBox | class PDPageFitDestination extends PDPageDestination
{
/**
* The type of this destination.
*/
protected static final String TYPE = "Fit";
/**
* The type of this destination.
*/
protected static final String TYPE_BOUNDED = "FitB";
/**
* Default constructor.
*
*/
... |
array.growToSize( 2 );
if( fitBoundingBox )
{
array.setName( 1, TYPE_BOUNDED );
}
else
{
array.setName( 1, TYPE );
}
| 359 | 66 | 425 | <methods>public org.apache.pdfbox.cos.COSArray getCOSObject() ,public org.apache.pdfbox.pdmodel.PDPage getPage() ,public int getPageNumber() ,public int retrievePageNumber() ,public void setPage(org.apache.pdfbox.pdmodel.PDPage) ,public void setPageNumber(int) <variables>protected final non-sealed org.apache.pdfbox.cos... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDPageFitHeightDestination.java | PDPageFitHeightDestination | setLeft | class PDPageFitHeightDestination extends PDPageDestination
{
/**
* The type of this destination.
*/
protected static final String TYPE = "FitV";
/**
* The type of this destination.
*/
protected static final String TYPE_BOUNDED = "FitBV";
/**
* Default constructor.
*
... |
array.growToSize( 3 );
if( x == -1 )
{
array.set(2, null);
}
else
{
array.setInt( 2, x );
}
| 566 | 60 | 626 | <methods>public org.apache.pdfbox.cos.COSArray getCOSObject() ,public org.apache.pdfbox.pdmodel.PDPage getPage() ,public int getPageNumber() ,public int retrievePageNumber() ,public void setPage(org.apache.pdfbox.pdmodel.PDPage) ,public void setPageNumber(int) <variables>protected final non-sealed org.apache.pdfbox.cos... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDPageFitRectangleDestination.java | PDPageFitRectangleDestination | setRight | class PDPageFitRectangleDestination extends PDPageDestination
{
/**
* The type of this destination.
*/
protected static final String TYPE = "FitR";
/**
* Default constructor.
*
*/
public PDPageFitRectangleDestination()
{
array.growToSize(6);
array.setName( 1... |
array.growToSize( 6 );
if( x == -1 )
{
array.set(4, null);
}
else
{
array.setInt( 4, x );
}
| 909 | 60 | 969 | <methods>public org.apache.pdfbox.cos.COSArray getCOSObject() ,public org.apache.pdfbox.pdmodel.PDPage getPage() ,public int getPageNumber() ,public int retrievePageNumber() ,public void setPage(org.apache.pdfbox.pdmodel.PDPage) ,public void setPageNumber(int) <variables>protected final non-sealed org.apache.pdfbox.cos... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDPageFitWidthDestination.java | PDPageFitWidthDestination | setFitBoundingBox | class PDPageFitWidthDestination extends PDPageDestination
{
/**
* The type of this destination.
*/
protected static final String TYPE = "FitH";
/**
* The type of this destination.
*/
protected static final String TYPE_BOUNDED = "FitBH";
/**
* Default constructor.
*
... |
array.growToSize(3);
if( fitBoundingBox )
{
array.setName( 1, TYPE_BOUNDED );
}
else
{
array.setName( 1, TYPE );
}
| 563 | 65 | 628 | <methods>public org.apache.pdfbox.cos.COSArray getCOSObject() ,public org.apache.pdfbox.pdmodel.PDPage getPage() ,public int getPageNumber() ,public int retrievePageNumber() ,public void setPage(org.apache.pdfbox.pdmodel.PDPage) ,public void setPageNumber(int) <variables>protected final non-sealed org.apache.pdfbox.cos... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDPageXYZDestination.java | PDPageXYZDestination | setLeft | class PDPageXYZDestination extends PDPageDestination
{
/**
* The type of this destination.
*/
protected static final String TYPE = "XYZ";
/**
* Default constructor.
*
*/
public PDPageXYZDestination()
{
array.growToSize(5);
array.setName( 1, TYPE );
}
... |
array.growToSize( 5 );
if( x == -1 )
{
array.set(2, null);
}
else
{
array.setInt( 2, x );
}
| 759 | 60 | 819 | <methods>public org.apache.pdfbox.cos.COSArray getCOSObject() ,public org.apache.pdfbox.pdmodel.PDPage getPage() ,public int getPageNumber() ,public int retrievePageNumber() ,public void setPage(org.apache.pdfbox.pdmodel.PDPage) ,public void setPageNumber(int) <variables>protected final non-sealed org.apache.pdfbox.cos... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDDocumentOutline.java | PDDocumentOutline | closeNode | class PDDocumentOutline extends PDOutlineNode
{
/**
* Default Constructor.
*/
public PDDocumentOutline()
{
getCOSObject().setName(COSName.TYPE, COSName.OUTLINES.getName());
}
/**
* Constructor for an existing document outline.
*
* @param dic The storage dictionary.... |
// The root of the outline hierarchy is not an OutlineItem and cannot be opened or closed
| 245 | 24 | 269 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public void addFirst(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem) ,public void addLast(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem) ,public Iterable<org.apache.pd... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItemIterator.java | PDOutlineItemIterator | next | class PDOutlineItemIterator implements Iterator<PDOutlineItem>
{
private PDOutlineItem currentItem;
private final PDOutlineItem startingItem;
PDOutlineItemIterator(PDOutlineItem startingItem)
{
this.startingItem = startingItem;
}
@Override
public boolean hasNext()
{
if ... |
if (!hasNext())
{
throw new NoSuchElementException();
}
if (currentItem == null)
{
currentItem = startingItem;
}
else
{
currentItem = currentItem.getNextSibling();
}
return currentItem;
| 232 | 77 | 309 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/FieldUtils.java | KeyValue | getPairableItems | class KeyValue
{
private final String key;
private final String value;
KeyValue(final String theKey, final String theValue)
{
this.key = theKey;
this.value = theValue;
}
public String getKey()
{
return this... |
if (pairIdx < 0 || pairIdx > 1)
{
throw new IllegalArgumentException("Only 0 and 1 are allowed as an index into two-element arrays");
}
if (items instanceof COSString)
{
List<String> array = new ArrayList<>(1);
array.add(((COSString)... | 708 | 293 | 1,001 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDCheckBox.java | PDCheckBox | getOnValue | class PDCheckBox extends PDButton
{
/**
* @see PDField#PDField(PDAcroForm)
*
* @param acroForm The acroform.
*/
public PDCheckBox(PDAcroForm acroForm)
{
super(acroForm);
}
/**
* Constructor.
*
* @param acroForm The form that this field is part of.
... |
PDAnnotationWidget widget = this.getWidgets().get(0);
PDAppearanceDictionary apDictionary = widget.getAppearance();
if (apDictionary != null)
{
PDAppearanceEntry normalAppearance = apDictionary.getNormalAppearance();
if (normalAppearance != null)
... | 554 | 173 | 727 | <methods>public java.lang.String getDefaultValue() ,public List<java.lang.String> getExportValues() ,public Set<java.lang.String> getOnValues() ,public java.lang.String getValue() ,public java.lang.String getValueAsString() ,public boolean isPushButton() ,public boolean isRadioButton() ,public void setDefaultValue(java... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDComboBox.java | PDComboBox | constructAppearances | class PDComboBox extends PDChoice
{
private static final int FLAG_EDIT = 1 << 18;
/**
* @see PDField#PDField(PDAcroForm)
*
* @param acroForm The acroform.
*/
public PDComboBox(PDAcroForm acroForm)
{
super(acroForm);
setCombo(true);
}
/**
* Const... |
AppearanceGeneratorHelper apHelper;
apHelper = new AppearanceGeneratorHelper(this);
List<String> values = getValue();
if (!values.isEmpty())
{
apHelper.setAppearanceValue(values.get(0));
}
else
{
apHelper.setAppearanceValu... | 409 | 90 | 499 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm) ,public List<java.lang.String> getDefaultValue() ,public List<java.lang.String> getOptions() ,public List<java.lang.String> getOptionsDisplayValues() ,public List<java.lang.String> getOptionsExportValues() ,public List<java.lang.Integer>... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDFieldFactory.java | PDFieldFactory | findFieldType | class PDFieldFactory
{
private static final String FIELD_TYPE_TEXT = "Tx";
private static final String FIELD_TYPE_BUTTON = "Btn";
private static final String FIELD_TYPE_CHOICE = "Ch";
private static final String FIELD_TYPE_SIGNATURE = "Sig";
private PDFieldFactory()
{
}
/**
... |
String retval = dic.getNameAsString(COSName.FT);
if (retval == null)
{
COSDictionary base = dic.getCOSDictionary(COSName.PARENT, COSName.P);
return base != null ? findFieldType(base):null;
}
return retval;
| 1,006 | 86 | 1,092 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDFieldTree.java | FieldIterator | enqueueKids | class FieldIterator implements Iterator<PDField>
{
private final Queue<PDField> queue = new ArrayDeque<>();
// PDFBOX-5044: to prevent recursion
// must be COSDictionary and not PDField, because PDField is newly created each time
private final Set<COSDictionary> set =
... |
queue.add(node);
set.add(node.getCOSObject());
if (node instanceof PDNonTerminalField)
{
List<PDField> kids = ((PDNonTerminalField) node).getChildren();
for (PDField kid : kids)
{
if (set.contains(kid.ge... | 298 | 158 | 456 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDListBox.java | PDListBox | setTopIndex | class PDListBox extends PDChoice
{
/**
* @see PDField#PDField(PDAcroForm)
*
* @param acroForm The acroform.
*/
public PDListBox(PDAcroForm acroForm)
{
super(acroForm);
}
/**
* Constructor.
*
* @param acroForm The form that this field is part of.
... |
if (topIndex != null)
{
getCOSObject().setInt(COSName.TI, topIndex);
}
else
{
getCOSObject().removeItem(COSName.TI);
}
| 394 | 63 | 457 | <methods>public void <init>(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm) ,public List<java.lang.String> getDefaultValue() ,public List<java.lang.String> getOptions() ,public List<java.lang.String> getOptionsDisplayValues() ,public List<java.lang.String> getOptionsExportValues() ,public List<java.lang.Integer>... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDPushButton.java | PDPushButton | setExportValues | class PDPushButton extends PDButton
{
/**
* @see PDField#PDField(PDAcroForm)
*
* @param acroForm The acroform.
*/
public PDPushButton(PDAcroForm acroForm)
{
super(acroForm);
getCOSObject().setFlag(COSName.FF, FLAG_PUSHBUTTON, true);
}
/**
* Constructor.
... |
if (values != null && !values.isEmpty())
{
throw new IllegalArgumentException("A PDPushButton shall not use the Opt entry in the field dictionary");
}
| 428 | 46 | 474 | <methods>public java.lang.String getDefaultValue() ,public List<java.lang.String> getExportValues() ,public Set<java.lang.String> getOnValues() ,public java.lang.String getValue() ,public java.lang.String getValueAsString() ,public boolean isPushButton() ,public boolean isRadioButton() ,public void setDefaultValue(java... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDRadioButton.java | PDRadioButton | getSelectedExportValues | class PDRadioButton extends PDButton
{
/**
* A Ff flag.
*/
private static final int FLAG_NO_TOGGLE_TO_OFF = 1 << 14;
/**
* @see PDField#PDField(PDAcroForm)
*
* @param acroForm The acroform.
*/
public PDRadioButton(PDAcroForm acroForm)
{
super(acroForm);
... |
List<String> exportValues = getExportValues();
List<String> selectedExportValues = new ArrayList<>();
if (exportValues.isEmpty())
{
selectedExportValues.add(getValue());
return selectedExportValues;
}
else
{
String fieldValue =... | 908 | 154 | 1,062 | <methods>public java.lang.String getDefaultValue() ,public List<java.lang.String> getExportValues() ,public Set<java.lang.String> getOnValues() ,public java.lang.String getValue() ,public java.lang.String getValueAsString() ,public boolean isPushButton() ,public boolean isRadioButton() ,public void setDefaultValue(java... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDSignatureField.java | PDSignatureField | generatePartialName | class PDSignatureField extends PDTerminalField
{
private static final Logger LOG = LogManager.getLogger(PDSignatureField.class);
/**
* @see PDTerminalField#PDTerminalField(PDAcroForm)
*
* @param acroForm The acroForm for this field.
*/
public PDSignatureField(PDAcroForm acroForm)
{
... |
String fieldName = "Signature";
Set<String> nameSet = new HashSet<>();
getAcroForm().getFieldTree().forEach(field -> nameSet.add(field.getPartialName()));
int i = 1;
while (nameSet.contains(fieldName + i))
{
++i;
}
return fieldName+i;
| 1,446 | 94 | 1,540 | <methods>public int getFieldFlags() ,public java.lang.String getFieldType() ,public List<org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget> getWidgets() ,public void importFDF(org.apache.pdfbox.pdmodel.fdf.FDFField) throws java.io.IOException,public void setActions(org.apache.pdfbox.pdmodel.interactiv... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDTerminalField.java | PDTerminalField | getFieldFlags | class PDTerminalField extends PDField
{
/**
* Constructor.
*
* @param acroForm The form that this field is part of.
*/
protected PDTerminalField(PDAcroForm acroForm)
{
super(acroForm);
}
/**
* Constructor.
*
* @param acroForm The form that this field is ... |
int retval = 0;
COSInteger ff = (COSInteger) getCOSObject().getDictionaryObject(COSName.FF);
if (ff != null)
{
retval = ff.intValue();
}
else if (getParent() != null)
{
retval = getParent().getFieldFlags();
}
return retval;... | 1,470 | 99 | 1,569 | <methods>public org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm getAcroForm() ,public org.apache.pdfbox.pdmodel.interactive.action.PDFormFieldAdditionalActions getActions() ,public java.lang.String getAlternateFieldName() ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public abstract int getFieldFlag... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDVariableText.java | PDVariableText | setDefaultStyleString | class PDVariableText extends PDTerminalField
{
public static final int QUADDING_LEFT = 0;
public static final int QUADDING_CENTERED = 1;
public static final int QUADDING_RIGHT = 2;
/**
* @see PDTerminalField#PDTerminalField(PDAcroForm)
*
* @param acroForm The acroform.
*/
PDVari... |
if (defaultStyleString != null)
{
getCOSObject().setItem(COSName.DS, new COSString(defaultStyleString));
}
else
{
getCOSObject().removeItem(COSName.DS);
}
| 1,871 | 70 | 1,941 | <methods>public int getFieldFlags() ,public java.lang.String getFieldType() ,public List<org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget> getWidgets() ,public void importFDF(org.apache.pdfbox.pdmodel.fdf.FDFField) throws java.io.IOException,public void setActions(org.apache.pdfbox.pdmodel.interactiv... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDXFAResource.java | PDXFAResource | getBytesFromPacket | class PDXFAResource implements COSObjectable
{
private final COSBase xfa;
/**
* Constructor.
*
* @param xfaBase The xfa resource.
*/
public PDXFAResource(COSBase xfaBase)
{
xfa = xfaBase;
}
/**
* {@inheritDoc}
*/
@Override
public COSBase getCO... |
try (final ByteArrayOutputStream baos = new ByteArrayOutputStream())
{
for (int i = 1; i < cosArray.size(); i += 2)
{
COSBase cosObj = cosArray.getObject(i);
if (cosObj instanceof COSStream)
{
baos.write(getBy... | 703 | 120 | 823 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/pagenavigation/PDThreadBead.java | PDThreadBead | appendBead | class PDThreadBead implements COSObjectable
{
private final COSDictionary bead;
/**
* Constructor that is used for a preexisting dictionary.
*
* @param b The underlying dictionary.
*/
public PDThreadBead( COSDictionary b )
{
bead = b;
}
/**
* Default construc... |
PDThreadBead nextBead = getNextBead();
nextBead.setPreviousBead( append );
append.setNextBead( nextBead );
setNextBead( append );
append.setPreviousBead( this );
| 1,324 | 65 | 1,389 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/pagenavigation/PDTransition.java | PDTransition | getDirection | class PDTransition extends PDDictionaryWrapper
{
/**
* creates a new transition with default "replace" style {@link PDTransitionStyle#R}
*/
public PDTransition()
{
this(PDTransitionStyle.R);
}
/**
* creates a new transition with the given style.
*
* @param style t... |
COSBase item = getCOSObject().getItem(COSName.DI);
if (item == null)
{
return COSInteger.ZERO;
}
return item;
| 1,474 | 54 | 1,528 | <methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public boolean equals(java.lang.Object) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public int hashCode() <variables>private final non-sealed org.apache.pdfbox.cos.COSDictionary dictionary |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPageable.java | PDFPageable | getPageFormat | class PDFPageable extends Book
{
private final PDDocument document;
private final int numberOfPages;
private final boolean showPageBorder;
private final float dpi;
private final Orientation orientation;
private boolean subsamplingAllowed = false;
private RenderingHints renderingHints = null;... |
PDPage page = document.getPage(pageIndex);
PDRectangle mediaBox = PDFPrintable.getRotatedMediaBox(page);
PDRectangle cropBox = PDFPrintable.getRotatedCropBox(page);
// Java does not seem to understand landscape paper sizes, i.e. where width > height, it
// always crops ... | 1,251 | 522 | 1,773 | <methods>public void <init>() ,public void append(java.awt.print.Printable, java.awt.print.PageFormat) ,public void append(java.awt.print.Printable, java.awt.print.PageFormat, int) ,public int getNumberOfPages() ,public java.awt.print.PageFormat getPageFormat(int) throws java.lang.IndexOutOfBoundsException,public java.... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/rendering/GlyphCache.java | GlyphCache | getPathForCharacterCode | class GlyphCache
{
private static final Logger LOG = LogManager.getLogger(GlyphCache.class);
private final PDVectorFont font;
private final Map<Integer, GeneralPath> cache = new HashMap<>();
GlyphCache(PDVectorFont font)
{
this.font = font;
}
public GeneralPath getPathForC... |
GeneralPath path = cache.get(code);
if (path != null)
{
return path;
}
try
{
if (!font.hasGlyph(code))
{
String fontName = ((PDFontLike) font).getName();
if (font instanceof PDType0Font)
... | 117 | 450 | 567 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/rendering/SoftMask.java | SoftPaintContext | getRaster | class SoftPaintContext implements PaintContext
{
private final PaintContext context;
SoftPaintContext(PaintContext context)
{
this.context = context;
}
@Override
public ColorModel getColorModel()
{
return ARGB_COLOR_MODEL;
}
... |
Raster raster = context.getRaster(x1, y1, w, h);
ColorModel rasterCM = context.getColorModel();
float[] input = null;
Float[] map = null;
if (transferFunction != null)
{
map = new Float[256];
input = new float[1];
... | 151 | 766 | 917 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/rendering/TilingPaintFactory.java | TilingPaintParameter | equals | class TilingPaintParameter
{
private final Matrix matrix;
private final COSDictionary patternDict;
private final PDColorSpace colorSpace;
private final PDColor color;
private final AffineTransform xform;
private TilingPaintParameter(Matrix matrix, COSDictionary patte... |
if (this == obj)
{
return true;
}
if (!(obj instanceof TilingPaintParameter))
{
return false;
}
final TilingPaintParameter other = (TilingPaintParameter) obj;
if (!Objects.equals(this.matrix,... | 479 | 373 | 852 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java | PDFMarkedContentExtractor | within | class PDFMarkedContentExtractor extends LegacyPDFStreamEngine
{
private boolean suppressDuplicateOverlappingText = true;
private final List<PDMarkedContent> markedContents = new ArrayList<>();
private final Deque<PDMarkedContent> currentMarkedContents = new ArrayDeque<>();
private final Map<String, List... |
return second > first - variance && second < first + variance;
| 1,865 | 18 | 1,883 | <methods>public void processPage(org.apache.pdfbox.pdmodel.PDPage) throws java.io.IOException<variables>private static final non-sealed org.apache.pdfbox.pdmodel.font.encoding.GlyphList GLYPHLIST,private static final Logger LOG,private final Map<org.apache.pdfbox.cos.COSDictionary,java.lang.Float> fontHeightMap,private... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripperByArea.java | PDFTextStripperByArea | extractRegions | class PDFTextStripperByArea extends PDFTextStripper
{
private final List<String> regions = new ArrayList<>();
private final Map<String, Rectangle2D> regionArea = new HashMap<>();
private final Map<String, ArrayList<List<TextPosition>>> regionCharacterList
= new HashMap<>();
private final Map... |
for (String regionName : regions)
{
setStartPage(getCurrentPageNo());
setEndPage(getCurrentPageNo());
// reset the stored text for the region so this class can be reused.
ArrayList<List<TextPosition>> regionCharactersByArticle = new ArrayList<>();
... | 936 | 152 | 1,088 | <methods>public void <init>() ,public boolean getAddMoreFormatting() ,public java.lang.String getArticleEnd() ,public java.lang.String getArticleStart() ,public float getAverageCharTolerance() ,public float getDropThreshold() ,public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getEndB... |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/text/TextPositionComparator.java | TextPositionComparator | compare | class TextPositionComparator implements Comparator<TextPosition>
{
@Override
public int compare(TextPosition pos1, TextPosition pos2)
{<FILL_FUNCTION_BODY>}
} |
// only compare text that is in the same direction
int cmp1 = Float.compare(pos1.getDir(), pos2.getDir());
if (cmp1 != 0)
{
return cmp1;
}
// get the text direction adjusted coordinates
float x1 = pos1.getXDirAdj();
float x2 = pos2.ge... | 54 | 350 | 404 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/util/IterativeMergeSort.java | IterativeMergeSort | sort | class IterativeMergeSort
{
private IterativeMergeSort()
{
// utility class
}
/**
* Sorts this list according to the order induced by the specified
* {@link Comparator}.
*
* @param <T> the class of the objects in the list
* @param list the list to be sorted.
... |
if (list.size() < 2)
{
return;
}
Object[] arr = list.toArray();
iterativeMergeSort(arr, (Comparator) cmp);
ListIterator<T> i = list.listIterator();
for (Object e : arr)
{
i.next();
i.set((T) e);
}
| 842 | 100 | 942 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/util/NumberFormatUtil.java | NumberFormatUtil | formatFloatFast | class NumberFormatUtil
{
/**
* Maximum number of fraction digits supported by the format methods
*/
private static final int MAX_FRACTION_DIGITS = 5;
/**
* Contains the power of ten values for fast lookup in the format methods
*/
private static final long[] POWER_OF_TENS;
privat... |
if (Float.isNaN(value) ||
Float.isInfinite(value) ||
value > Long.MAX_VALUE ||
value <= Long.MIN_VALUE ||
maxFractionDigits > MAX_FRACTION_DIGITS)
{
return -1;
}
int offset = 0;
long integerPart = (long... | 1,193 | 371 | 1,564 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/util/Vector.java | Vector | toString | class Vector
{
private final float x, y;
public Vector(float x, float y)
{
this.x = x;
this.y = y;
}
/**
* Returns the x magnitude.
*
* @return the x magnitude
*/
public float getX()
{
return x;
}
/**
* Returns the y magnitude.
... |
return "(" + x + ", " + y + ")";
| 248 | 18 | 266 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java | Version | getVersion | class Version
{
private static final Logger LOG = LogManager.getLogger(Version.class);
private static final String PDFBOX_VERSION_PROPERTIES =
"/org/apache/pdfbox/resources/version.properties";
private Version()
{
// static helper
}
/**
* Returns the vers... |
try (InputStream resourceAsStream = Version.class.getResourceAsStream(PDFBOX_VERSION_PROPERTIES);
InputStream is = new BufferedInputStream(resourceAsStream))
{
Properties properties = new Properties();
properties.load(is);
return properties.getProp... | 149 | 133 | 282 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/util/XMLUtil.java | XMLUtil | getNodeValue | class XMLUtil
{
/**
* Utility class, should not be instantiated.
*
*/
private XMLUtil()
{
}
/**
* This will parse an XML stream and create a DOM document.
*
* @param is The stream to get the XML from.
* @return The DOM document.
* @throws IOException It there... |
StringBuilder sb = new StringBuilder();
NodeList children = node.getChildNodes();
int numNodes = children.getLength();
for (int i = 0; i < numNodes; i++)
{
Node next = children.item(i);
if (next instanceof Text)
{
sb.append(nex... | 556 | 103 | 659 | <no_super_class> |
apache_pdfbox | pdfbox/pdfbox/src/main/java/org/apache/pdfbox/util/filetypedetector/ByteTrie.java | ByteTrieNode | addPath | class ByteTrieNode<T>
{
private final Map<Byte, ByteTrieNode<T>> children = new HashMap<>();
private T value = null;
public void setValue(T value)
{
if (this.value != null)
{
throw new IllegalStateException("Value already set for this trie nod... |
int depth = 0;
ByteTrieNode<T> node = root;
for (byte[] part : parts)
{
for (byte b : part)
{
ByteTrieNode<T> child = node.children.get(b);
if (child == null)
{
child = new ByteTrieNode<>();
... | 408 | 144 | 552 | <no_super_class> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.