itextsharp how to add a full line break

前端 未结 1 1036
借酒劲吻你
借酒劲吻你 2021-01-06 02:06

I use itextsharp and i need to draw a dotted linebreak from left to right of the page(100% width) but don\'t know how. The doc always has a margin left right. Please help

1条回答
  •  爱一瞬间的悲伤
    2021-01-06 02:37

    Please take a look at the example FullDottedLine.

    You're creating a DottedLineSeparator of which the width percentage is 100% by default. This 100% is the full available width withing the margins of the page. If you want the line to exceed the available width, you need a percentage that is higher than 100%.

    In the example, the default page size (A4) and the default margins (36) are used. This means that the width of the page is 595 user units and the available width equals 595 - (2 x 36) user units. The percentage needed to span the complete width of the page equals 100 x (595 / 523).

    Take a look at the resulting PDF file full_dotted_line.pdf and you'll see that the line now runs through the margins.

    0 讨论(0)
提交回复
热议问题