Quantcast
Channel: Ghostscript.NET
Viewing all articles
Browse latest Browse all 393

New Post: Converting from PS to PDF format using memorystream data c#

$
0
0
Hi,

I have requirement where i am getting the data from printer in a PS format, and i want that to be converted to pdf.
data is in the form of bytearray, what is the best way to accomplish this using Ghostlibrary.
i am using right now latest version of gs
1.1.8.
OS is windows 8, 64 bit.
gs installed is 9.09

i tried using different classes of gs but nothing worked.

using (var rasterizer = new GhostscriptRasterizer())
                                using (var memoryStream = new MemoryStream(bytes))
                                {
                                    memoryStream.Seek(0, SeekOrigin.Begin);
                                    GhostscriptVersionInfo gv = GhostscriptVersionInfo.GetLastInstalledVersion();
                                    rasterizer.Open(memoryStream, gv, false);
}

this fails with error "Stream format is not valid! Please make sure it's PDF, PS or EPS."

whatever data i get from print command i am passing to above method, and that is not working.
Is there any best reference i get to make this work.?

Regards
Roshan sullad

Viewing all articles
Browse latest Browse all 393

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>