From ed449878dd58cbbad014790ac7d3931398e42dc8 Mon Sep 17 00:00:00 2001 From: Alberto Fernandez Date: Mon, 20 Nov 2017 20:53:15 +0100 Subject: [PATCH] Allow to read from stdin. https://sources.debian.net/patches/libitext-java/2.1.7-11/01_allow_standard_input.patch/ --- .../com/lowagie/text/pdf/RandomAccessFileOrArray.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openpdf/src/main/java/com/lowagie/text/pdf/RandomAccessFileOrArray.java b/openpdf/src/main/java/com/lowagie/text/pdf/RandomAccessFileOrArray.java index 753da6593..ba4886c94 100755 --- a/openpdf/src/main/java/com/lowagie/text/pdf/RandomAccessFileOrArray.java +++ b/openpdf/src/main/java/com/lowagie/text/pdf/RandomAccessFileOrArray.java @@ -101,7 +101,13 @@ public RandomAccessFileOrArray(String filename, boolean forceRead, boolean plain } } else { - InputStream is = BaseFont.getResourceStream(filename); + InputStream is = null; + if ("-".equals(filename)) { + is = System.in; + } + else { + is = BaseFont.getResourceStream(filename); + } if (is == null) throw new IOException(MessageLocalization.getComposedMessage("1.not.found.as.file.or.resource", filename)); try {