[英]printing “<” in pdf is not working using iTextSharp
I have the following text in my web page. 我的网页中有以下文字。
Footnote This is <1 234234> This is end part should be visible. 脚注这是<1 234234>这是结束部分,应该可见。
When I convert the web page to pdf the above page is shown as 当我将网页转换为pdf时,以上页面显示为
Footnote This is This is end part should be visible. 脚注这是结尾部分,应该是可见的。
After analyzing I got that this is happening because of "<". 经过分析,我发现这是由于“ <”而发生的。 I guess the reason is that iTextSharp considers <1 234234> as a tag and it doesn't add this text to the pdf. 我猜想原因是iTextSharp将<1 234234>视为标签,并且没有将此文本添加到pdf中。
If we have only "<" in the text and doesn't have ">" then the whole text after "<" is skipped. 如果我们在文本中只有“ <”而没有“>”,那么将跳过“ <”之后的整个文本。
Can anyone please suggest how to show the above text properly? 有人可以建议如何正确显示以上文字吗? Any help will be appreciated. 任何帮助将不胜感激。
I have tried by replacing "<" with "<" but this did not work. 我尝试通过将“ <”替换为“&lt”,但这没有用。
I used HttpUtility.HtmlEncode()
and it is working properly now. 我使用了HttpUtility.HtmlEncode()
,它现在可以正常工作。 :) :)
If anyone knows anything more then please share. 如果有人知道更多,请分享。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.