我有 WPF 应用程序,我想在我的代码中实现 colspan 和 rowspan 。我使用 iText 版本 7 将数据导出为 PDF。但是我不知道如何定义Cell
对象的 colspan 或 rowspan 。有什么办法可以解决这个问题吗?
我的目标实际上是在表中创建主标题和子标题。
我的输出:
目标输出:
我的代码如下:
using iText.IO.Font.Constants;
using iText.Kernel.Font;
using iText.Kernel.Geom;
using iText.Kernel.Pdf;
using iText.Layout;
using iText.Layout.Element;
using Microsoft.Win32;
using System.Diagnostics;
using System.Windows;
namespace ITextPdf.UI
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Export_Btn(object sender, RoutedEventArgs e)
{
SaveFileDialog dlg = new SaveFileDialog
{
DefaultExt = ".pdf",
Filter = "Adobe PDF Files(*.pdf)|*.pdf",
FilterIndex = 1
}; …
Run Code Online (Sandbox Code Playgroud)