c# - itext7 覆盖长字符串值
问题描述
我有以下代码:
void Main()
{
var writer = new PdfWriter(@"c:\temp\Overwrite.pdf");
var pdf = new PdfDocument(writer);
var document = new Document(pdf);
var p = new Paragraph($"Feature: 4.2 - Release Selection and a very big welcome to the Community this has been a very good project indeed, I sure do like it. How about yourself, very big welcome to the Community, this has been a very good project indeed, I do like it. Selection and a very big welcome to the Community this has been a very good project indeed, I sure do like it. ").SetKeepWithNext(true)
.SetMarginTop(10)
.SetMarginBottom(10)
.SetFixedLeading(0f);
document.Add(p);
document.Close();
}
解决方案
我不确定这条线在做什么,但它会导致问题,如果你像我在这里所做的那样评论它,你的文字就可以了。
var p =
new Paragraph(s)
.SetKeepWithNext(true)
.SetMarginTop(10)
.SetMarginBottom(10);
//SetFixedLeading(0f);
推荐阅读
- r - 用数字替换文本值
- gcloud - GCloud 构建 YAML 替换不起作用
- ios - 如何在我们应用快照时停止 UICollectionViewDiffableDataSource 滚动集合视图?
- reactjs - 我有样式组件,想迁移到 scss,
- java - 特殊字符未写入 csv 文件
- python-3.x - 正则表达式 - 如果外括号前面有特定字符,则不匹配任何内括号
- javascript - 在 ReactJs 中将所选选项从一个选择添加到另一个选择
- scala - 似乎不能重复 reducebykey 两次——新的数据结构是什么?
- woocommerce - WooCommerce 日志 MaxMind 地理定位
- python - Python Selenium - 登录页面未出现