open PDF from Memorystream?

Nov 14, 2013 at 4:47 PM
I'm using GhostscriptRasterizer trying to export PDF pages to the System.Drawing.Image object in memory.
Is it possible to load PDF as object in memory too? example as memorystream (instead of @"F:\pdf\155.pdf")


Nov 15, 2013 at 4:42 PM
I have been trying to figure this out for a couple of weeks.
I generate a PDF byte[] via ExpertPDF, and need render it immediately as a .png with GhostscriptRasterizer.
Am currently writing/reading a temp file to disk, and this works OK in my development environment,
but has problems on my production server because of file access permissions.

Ciao Luca. Ho provato di capire questo per un paio di settimane. A generare un PDF byte[] via ExpertPDF, e necessario rendere immediatamente come .png con GhostscriptRasterizer. Sono attualmente iscritto/lettura di un file temporaneo sul disco, e questo funziona bene nel mio ambiente di sviluppo, ma ha dei problemi sul mio server di produzione a causa di autorizzazioni di accesso ai file.
Nov 18, 2013 at 8:23 AM
Hi both,

New release of the Ghostscript.NET will be available in day or two.
It will have ability to use GhostscriptRasterizer with MemoryStream.

Nov 18, 2013 at 8:41 AM
great news
Dec 11, 2013 at 12:10 PM
Hi! Is this possibility already available? (+1 for this) Thx.
Dec 11, 2013 at 5:58 PM
Hi all,

I did a little research, and the thing is that the PDF language, unlike the PostScript language, inherently requires random access to the file. If you provide PDF directly to Standard Input or via PIPE, Ghostscript will copy it to a temporary file before interpreting the PDF. So, there is no point of passing PDF as MemoryStream (or byte array) as it will anyway end up on the disk before it will be interpreted.