You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the following: gswin64c -dNODISPLAY -q -sFile="test.PDF" pdf_info.ps
has the following output:
test.PDF has 1 page.
Title: 120906_DACHSER_CMYK
Creator: Adobe Illustrator CS5
Producer: Adobe PDF library 9.90
CreationDate: D:20121017105900+02'00'
ModDate: D:20121017105900+02'00'
Page 1 MediaBox: [0.0 0.0 157.833 34.666] BleedBox: [0.0 0.0 157.833 34.666] TrimBox: [0.0 0.0 157.833 34.666] ArtBox: [2.76025 1.92285 155.824 31.4028]
No system fonts are needed.
The GhostScript processor throws an exception with the following stacktrace:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Ghostscript.NET.Processor.GhostscriptProcessor.ProcessOutputLine(String line) in R:\EDENRED\Ghostscript.NET\Ghostscript.NET-master\Ghostscript.NET\Processor\GhostscriptProcessor.cs:line 462
at Ghostscript.NET.Processor.GhostscriptProcessor.OnStdIoOutput(String output) in R:\EDENRED\Ghostscript.NET\Ghostscript.NET-master\Ghostscript.NET\Processor\GhostscriptProcessor.cs:line 407
at Ghostscript.NET.Processor.GhostscriptProcessorInternalStdIOHandler.StdOut(String output) in R:\EDENRED\Ghostscript.NET\Ghostscript.NET-master\Ghostscript.NET\Processor\GhostscriptProcessorInternalStdIOHandler.cs:line 51
at Ghostscript.NET.GhostscriptStdIO.gs_std_out(IntPtr handle, IntPtr pointer, Int32 count) in R:\EDENRED\Ghostscript.NET\Ghostscript.NET-master\Ghostscript.NET\GhostscriptStdIO.cs:line 173
Code sample:
using (GhostscriptProcessor processor = new GhostscriptProcessor(gv, true))
{
List<string> switches = new List<string>();
switches.Add("-q");
switches.Add("-dNODISPLAY");
switches.Add(@"-sFile=" + fileName);
switches.Add("pdf_info.ps");
// if you don't want to handle stdio, you can pass 'null' value as the last parameter
StdIOHandler stdio = new StdIOHandler(_output, _error);
processor.StartProcessing(switches.ToArray(), stdio);
string output = _output.ToString();
}
The stdio class used is this:
public class StdIOHandler : GhostscriptStdIO
{
private StringBuilder _output = null;
private StringBuilder _error = null;
public StdIOHandler(StringBuilder output, StringBuilder error)
: base(true, true, true)
{
_output = output;
_error = error;
}
public override void StdIn(out string input, int count)
{
input = null;
}
public override void StdOut(string output)
{
if (_output != null)
{
_output.Append(output);
}
}
public override void StdError(string error)
{
if (_error != null)
{
_error.Append(error);
}
}
}
The exception is due to the current page parsing algorithm used here:
Hi,
Running the following:
gswin64c -dNODISPLAY -q -sFile="test.PDF" pdf_info.ps
has the following output:
The GhostScript processor throws an exception with the following stacktrace:
Code sample:
The stdio class used is this:
The exception is due to the current page parsing algorithm used here:
for the line:
Page 1 MediaBox: [0.0 0.0 157.833 34.666] BleedBox: [0.0 0.0 157.833 34.666] TrimBox: [0.0 0.0 157.833 34.666] ArtBox: [2.76025
The next token after 'Page' should be checked in this case.
Regards,
Mike
The text was updated successfully, but these errors were encountered: