public static byte[] GetConverterResult(IntPtr converter) { Tracer.Trace("T:" + Thread.CurrentThread.Name + " Requesting converter result (wkhtmltopdf_get_output)"); IntPtr tmp; var len = PechkinBindings.wkhtmltopdf_get_output(converter, out tmp); var output = new byte[len]; Marshal.Copy(tmp, output, 0, output.Length); return(output); }
public static byte[] GetConverterResult(IntPtr converter) { /* * IntPtr unmanagedBuf; * long length = PechkinBindings.wkhtmltopdf_get_output(converter, out unmanagedBuf); * byte[] buf = new byte[length]; * Marshal.Copy(unmanagedBuf, buf, 0, buf.Length); * * return buf; */ if (Log.IsTraceEnabled) { Log.Trace("T:" + Thread.CurrentThread.Name + " Requesting converter result (wkhtmltopdf_get_output)"); } var len = PechkinBindings.wkhtmltopdf_get_output(converter, out IntPtr tmp); var output = new byte[len]; Marshal.Copy(tmp, output, 0, output.Length); return(output); }