CefPdfPrintCallback.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. namespace Xilium.CefGlue
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.Runtime.InteropServices;
  7. using Xilium.CefGlue.Interop;
  8. /// <summary>
  9. /// Callback interface for CefBrowserHost::PrintToPDF. The methods of this class
  10. /// will be called on the browser process UI thread.
  11. /// </summary>
  12. public abstract unsafe partial class CefPdfPrintCallback
  13. {
  14. private void on_pdf_print_finished(cef_pdf_print_callback_t* self, cef_string_t* path, int ok)
  15. {
  16. CheckSelf(self);
  17. var m_path = cef_string_t.ToString(path);
  18. OnPdfPrintFinished(m_path, ok != 0);
  19. }
  20. /// <summary>
  21. /// Method that will be executed when the PDF printing has completed. |path|
  22. /// is the output path. |ok| will be true if the printing completed
  23. /// successfully or false otherwise.
  24. /// </summary>
  25. protected abstract void OnPdfPrintFinished(string path, bool ok);
  26. }
  27. }