Forum Bugs

text-align: justify does not work with white-space: pre-wrap when generating PDF

qnguyen
When I generated this html to pdf with white-space: pre-wrap; and text-align: justify; the justify didn't take effect in the output pdf document.
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style>
          span.text-span {
            white-space: pre-wrap;
          }
        </style>

<style>
        .txtNormal {font-family: Helvetica, Arial, sans-serif !important;
                    color: #67727e;
                    font-size: 16px;
        }
        .txtNormalBold {font-family: Helvetica, Arial, sans-serif !important;
                        font-weight: bold;
                        color: #67727e;
                        font-size: 16px;
        }
        .text-alignJustify {text-align:justify;
                            width:660px;
        }
</style>
<style>
.firepad-b {
  font-weight: bold; }

.firepad-i {
  font-style: italic; }

.firepad-u {
  text-decoration: underline; }

.firepad-s {
  text-decoration: line-through; }

.firepad-u.firepad-s {
  text-decoration: underline line-through; }
</style>
</head><body data-new-gr-c-s-check-loaded="14.1015.0" data-gr-ext-installed=""><div id="document-container"><div>

		<div class="object container-object"><div class="object text-object  text-alignJustify"><div class="text-line "><span class="text-span">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et odio in ex interdum vestibulum. Donec gravida, mauris ut molestie pharetra, enim nunc gravida est, sit amet dignissim felis felis quis ex. Aenean a feugiat lacus, in hendrerit ex. Morbi dignissim urna ut mattis gravida. Fusce a aliquet elit, et elementum urna. Etiam posuere dictum placerat. Donec condimentum nulla nisl, eu eleifend nisi efficitur in. Sed fermentum sit amet massa nec laoreet. Nulla tincidunt quis purus quis pretium. Sed tortor lacus, mollis at vestibulum at, interdum a massa. Ut id mi placerat, finibus felis non, cursus lorem. Donec cursus dui luctus, maximus sapien id, tristique turpis. Nam posuere leo et felis pharetra, nec molestie magna elementum. Sed non nisi enim. Nam condimentum ipsum id lacus efficitur auctor.</span></div><div class="text-line"><span style="white-space:pre-wrap">&nbsp;</span></div><div class="text-line "><span class="text-span">Mauris et aliquam ipsum. Praesent id eleifend lacus. Donec lorem dui, congue sit amet molestie eget, fermentum in arcu. Fusce scelerisque quam hendrerit varius posuere. Nam ultricies at felis at gravida. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras dignissim a velit quis accumsan. Donec fermentum mollis porttitor. Nam fringilla lacinia neque, tristique luctus nunc consequat vel. Nunc at faucibus tortor. Integer viverra feugiat facilisis. Duis sagittis tempus neque at tempus. Vivamus magna massa, faucibus sed elit sit amet, eleifend ultricies augue.</span></div><div class="text-line"><span style="white-space:pre-wrap">&nbsp;</span></div><div class="text-line "><span class="text-span">Proin vehicula tortor rutrum lorem pretium elementum. Donec porta id augue eget bibendum. Morbi id velit auctor, pharetra ligula vitae, placerat urna. Nulla tempor, purus non fringilla ullamcorper, nunc ex venenatis nisl, vel iaculis metus magna eu odio. Ut tempus, mi non egestas ornare, nisi ex facilisis nulla, ut scelerisque enim arcu sodales erat. Donec accumsan nisl nec leo faucibus, eu pharetra augue gravida. Phasellus sed nibh at leo dapibus ullamcorper ut eget metus. Proin placerat risus in placerat tincidunt. Pellentesque lobortis in massa nec pretium. Proin felis tellus, tincidunt eget posuere eu, consectetur eget massa. Nulla pharetra vitae ligula eget lobortis. Fusce vel urna ultrices, vehicula nulla non, rhoncus nibh.</span></div></div></div>

</div></div></body></html>


please help. :(

  1. ab23ae32-0f94-4686-b94f-a59591cf273e.pdf28.4 kB
    output pdf
  2. input.html3.7 kB

Edited by qnguyen

mikeday
Justification is disabled for white-space: pre-wrap, but enabled for white-space: pre-line, perhaps you could use that instead?
qnguyen
thank for your quick response,
but is there any other options that I can keep the preserve white spaces instead of using white-space: pre-line? :(
mikeday
Replace them with non-breaking space using prince-text-replace: ' ' '\A0' perhaps? But justification makes a mess of spaces...