Work with PDF artifacts in C++
Contents
[
Hide
]
PDF artifacts represent page elements such as decorative backgrounds, running headers and footers, and watermarks. In a tagged PDF, artifacts distinguish these elements from meaningful document content.
Choose a guide
Add artifacts
Inspect artifacts
Remove artifacts
Work with the artifact API
Use Page::get_Artifacts() to access an ArtifactCollection. The Artifact base class provides common properties for BackgroundArtifact, WatermarkArtifact, HeaderArtifact, FooterArtifact, and BatesNArtifact.
| Task | API properties and methods |
|---|---|
| Classify an artifact | Inspect get_Type() and get_Subtype(). |
| Read watermark details | Use get_Text() and get_Rectangle(). |
| Configure text | Use get_TextState() or SetTextAndState(). |
| Configure placement | Set artifact alignment and margins. |
| Configure appearance | Set rotation and opacity; use set_IsBackground(true) for placement behind page content. |
| Add or delete an artifact | Call ArtifactCollection::Add() or Delete(). |
Most examples process the first page. Bates numbering uses the document page collection; both C++ addition examples also append two blank pages. Removal guides state the artifact classifications they delete.