Forum How do I...?

Line-height with percentage or em size

zambadu
Hi,

I'm setting a line-height with css to 128% or 1.28em (I have tried both) to get it adjusted to the font-size.
This works well in the browser and in PDFs with 72 dpi. But when I generate the PDF with same HTML with 300 dpi, the line-height seems to be stay in value of 72 dpi. The Font-size is calculated correctly with 300dpi, it seems that just the line-height is not calculated.

Is there a way to achieve this correct?

Thanks in advance.

Edited by zambadu

mikeday
Are you using the --css-dpi option? How are you specifying the font-size? Can you attach a small example HTML/CSS?
zambadu
Hi Mike,

I'm using the php class
$prince->setHTML(true);
	
$prince->convert_string_to_file($dpi,$html_content,$pdf)


the HTML is as follow:

<p class="para" editable style="font-size:14px">Lorem Ipsum<br>Lorem Ipsum<br>Lorem Ipsum</p>


The font-size can be changed by the user via an online-editor. Also can the user add more lines, which is made with clone

The css:
.para{
line-height:128%;
-webkit-box-decoration-break: clone;
  -o-box-decoration-break: clone;
  box-decoration-break: clone;
background-color:#fff;
display:inline-block;
padding:5px;
}


Hope this is helpful.
zambadu
Any news about this topic?
dauwhe
The attached PDF looks as I would expect. Are you seeing something different?
  1. lineheight.pdf15.0 kB