Пример #1
0
        /// <summary>
        /// Set the printer printable area in device units.
        /// Some platforms already provide flipped area. Set |landscape_needs_flip|
        /// to false on those platforms to avoid double flipping.
        /// </summary>
        public void SetPrinterPrintableArea(CefSize physicalSizeDeviceUnits, CefRectangle printableAreaDeviceUnits, bool landscapeNeedsFlip)
        {
            var n_physicalSizeDeviceUnits = new cef_size_t(
                physicalSizeDeviceUnits.Width,
                physicalSizeDeviceUnits.Height
                );

            var n_printableAreaDeviceUnits = new cef_rect_t(
                printableAreaDeviceUnits.X,
                printableAreaDeviceUnits.Y,
                printableAreaDeviceUnits.Width,
                printableAreaDeviceUnits.Height
                );

            cef_print_settings_t.set_printer_printable_area(
                _self,
                &n_physicalSizeDeviceUnits,
                &n_printableAreaDeviceUnits,
                landscapeNeedsFlip ? 1 : 0
                );
        }
Пример #2
0
 public static void set_printer_printable_area(cef_print_settings_t* self, cef_size_t* physical_size_device_units, cef_rect_t* printable_area_device_units, int landscape_needs_flip)
 {
     set_printer_printable_area_delegate d;
     var p = self->_set_printer_printable_area;
     if (p == _p8) { d = _d8; }
     else
     {
         d = (set_printer_printable_area_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_printer_printable_area_delegate));
         if (_p8 == IntPtr.Zero) { _d8 = d; _p8 = p; }
     }
     d(self, physical_size_device_units, printable_area_device_units, landscape_needs_flip);
 }