pdf.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright 2010 wkhtmltopdf authors
  2. //
  3. // This file is part of wkhtmltopdf.
  4. //
  5. // wkhtmltopdf is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // wkhtmltopdf is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with wkhtmltopdf. If not, see <http://www.gnu.org/licenses/>.
  17. #ifndef __PDF_H__
  18. #define __PDF_H__
  19. #include <wkhtmltox/dllbegin.inc>
  20. struct wkhtmltopdf_global_settings;
  21. typedef struct wkhtmltopdf_global_settings wkhtmltopdf_global_settings;
  22. struct wkhtmltopdf_object_settings;
  23. typedef struct wkhtmltopdf_object_settings wkhtmltopdf_object_settings;
  24. struct wkhtmltopdf_converter;
  25. typedef struct wkhtmltopdf_converter wkhtmltopdf_converter;
  26. typedef void (*wkhtmltopdf_str_callback)(wkhtmltopdf_converter * converter, const char * str);
  27. typedef void (*wkhtmltopdf_int_callback)(wkhtmltopdf_converter * converter, const int val);
  28. typedef void (*wkhtmltopdf_bool_callback)(wkhtmltopdf_converter * converter, const bool val);
  29. typedef void (*wkhtmltopdf_void_callback)(wkhtmltopdf_converter * converter);
  30. CAPI wkhtmltopdf_global_settings * wkhtmltopdf_create_global_settings();
  31. CAPI wkhtmltopdf_object_settings * wkhtmltopdf_create_object_settings();
  32. CAPI int wkhtmltopdf_set_global_option(wkhtmltopdf_global_settings * settings, const char * name, const char * value);
  33. CAPI int wkhtmltopdf_get_global_option(wkhtmltopdf_global_settings * settings, const char * name, char * value, int vs);
  34. CAPI int wkhtmltopdf_set_object_option(wkhtmltopdf_object_settings * settings, const char * name, const char * value);
  35. CAPI int wkhtmltopdf_get_object_option(wkhtmltopdf_object_settings * settings, const char * name, char * value, int vs);
  36. CAPI wkhtmltopdf_converter * wkhtmltopdf_create_converter(wkhtmltopdf_global_settings * settings);
  37. CAPI void wkhtmltopdf_destroy_converter(wkhtmltopdf_converter * converter);
  38. CAPI void wkhtmltopdf_set_warning_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_str_callback * cb);
  39. CAPI void wkhtmltopdf_set_error_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_str_callback * cb);
  40. CAPI void wkhtmltopdf_set_phase_changed_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_void_callback * cb);
  41. CAPI void wkhtmltopdf_set_progress_changed_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_int_callback * cb);
  42. CAPI void wkhtmltopdf_set_finished_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_bool_callback * cb);
  43. CAPI void wkhtmltopdf_begin_convertion(wkhtmltopdf_converter * converter);
  44. CAPI bool wkhtmltopdf_convert(wkhtmltopdf_converter * converter);
  45. CAPI void wkhtmltopdf_cancel(wkhtmltopdf_converter * converter);
  46. CAPI void wkhtmltopdf_add_resource(
  47. wkhtmltopdf_converter * converter, wkhtmltopdf_object_settings * setting, const char * data=0);
  48. CAPI int wkhtmltopdf_current_phase(wkhtmltopdf_converter * converter);
  49. CAPI int wkhtmltopdf_phase_count(wkhtmltopdf_converter * converter);
  50. CAPI const char * wkhtmltopdf_phase_description(wkhtmltopdf_converter * converter, int phase);
  51. CAPI const char * wkhtmltopdf_progress_string(wkhtmltopdf_converter * converter);
  52. CAPI int wkhtmltopdf_http_error_code(wkhtmltopdf_converter * converter);
  53. #include <wkhtmltox/dllend.inc>
  54. #endif //__PDF_H__