Is that possible?
Is that possible?
Ghostscript.NET (written in C#) is the most completedmanaged wrapper library around the Ghostscript library (32-bit & 64-bit), an interpreter for the PostScript language, PDF, related software and documentation.
Contains:
Other features:
Used in the Ghostscript Studio (Ghostscript IDE)
Samples built on the top of the Ghostscript.NET library:
Ghostscript.NET.Viewer (supports viewing of the PDF, EPS and multi-page PS files)
Direct postscript interpretation via Ghostscript.NET.
Cheers,
Josip Habjan
http://habjan.blogspot.com
Ghostscript.NET (written in C#) is the most completedmanaged wrapper library around the native Ghostscript library (32-bit & 64-bit), an interpreter for the PostScript language, PDF, related software and documentation.
Contains:
Other features:
Used in the Ghostscript Studio (Ghostscript IDE)
Samples built on the top of the Ghostscript.NET library:
Ghostscript.NET.Viewer (supports viewing of the PDF, EPS and multi-page PS files)
Direct postscript interpretation via Ghostscript.NET.
Cheers,
Josip Habjan
http://habjan.blogspot.com
GhostscriptRasterizer rasterizer = new GhostscriptRasterizer();
rasterizer.Open(newFilePath1, gsInfo, false);
Image image = rasterizer.GetPage(300, 300, 1);
image.Save(subDirPath + serCod + "_S1.png");
rasterizer.Close();
rasterizer.Open(newFilePath2, gsInfo, false);
image = rasterizer.GetPage(300, 300, 1);
image.Save(subDirPath + serCod + "_S2.png");
rasterizer.Close();
When I save the first image it shows like a blank page and the file name is the same of newFilePath1 without .pdf but with .png. string printerName = "MyPrinter";
string inputFile = @"C:\my.pdf";
List<string> switches = new List<string> { "-empty",
"-sDEVICE=mswinpr2",
"-dBATCH",
"-dNOPAUSE",
"-dNOPROMPT",
"-dNoCancel",
@"-sOutputFile=""%printer%" + printerName+@"""",
"-q",
"-f", inputFile };
wich is the same i use on bashgswin32c.exe -dBATCH -dNOPAUSE -dNOPROMPT -dNoCancel -sDEVICE=mswinpr2 -sOutputFile="%printer%MyPrinter" -q -f "C:\my.pdf"
If you need more info please ask.string gsExecutable = string.Format(@"{0}", _config.GhostScript_Executable_Path);
string gsViewExecutable = string.Format(@"{0}", _config.GSView_Executable_Path);
string printerName = _config.MyPrinterName;
string processArgs = string.Format("-ghostscript \"{0}\" -dPDFFitPage -copies=1 -all -printer \"{1}\" \"{2}\"", gsExecutable, printerName, PDFFilePath);
var gsProcessInfo = new ProcessStartInfo
{
WindowStyle = ProcessWindowStyle.Hidden,
FileName = gsViewExecutable,
Arguments = processArgs
};
using (var gsProcess = Process.Start(gsProcessInfo))
{
gsProcess.WaitForExit();
gsProcess.Disposed += (ps, pe) =>
{
//Printing success!!
};
}
I'm wondering now how I can achive this with the Ghostscript.NET library? Can someone help me with an example for the things I'm already doing in a Ghostscript.NET way?Ghostscript.NET (written in C#) is the most completedmanaged wrapper library around the native Ghostscript library (32-bit & 64-bit), an interpreter for the PostScript language, PDF, related software and documentation.
Contains:
Other features:
If Ghostscript.NET has been helpful to you, consider donating.
Used in the Ghostscript Studio (Ghostscript IDE)
Samples built on the top of the Ghostscript.NET library:
Ghostscript.NET.Viewer (supports viewing of the PDF, EPS and multi-page PS files)
Direct postscript interpretation via Ghostscript.NET.
Cheers,
Josip Habjan
http://habjan.blogspot.com
Ghostscript.NET (written in C#) is the most completedmanaged wrapper library around the native Ghostscript library (32-bit & 64-bit), an interpreter for the PostScript language, PDF, related software and documentation.
Contains:
Other features:
Used in the Ghostscript Studio (Ghostscript IDE)
Samples built on the top of the Ghostscript.NET library:
Ghostscript.NET.Viewer (supports viewing of the PDF, EPS and multi-page PS files)
Direct postscript interpretation via Ghostscript.NET.
Cheers,
Josip Habjan
http://habjan.blogspot.com