Adding a New Line in iTextSharp

后端 未结 10 1589
伪装坚强ぢ
伪装坚强ぢ 2021-02-19 00:36

I’ve been trying to solve this problem for a while now to no avail. I have some text in iTextSharp I’m trying to put on a newline. I’ve tried using the \\n escape c

10条回答
  •  有刺的猬
    2021-02-19 01:29

    I am just trying this tool and for adding new line I just added '\r\n' and it did work. Like this below.

    String content01 = "Nulla condimentum dui lobortis risus viverra, eu pellentesque sem blandit.\r\nUt congue turpis quis sapien mollis, vitae rutrum mi consectetur. Integer maximus nisl sed tellus pharetra pharetra.";
    Phrase contentPhrase = new Phrase(content01);
    Paragraph contentPr = new Paragraph();
    contentPr.Add(contentPhrase);
    

    Then added the Paragraph contentPtr to my Document instance.

提交回复
热议问题