Justify issue on last line

225 views
Skip to first unread message

soso

unread,
Mar 1, 2011, 5:51:42 AM3/1/11
to dompdf
Hello,


This is related with my previous message of yesterday.

The last line of a "paragraph" is justified although it shouldn't.

The interesting thing is that justification is done properly if I add
a <br> right after the last line. I think there are also other tags
that should act like <br> regarding justification. In the example
below you can see that <h2> doesn't "signal" end of justification just
like <br> does:

You can test this behavior on http://eclecticgeek.com/dompdf/docs_0-6-0/demo.php
entring the following text:


<html>
<head>
<style>

body {
text-align: justify;
}

</style>
</head>

<body>

long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text


<h2>H2 Paragraph</h2>

long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text long text long text long text long text
long text long text long text
<br/>

<h2>H2 Paragraph</h2>


</body>
</html>

BrianS

unread,
Mar 3, 2011, 3:01:14 PM3/3/11
to dom...@googlegroups.com
Ah, saw this post after responding to your previous one. Thanks for the sample. I'll make a note in the issue tracker.

Something of note about your sample document, it contains no block element surrounding the text in the body. Not to get nit-picky, but I don't believe this is valid per the HTML 4 spec ... at least not in strict mode which is probably closest to how DOMPDF parses documents.

I'm not saying we won't address the issue. I just wanted to provide insight into how DOMPDF functions, which can help you figure out what's going wrong with your document renders. Which can help us make DOMPDF better when you post bug reports ;)
Reply all
Reply to author
Forward
0 new messages