Skip to content

Commit d1af992

Browse files
committed
PDFBOX-6108: add minimal getters
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930105 13f79535-47bb-0310-9956-ffa450edef68
1 parent f7411f0 commit d1af992

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

xmpbox/src/main/java/org/apache/xmpbox/type/DimensionsType.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,34 @@ public DimensionsType(XMPMetadata metadata)
4242
super(metadata);
4343
}
4444

45+
public Float getH()
46+
{
47+
AbstractField prop = getProperty(H);
48+
if (prop instanceof RealType)
49+
{
50+
return ((RealType) prop).getValue();
51+
}
52+
return null;
53+
}
54+
55+
public Float getW()
56+
{
57+
AbstractField prop = getProperty(W);
58+
if (prop instanceof RealType)
59+
{
60+
return ((RealType) prop).getValue();
61+
}
62+
return null;
63+
}
64+
65+
public String getUnit()
66+
{
67+
return getPropertyValueAsString(UNIT);
68+
}
69+
70+
@Override
71+
public String toString()
72+
{
73+
return "DimensionsType{" + getW() + " x " + getH() + " " + getUnit() + '}';
74+
}
4575
}

0 commit comments

Comments
 (0)