示例#1
0
        public byte[] GetConversionResult(IntPtr converter)
        {
            var length = WkHtmlToXBindings.wkhtmltopdf_get_output(converter, out var resultPointer);

            var result = new byte[length];

            Marshal.Copy(resultPointer, result, 0, length);

            return(result);
        }
示例#2
0
        public void Load()
        {
            if (isLoaded)
            {
                return;
            }

            if (WkHtmlToXBindings.wkhtmltopdf_init(0) == 1)
            {
                isLoaded = true;
            }
        }
示例#3
0
 public void Dispose()
 {
     WkHtmlToXBindings.wkhtmltopdf_deinit();
 }
示例#4
0
 public string GetProgressString(IntPtr converter)
 {
     return(Marshal.PtrToStringAnsi(WkHtmlToXBindings.wkhtmltopdf_progress_string(converter)));
 }
示例#5
0
 public string GetPhaseDescription(IntPtr converter, int phase)
 {
     return(Marshal.PtrToStringAnsi(WkHtmlToXBindings.wkhtmltopdf_phase_description(converter, phase)));
 }
示例#6
0
 public int GetCurrentPhase(IntPtr converter)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_current_phase(converter));
 }
示例#7
0
 public IntPtr CreateConverter(IntPtr globalSettings)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_create_converter(globalSettings));
 }
示例#8
0
 public int SetGlobalSetting(IntPtr settings, string name, string value)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_set_global_setting(settings, name, value));
 }
示例#9
0
 public int SetFinishedCallback(IntPtr converter, IntCallback callback)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_set_finished_callback(converter, callback));
 }
示例#10
0
 public int SetProgressChangedCallback(IntPtr converter, VoidCallback callback)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_set_progress_changed_callback(converter, callback));
 }
示例#11
0
 public void DestroyConverter(IntPtr converter)
 {
     WkHtmlToXBindings.wkhtmltopdf_destroy_converter(converter);
 }
示例#12
0
 public bool DoConversion(IntPtr converter)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_convert(converter));
 }
示例#13
0
 public void AddObject(IntPtr converter, IntPtr objectSettings, byte[] data)
 {
     WkHtmlToXBindings.wkhtmltopdf_add_object(converter, objectSettings, data);
 }
示例#14
0
 public string GetLibraryVersion()
 {
     return(Marshal.PtrToStringAnsi(WkHtmlToXBindings.wkhtmltopdf_version()));
 }
示例#15
0
 public int SetErrorCallback(IntPtr converter, StringCallback callback)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_set_error_callback(converter, callback));
 }
示例#16
0
 public IntPtr CreateGlobalSettings()
 {
     return(WkHtmlToXBindings.wkhtmltopdf_create_global_settings());
 }
示例#17
0
 public int GetPhaseCount(IntPtr converter)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_phase_count(converter));
 }
示例#18
0
 public IntPtr CreateObjectSettings()
 {
     return(WkHtmlToXBindings.wkhtmltopdf_create_object_settings());
 }
示例#19
0
 public int SetObjectSetting(IntPtr settings, string name, string value)
 {
     return(WkHtmlToXBindings.wkhtmltopdf_set_object_setting(settings, name, value));
 }