Exemplo n.º 1
0
        public unsafe string GetGlobalSetting(IntPtr setting, string name)
        {
            Tracer.Trace("T:" + Thread.CurrentThread.Name + " Getting global setting (wkhtmltoimage_get_global_setting)");

            byte[] buf = new byte[2048];

            fixed(byte *p = buf)
            {
                WkhtmltoxBindings.wkhtmltoimage_get_global_setting(setting, name, p, buf.Length);
            }

            int walk = 0;

            while (walk < buf.Length && buf[walk] != 0)
            {
                walk++;
            }

            return(Encoding.UTF8.GetString(buf, 0, walk));
        }