iTextSharp读取文件> 1GB

时间:2015-03-12 19:02:51

标签: c# pdf c#-4.0 itextsharp

我正在尝试从deflate流中读取存储在数据库中的PDF。到目前为止,它已经处理了数万个文件,但是现在我已经成功了,它只是在新的PdfReader行上闲置:

byte raw = reader.GetSqlBinary(reader.GetOrdinal("doc_data")).Value;
using(Stream stream = new MemoryStream(raw)){
stream.ReadByte();//read I need to do this is another
stream.ReadByte();//SO post, it breaks without it
using(DeflateStream d_Stream = new DeflateStream(stream, CompressionMode.Decompress))
using(pdfreader=new PdfReader(new iTextSharp.text.pdf.RandomAccessFileOrArray(d_Stream),null))//sits here and doesn't do anything

我还应该为大文件做些什么吗?也许以不同的方式处理RandomAccessFileOrArray?它确实告诉我它已经过时了,但无法通过流找到更好的方法。
PDFReader是否有最大尺寸?我读取的文件不到GB,但也可能有更大的文件。

0 个答案:

没有答案