PrintToPDF - Scaling, Zoom

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

PrintToPDF - Scaling, Zoom

Postby tslate » Tue Apr 24, 2018 12:45 pm

Hi,

It seems the zoom level set on the browser page and print to PDF have no relationship.

Browser View: No horiz scrollbar for a grid/table, all columns appear in main view.
PrintToPDF: Horiz scrollbar added on grid and a couple columns to the right disappear.

A grid/table appears with all columns in the browser page w/o horizontal scroll bar but when printed some of the right columns disappear and a horizontal scroll bar appears in the PDF.

I've used a small zoom (-3.5 to -2.5) to remove horizontal scrollbars on the browser page but when printed the horizontal scrollbars appear no matter what the print scaling is and some right columns are always removed from output.

I use landscape, no margins, scale to 75% for print settings and the final PDF dimensions are 11 X 8.5 and it prints in landscape on a printer but with a scrollbar and columns missing to the right.

Is there something else I need to do to have the browser view and print view the same or have print to PDF use the full 11 inches of space? Scaling 100% uses all space with bars, 75% is 3/4 page with bars. Nothing seems to work. I was going to try and impose JS overflow CSS but not sure that would work to inject after the fact and for many different tables and pages. Since the print to PDF is not the same as browser view the CSS would probably not work.

Browser font size did not help, set to 8 using createbrowser settings.

By comparison std Chrome browser, ctrl+p, set to 75% and landscape, will zoom and remove scrollbars and print to foxit w/o bars and/or save to pdf w/o bars with all grid columns appearing.

Thanks

CEF: cef_binary_3.3071.1649.g98725e6_windows64
OS Windows 7 SP1, VS 2017.
Windows Server 2016, etc.
tslate
Techie
 
Posts: 32
Joined: Wed Jul 19, 2017 12:47 pm

Re: PrintToPDF - Scaling, Zoom

Postby tslate » Wed Apr 25, 2018 7:46 am

The work around is to use zoom through JS. The PDF print feature does honor the zoom level set through JS but the SetZoomLevel does not.
tslate
Techie
 
Posts: 32
Joined: Wed Jul 19, 2017 12:47 pm


Return to Support Forum

Who is online

Users browsing this forum: Biohazard, Google [Bot], Majestic-12 [Bot] and 69 guests