Created
July 10, 2024 09:30
Aspose.Words for .NET. Working with PDF/A or PDF/UA using C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git. | |
Document doc = new Document(MyDir + "Table of contents.docx"); | |
var tocHyperLinks = doc.Range.Fields | |
.Where(f => f.Type == FieldType.FieldHyperlink) | |
.Cast<FieldHyperlink>() | |
.Where(f => f.SubAddress.StartsWith("#_Toc")); | |
foreach (FieldHyperlink link in tocHyperLinks) | |
link.ScreenTip = link.DisplayResult; | |
PdfSaveOptions saveOptions = new PdfSaveOptions() | |
{ | |
Compliance = PdfCompliance.PdfUa1, | |
DisplayDocTitle = true, | |
ExportDocumentStructure = true, | |
}; | |
saveOptions.OutlineOptions.HeadingsOutlineLevels = 3; | |
saveOptions.OutlineOptions.CreateMissingOutlineLevels = true; | |
doc.Save(ArtifactsDir + "WorkingWithPdfSaveOptions.UpdateScreenTip.pdf", saveOptions); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment