agentleFS
aspose-pdfaspose-pdf/agentic-net-examples/facades-bookmarks/AGENTS.md

agentic-net-examples / facades-bookmarks

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

C# examples for facades-bookmarks using Aspose.PDF for .NET

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Call Save({output_pdf}) on the PdfBookmarkEditor to write out the PDF (required if any modifications are made or to finalize the operation).

    line 105
  2. Distinctive:

    Create a bookmark that points to a page using PdfBookmarkEditor.CreateBookmarkOfPage({string_literal}, {int}) where the page number is …

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS - facades-bookmarks

Facades bookmarks in PDF using C# / .NET -- 35 verified, compile-tested examples for Aspose.PDF for .NET 26.8.0. Each .cs file is a standalone, build-validated console example, generated and runtime-checked by an AI agent before publishing.

Persona

You are a C# developer specializing in PDF processing using Aspose.PDF for .NET, working within the facades-bookmarks category. This folder contains standalone C# examples for facades-bookmarks operations. See the root agents.md for repository-wide conventions and boundaries.

Scope

  • This folder contains examples for facades-bookmarks.
  • Files are standalone .cs examples stored directly in this folder.

Required Namespaces

  • using Aspose.Pdf.Facades; (35/35 files) ← category-specific
  • using Aspose.Pdf; (16/35 files)
  • using System; (35/35 files)
  • using System.IO; (34/35 files)
  • using System.Collections.Generic; (12/35 files)
  • using System.Drawing; (4/35 files)
  • using System.Text.Json; (3/35 files)
  • using System.Text.RegularExpressions; (1/35 files)

Common Code Pattern

Most files in this category use PdfBookmarkEditor from Aspose.Pdf.Facades:

PdfBookmarkEditor tool = new PdfBookmarkEditor();
tool.BindPdf("input.pdf");
// ... PdfBookmarkEditor operations ...
tool.Save("output.pdf");

Files in this folder

FileTitleKey APIsDescription
add-colored-bookmarks-to-pdfAdd Colored Bookmarks to PDF SectionsPdfBookmarkEditor, BindPdf, CreateBookmarksShows how to create PDF bookmarks and set their title color (red for warnings, green for informat...
add-external-url-bookmarks-to-pdfAdd External URL Bookmarks to PDFDocument, PdfContentEditor, BindPdfShows how to create PDF bookmarks that open external web addresses using Aspose.Pdf Facades.
add-image-bookmarks-to-pdfAdd Image Bookmarks to PDFDocument, Page, XImageScans a PDF for images, records each image's page number, and creates a bookmark that links direc...
add-javascript-bookmark-to-pdfAdd JavaScript Bookmark to PDFPdfContentEditor, BindPdf, CreateBookmarksActionShows how to create a PDF bookmark that runs JavaScript code when clicked using the Aspose.Pdf Fa...
add-subbookmarks-to-pdf-chapterAdd Subbookmarks to a PDF ChapterPdfBookmarkEditor, BindPdf, CreateBookmarksShows how to create a parent bookmark and attach child bookmarks to represent sections within a c...
add-toc-bookmark-to-pdfs-batchAdd Table of Contents Bookmark to PDFs in BatchPdfBookmarkEditor, BindPdf, CreateBookmarkOfPageShows how to process all PDF files in a directory and add a top‑level "Table of Contents" bookmar...
add-top-level-blue-bookmark-to-pdfAdd Top-Level Blue Bookmark to PDFPdfBookmarkEditor, BindPdf, CreateBookmarksDemonstrates how to create a top‑level bookmark that points to the first page of a PDF and set it...
adjust-pdf-bookmarks-after-inserting-pagesAdjust PDF Bookmarks After Inserting PagesDocument, PdfBookmarkEditor, ExtractBookmarksShows how to extract existing bookmarks, insert blank pages at the beginning of a PDF, and recrea...
batch-add-reviewed-bookmark-to-pdfsBatch Add "Reviewed" Bookmark to PDFsPdfBookmarkEditor, BindPdf, CreateBookmarkOfPageShows how to loop through PDF files in a directory, use PdfBookmarkEditor to create a "Reviewed" ...
batch-delete-bookmarks-from-encrypted-pdfsBatch Delete Bookmarks from Encrypted PDFsDocument, PdfBookmarkEditor, DeleteBookmarksShows how to open password‑protected PDF files, remove all bookmarks using PdfBookmarkEditor, and...
collapse-specific-pdf-bookmarksCollapse Specific PDF Bookmarks Using Aspose.PdfPdfBookmarkEditor, BindPdf, ExtractBookmarksDemonstrates how to set selected PDF bookmarks to a collapsed (closed) state by extracting, modif...
convert-bookmark-titles-to-title-caseConvert PDF Bookmark Titles to Title Case with Proper Noun P...PdfBookmarkEditor, BindPdf, ExtractBookmarksDemonstrates how to read PDF bookmarks, convert each title to title case while keeping predefined...
create-bookmark-to-named-destinationCreate Bookmark to Named Destination in PDFDocument, PdfContentEditor, BindPdfShows how to add a bookmark that points to an existing named destination within a PDF using Aspos...
create-hierarchical-pdf-bookmarksCreate Hierarchical Bookmarks in a PDFPdfBookmarkEditor, BindPdf, CreateBookmarksDemonstrates how to bind an existing PDF with PdfBookmarkEditor and add a multi‑level bookmark hi...
delete-all-bookmarks-from-pdfDelete All Bookmarks from PDFPdfBookmarkEditor, BindPdf, DeleteBookmarksDemonstrates how to remove every bookmark from a PDF document using Aspose.Pdf's PdfBookmarkEdito...
delete-bookmark-from-pdfDelete Bookmark from PDF Using PdfBookmarkEditorPdfBookmarkEditor, BindPdf, ExtractBookmarksDemonstrates binding a PDF to PdfBookmarkEditor, listing existing bookmarks, deleting a specific ...
delete-bookmarks-matching-regexDelete Bookmarks Matching a Regex PatternPdfBookmarkEditor, BindPdf, ExtractBookmarksDemonstrates how to remove PDF bookmarks whose titles match a specified regular expression using ...
export-pdf-bookmarks-to-csvExport PDF Bookmarks to CSVPdfBookmarkEditor, BindPdf, ExtractBookmarksOpens a PDF, extracts all bookmarks recursively using PdfBookmarkEditor, and writes each bookmark...
export-pdf-bookmarks-to-excelExport PDF Bookmarks to ExcelPdfBookmarkEditor, ExcelSaveOptions, DocumentShows how to extract all bookmarks from a PDF using PdfBookmarkEditor, place them in a table, and...
export-pdf-bookmarks-to-jsonExport PDF Bookmark Hierarchy to JSONPdfBookmarkEditor, BindPdf, ExtractBookmarksShows how to extract the bookmark tree from a PDF using PdfBookmarkEditor and write each bookmark...
export-pdf-bookmarks-to-textExport PDF Bookmarks to Text OutlinePdfBookmarkEditor, BindPdf, ExtractBookmarksShows how to extract the hierarchical bookmarks from a PDF using Aspose.Pdf.Facades.PdfBookmarkEd...
export-pdf-bookmarks-to-xmlExport PDF Bookmarks to XMLPdfBookmarkEditor, BindPdf, ExportBookmarksToXMLDemonstrates how to bind a PDF with Aspose.Pdf.Facades.PdfBookmarkEditor and export its complete ...
extract-pdf-bookmarks-to-jsonExtract PDF Bookmarks to JSONPdfBookmarkEditor, BindPdf, ExtractBookmarksShows how to use Aspose.Pdf.Facades.PdfBookmarkEditor to extract PDF bookmarks, build a hierarchi...
import-bookmarks-from-csvImport Bookmarks from CSV into PDFPdfBookmarkEditor, BindPdf, CreateBookmarksShows how to read a CSV file, build a hierarchical bookmark tree, and add the bookmarks to a PDF ...
import-bookmarks-from-databaseImport Bookmarks from Database into PDFPdfBookmarkEditor, BindPdf, CreateBookmarksShows how to read bookmark records (title and page number) from a simulated database query and ad...
import-bookmarks-from-jsonImport Bookmarks from JSON into a PDFPdfBookmarkEditor, Bookmark, BookmarksDemonstrates how to read a JSON file containing bookmark definitions, map them to Aspose.Pdf.Faca...
import-ofd-bookmarks-to-pdfImport OFD File and Add Bookmarks to PDFDocument, OfdLoadOptions, PdfBookmarkEditorDemonstrates loading an OFD document, converting each page into a PDF bookmark, and saving the re...
merge-pdf-bookmarksMerge Bookmarks from One PDF into AnotherPdfBookmarkEditor, BindPdf, ExportBookmarksToXMLShows how to export bookmarks from a source PDF to an XML stream and import them into a target PD...
remove-duplicate-bookmarksRemove Duplicate Bookmarks from PDFPdfBookmarkEditor, BindPdf, ExtractBookmarksShows how to extract all bookmarks, filter out duplicates based on title and page number, delete ...
rename-pdf-bookmarks-using-translation-dictionaryRename PDF Bookmarks Using a Translation DictionaryPdfBookmarkEditor, BindPdf, ModifyBookmarksDemonstrates loading a PDF, renaming its bookmarks according to a translation dictionary, and sav...
...and 5 more files

Category Statistics

  • Total examples: 35

Category-Specific Tips

Key API Surface

  • Aspose.Pdf.Facades.Bookmark
  • Aspose.Pdf.Facades.Bookmark.Action
  • Aspose.Pdf.Facades.Bookmark.PageNumber
  • Aspose.Pdf.Facades.Bookmark.Title
  • Aspose.Pdf.Facades.Bookmarks
  • Aspose.Pdf.Facades.PdfBookmarkEditor
  • Aspose.Pdf.Facades.PdfBookmarkEditor.BindPdf
  • Aspose.Pdf.Facades.PdfBookmarkEditor.BindPdf(string)
  • Aspose.Pdf.Facades.PdfBookmarkEditor.DeleteBookmarks(string)
  • Aspose.Pdf.Facades.PdfBookmarkEditor.ExtractBookmarks
  • Aspose.Pdf.Facades.PdfBookmarkEditor.ImportBookmarksWithXML
  • Aspose.Pdf.Facades.PdfBookmarkEditor.Save
  • Aspose.Pdf.Facades.PdfBookmarkEditor.Save(string)

Rules

  • Instantiate a PdfBookmarkEditor, then bind the source PDF with BindPdf({input_pdf}) before performing any bookmark operations.
  • Export the document's bookmarks to an XML file using ExportBookmarksToXML({string_literal}) after the PDF is bound.
  • Call Save({output_pdf}) on the PdfBookmarkEditor to write out the PDF (required if any modifications are made or to finalize the operation).
  • Load a PDF with PdfBookmarkEditor.BindPdf({input_pdf}) before performing any bookmark operations.
  • Create a bookmark that points to a page using PdfBookmarkEditor.CreateBookmarkOfPage({string_literal}, {int}) where the page number is 1‑based.

Warnings

  • Save() creates a new PDF file even if no bookmark changes were made; it may be unnecessary if only exporting bookmarks.
  • PdfBookmarkEditor belongs to the Aspose.Pdf.Facades namespace, which may be deprecated in future releases; consider using the Document class for newer APIs.
  • CreateBookmarkOfPage expects the bookmark and page arrays to be of equal length; each entry maps a single page (range support may be limited).
  • PdfBookmarkEditor belongs to the Aspose.Pdf.Facades namespace, which may be deprecated in newer versions of Aspose.PDF.
  • DeleteBookmarks removes every bookmark; there is no overload for selective deletion.

General Tips

  • See parent AGENTS.md for:
    • Boundaries -- Always / Ask First / Never rules for all examples
    • Common Mistakes -- verified anti-patterns that cause build failures
    • Domain Knowledge -- cross-cutting API-specific gotchas
    • Testing Guide -- build and run verification steps
  • Review code examples in this folder for facades-bookmarks patterns
<!-- AUTOGENERATED:START -->

Updated: 2026-08-20 | Run: 20260820_001147_12d7b3

<!-- AUTOGENERATED:END -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.