Exemplo n.º 1
0
        /// <summary>
        /// Print the current browser contents to the PDF file specified by |path| and
        /// execute |callback| on completion. The caller is responsible for deleting
        /// |path| when done. For PDF printing to work on Linux you must implement the
        /// CfxPrintHandler.GetPdfPaperSize function.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_browser_capi.h">cef/include/capi/cef_browser_capi.h</see>.
        /// </remarks>
        public void PrintToPdf(string path, CfxPdfPrintSettings settings, CfxPdfPrintCallback callback)
        {
            var path_pinned = new PinnedString(path);

            CfxApi.cfx_browser_host_print_to_pdf(NativePtr, path_pinned.Obj.PinnedPtr, path_pinned.Length, CfxPdfPrintSettings.Unwrap(settings), CfxPdfPrintCallback.Unwrap(callback));
            path_pinned.Obj.Free();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Print the current browser contents to the PDF file specified by |path| and
 /// execute |callback| on completion. The caller is responsible for deleting
 /// |path| when done. For PDF printing to work on Linux you must implement the
 /// CfxPrintHandler.GetPdfPaperSize function.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_browser_capi.h">cef/include/capi/cef_browser_capi.h</see>.
 /// </remarks>
 public void PrintToPdf(string path, CfxPdfPrintSettings settings, CfxPdfPrintCallback callback)
 {
     var path_pinned = new PinnedString(path);
     CfxApi.cfx_browser_host_print_to_pdf(NativePtr, path_pinned.Obj.PinnedPtr, path_pinned.Length, CfxPdfPrintSettings.Unwrap(settings), CfxPdfPrintCallback.Unwrap(callback));
     path_pinned.Obj.Free();
 }