Closed hopfen-heiner closed 4 months ago
CEF PrintToPDF uses the same code as DevTools Page.printToPDF. If that's not working you can file a bug with Chromium at https://crbug.com/new.
Check the CSS margin configuration in your source HTML page. This works for me at M124:
CefPdfPrintSettings settings;
settings.margin_type = PDF_PRINT_MARGIN_NONE;
settings.print_background = true;
Custom margins are ignored when printing to PDF. Original issue (not mine) for CefSharp (which still exists in version 121): https://github.com/cefsharp/CefSharp/issues/4466 I've only reproduced it with CefSharp WPF myself.
Steps to reproduce the behavior: Print some HTML to PDF with margin_left set to 1 and margin_type set to Custom. The printed text is still placed at the very left.
Expected behavior The text is printed with a 1" margin to the left.
Versions: