From 2b1071cd5375e13211ec0af6a3a37cd1f8e01cce Mon Sep 17 00:00:00 2001 From: ooKriangsaKoo Date: Sat, 25 Nov 2017 01:36:39 +0700 Subject: [PATCH] fix from https://github.com/LibrePDF/OpenPDF/pull/57 --- .../iTextSharp/text/pdf/RandomAccessFileOrArray.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/RandomAccessFileOrArray.cs b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/RandomAccessFileOrArray.cs index 559bcaf..b536239 100644 --- a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/RandomAccessFileOrArray.cs +++ b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/RandomAccessFileOrArray.cs @@ -57,7 +57,17 @@ public RandomAccessFileOrArray(string filename, bool forceRead) } else { - Stream isp = BaseFont.GetResourceStream(filename); + //Stream isp = BaseFont.GetResourceStream(filename); + Stream isp = null; + if ("-".Equals(filename)) + { + isp = ((StreamReader)Console.In).BaseStream; + } + else + { + isp = BaseFont.GetResourceStream(filename); + } + if (isp == null) throw new IOException(filename + " not found as file or resource."); try