CefPdfPrintSettings MarginType.Custom

Having problems with building or using the JCEF Java binding? Ask your questions here.

CefPdfPrintSettings MarginType.Custom

Postby NL18 » Tue Aug 21, 2018 6:00 am

Hi,

I am trying to export a pdf from JCEF. Since my browser window is in a resizable Panel I need to adjust the image size to keep the correct aspect ratio. I am doing this by specifying MarginType.Custom in the CefPdfPrintSettings and setting the margins via the margin_* properties.

The comment in CefPdfPrintSettings.java suggests that these values are im millimeters. However, this does not appear to be true because when looking and measuring in the resulting pdf file, the margins in millimeter are roughly 1/3 the value that was specified in the properties. Did anybody else notice this and knows if this is a documentation or an implementaion problem?

Thanks for any help!
NL18
Newbie
 
Posts: 1
Joined: Tue Aug 21, 2018 5:42 am

Re: CefPdfPrintSettings MarginType.Custom

Postby arrgh » Fri Jun 14, 2019 3:05 pm

I realize this is old but I thought I'd comment on it since I had this issue too. I remember digging around for this; I think I remember seeing it in Skia's documentation. Anyway you're right, the CEF documentation is incorrect - the margins are specified in points (1 pt = 1/72 inch). For example if you wanted a 1/2 inch margin you'd set the margin to 36.
arrgh
Newbie
 
Posts: 1
Joined: Fri Jun 14, 2019 2:50 pm

Re: CefPdfPrintSettings MarginType.Custom

Postby thomat65 » Thu Jun 27, 2019 10:25 am

arrgh wrote:the CEF documentation is incorrect - the margins are specified in points (1 pt = 1/72 inch). For example if you wanted a 1/2 inch margin you'd set the margin to 36.

FWIW I created this issue for CEF because I stubbed my toe on it, too: https://bitbucket.org/chromiumembedded/ ... -in-points
thomat65
Newbie
 
Posts: 1
Joined: Thu Jun 27, 2019 10:22 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 10 guests