This sample demonstrates two points:
- Removing structure elements associated with pages that are being removed;
- Using the logical structure to Highlight paragraphs associated with tags.
We load a rather long PDF that was produced by saving as PDF a DOCX in MS Word. We then remove all but the first 5 pages, making sure that first we remove elements in the PDF's structure tree that are associated with the pages are removed.
Then we get the PDF's logical structure and go over all its elements, highlighting the associated paragraph in the document. We also add a sticky note to the top right corner of each paragraph, with the paragraph's text fetched from the logical structure. While impractical as is, this sample shows how to connect logical structure elements with content that they point to.
DsPdf is compatible with .NET 6 or later, .NET Core 2.0 or later, .NET Standard 2.x, .NET Framework 4.6.1 or later. All features are supported on Windows, macOS and Linux.