Skip to content

Commit 1dcdfd2

Browse files
committed
PDFBOX-5660: close input, as suggested by Valery Bokov; closes #294
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1929371 13f79535-47bb-0310-9956-ffa450edef68
1 parent e050835 commit 1dcdfd2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePDFA.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,12 @@ public static void main(String[] args) throws IOException, TransformerException
118118
}
119119

120120
// sRGB output intent
121-
InputStream colorProfile = CreatePDFA.class.getResourceAsStream(
122-
"/org/apache/pdfbox/resources/pdfa/sRGB.icc");
123-
PDOutputIntent intent = new PDOutputIntent(doc, colorProfile);
121+
PDOutputIntent intent;
122+
try (InputStream colorProfile = CreatePDFA.class.getResourceAsStream(
123+
"/org/apache/pdfbox/resources/pdfa/sRGB.icc"))
124+
{
125+
intent = new PDOutputIntent(doc, colorProfile);
126+
}
124127
intent.setInfo("sRGB IEC61966-2.1");
125128
intent.setOutputCondition("sRGB IEC61966-2.1");
126129
intent.setOutputConditionIdentifier("sRGB IEC61966-2.1");

0 commit comments

Comments
 (0)