SkillAgentSearch skills...

Wisp

A low-level library for interacting with PDF files

Install / Use

/learn @patriksvensson/Wisp
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Wisp

Logo

A low-level library for interacting with PDF files.
This is currently a work in progress.

Example

// Open the PDF document
var document = CosDocument.Open(
    File.OpenRead(
        "/Users/patrik/input.pdf"));

// Create a new object
var obj = new CosObject(
    document.XRefTable.GetNextId(),
    new CosDictionary()
    {
        { new CosName("/Foo"), new CosInteger(32) },
        { new CosName("/Bar"), new CosString("Patrik") },
    });

// Add the created object to the document
document.Objects.Set(obj);

// Get an object from the document and manipulate it
// In this case we know that the object 25:0 exist, but this
// will most certainly crash if you're running this as is.
var other = document.Objects.Get(number: 25, generation: 0);
((CosDictionary)other.Object)[new CosName("Baz")] = new CosString("Hello");

// Change the author of the document
document.Info.Title = new CosString("Wisp test");
document.Info.Author = new CosString("Patrik Svensson");

// Save the document
document.Save(
    File.OpenWrite("/Users/patrik/output.pdf"),
    CosCompression.Smallest);

Building

We're using Cake as a dotnet tool for building. So make sure that you've restored Cake by running the following in the repository root:

> dotnet tool restore

After that, running the build is as easy as writing:

> dotnet cake

Related Skills

View on GitHub
GitHub Stars94
CategoryDevelopment
Updated4mo ago
Forks2

Languages

C#

Security Score

92/100

Audited on Nov 12, 2025

No findings