Absolutely stumped, decompressing huge PDF from SQL DB, and using iTextSharp to read it.

Not sure if this is the right place to ask questions, but I already tried SO and they didn't really help. So here goes.

Just like the title says, I have code like so:

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 

I recently moved it to framework 4.5 so I could try the "gcAllowVeryLargeObjects" in app.config, and it still just sits there. The memory usage fluctuates from around 5gb to 10gb, and then back down again, while seemingly just sitting on that line. I don't get a OutOfMemoryException. I don't get anything. It just sits there, and tries and tries.

I don't know where else to ask questions of this nature, so if this is the wrong place, please just tell me where I should post such things, and I'll remove this post. Here is the link to my SO question, in case that provides any more insight.

http://ift.tt/1EoezhP

Any help would be extremely appreciated!

by TheForceIsWeakWithTh via /r/csharp

Leave a Reply