ITextsharp HTML to PDF,display:inline-block not working

时间:2016-04-12 11:17:53

标签: c# css itextsharp

我尝试将HTML文件的一部分转换为PDF文件,但发现display:inline-block在转换后无法正常工作。我尝试创建一个包含少量元素的示例html来测试它:

<span>1</span><br><span></span></a></div>&nbsp;<div class="seat"><a data-seat-no="2" class="btn-seat seat-crew" href="#!">
<span>2</span><br><span></span></a></div>&nbsp;<div class="spacing"></div>&nbsp;<div class="seat"><a data-seat-no="3" class="btn-seat seat-crew" href="#!">
<span>3</span><br><span></span></a></div>&nbsp;<div class="seat"><a data-seat-no="4" class="btn-seat seat-crew" href="#!">
<span>4</span><br><span></span></a></div>&nbsp;<br><div class="seat"><a data-seat-no="5" class="btn-seat" href="#!">
<span>5</span><br><span></span></a></div>&nbsp;<div class="seat"><a data-seat-no="6" class="btn-seat" href="#!">
<span>6</span><br><span></span></a></div>&nbsp;<div class="spacing"></div>&nbsp;<div class="seat"><a data-seat-no="7" class="btn-seat" href="#!">
<span>7</span><br><span></span></a></div>&nbsp;<div class="seat"><a data-seat-no="8" class="btn-seat" href="#!">
<span>8</span><br><span></span></a></div>&nbsp;<br><div class="seat"><a data-seat-no="9" class="btn-seat" href="#!">
<span>9</span><br><span></span></a></div>&nbsp;<div class="seat"><a data-seat-no="10" class="btn-seat" href="#!">
<span>10</span><br><span></span></a></div>&nbsp;<div class="spacing"></div>&nbsp;

,CSS代码是:

.seat {
    background: #1f89c0 none repeat scroll 0 0;
    border: 1px solid #333;
    color: #fff;
    display: inline-block;
    font-size: 10px;
    letter-spacing: 1px;
    margin: 2px;
    padding: 8px 0;
    text-align: center;
    text-transform: uppercase;
    width: 87px;
}
每当我在浏览器中渲染时,

display:inline-block都有效:

enter image description here

但是当我尝试将其转换为PDF文件时,结果是:

enter image description here

ItextSharp不知道如何呈现display:inline-block吗?我真的必须使用花车吗?

0 个答案:

没有答案