Aspose.PDF For NET 如何获取PDF文件中的指定内容

在我的PDF文件中,我想获取特定的一些内容,请见图片中圈出的部分,灰色,像水印。
我的代码如下:

Document pdfDocument = new Document(@“C:\Users\howze\Desktop\test.pdf”);

XFormCollection forms = pdfDocument.Pages[1].Resources.Forms;

Page p = pdfDocument.Pages[1];

Aspose.Pdf.Text.TextFragmentAbsorber textFragmentAbsorber = new Aspose.Pdf.Text.TextFragmentAbsorber();

pdfDocument.Pages[1].Accept(textFragmentAbsorber);

Aspose.Pdf.Text.TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;

但是,在forms、p.Resources、textFragmentCollection中,都无法获取我要的内容,请问该如何获取指定的内容呢?谢谢!

pic.png (183.4 KB)

test.pdf (253.6 KB)

@howze

我们还尝试使用Artifacts提取内容,如以下代码片段所示,但无法实现:

foreach (Artifact artifact in pdfDocument.Pages[1].Artifacts)
{
 // If artifact type is watermark, increate the counter
 if (artifact.Subtype == Artifact.ArtifactSubtype.Watermark) count++;
}

因此,我们在问题跟踪系统中记录了一个名为PDFNET-48642的问题,以进行进一步调查。我们将调查其详细信息,并向您通知其解决状态。请耐心等待,并节省一些时间。

我们对不便表示抱歉。