Pdf for .net ,请问如何通过Aspose.pdf在一个新建的Page中添加一个文本的相关问题

我们查看Aspose.pdf的Demo时发现,在Examples\Data\AsposePDF\Text文件夹中有一个 input.PDF文件(我已上传到附件),我们 采用Examples\CSharp\AsposePDF\Text中的AddText.cs,Demo始终模拟不出想要的效果。请问如何通过Aspose.pdf在一个新建的Page中添加一个可以复制出来还能保留段落信息的文本呢?(详细的问题我已经上传到附件文档),希望得到你们的帮助,谢谢
另外,我想确认下,aspose total目前哪几个组件支持.net core呢?问题描述.zip (266.2 KB)

@yichunxia

感谢您与支持人员联系。

如果这符合您的要求,请尝试使用以下代码段,否则请分享更多详细信息,以便我们相应地提供帮助。

// Initiate PDF document
Document doc = new Document();
// Add page
Page page = doc.Pages.Add();
// Initializes a new instance of the Table
Aspose.Pdf.Table table = new Aspose.Pdf.Table();
table.ColumnWidths = "150";
// Set the table border color as LightGray
table.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
// Set the border for table cells
table.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
// Add row to table
Aspose.Pdf.Row row = table.Rows.Add();
// Add table cells
TextFragment fragment = new TextFragment("Very long text Very long text Very long text Very long text Very long text");
Aspose.Pdf.Cell cell = new Aspose.Pdf.Cell();
cell.Paragraphs.Add(fragment);
row.Cells.Add(cell);
// Add table object to first page of input document
page.Paragraphs.Add(table);
doc.Save(outFile);

你好,我们调研了这个代码,发现还是不能实现我想要的功能,我们希望可以保留段落信息,不要自动换行,我在附件上传了问题的截图,可以帮忙再看下是什么原因吗?问题说明的截图.png (47.8 KB)

@yichunxia

请你详细说明你的要求吗? 还请注意如何使用Adobe Acrobat实现这一点,因为Aspose.PDF API模仿了此应用程序。

我们想要通过Aspose.pdf在一个新建的Page中添加一个可以复制出来还能保留段落信息的文本,通过你回复给我们的代码,我们调研之后发现文本内的内容复制出来会自动换行,我们希望段落信息不做改变,可以实现吗?

@yichunxia

请在示例文档的帮助下详细说明,以便我们相应地解决您的问题。