agentleFS
aspose-pdfaspose-pdf/agentic-net-examples/basic-operations/AGENTS.md

agentic-net-examples / basic-operations

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

C# examples for basic-operations using Aspose.PDF for .NET

The file

Files
AGENTS.md

AGENTS - basic-operations

Basic operations in PDF using C# / .NET -- 56 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 basic-operations category. This folder contains standalone C# examples for basic-operations operations. See the root agents.md for repository-wide conventions and boundaries.

Scope

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

Required Namespaces

  • using Aspose.Pdf; (56/56 files) ← category-specific
  • using Aspose.Pdf.Text; (2/56 files)
  • using Aspose.Pdf.Facades; (1/56 files)
  • using Aspose.Pdf.Optimization; (1/56 files)
  • using System; (56/56 files)
  • using System.IO; (55/56 files)
  • using System.Collections.Generic; (3/56 files)
  • using System.Text; (2/56 files)
  • using System.Net.Http; (1/56 files)
  • using System.Security.Cryptography; (1/56 files)
  • using System.Text.Json; (1/56 files)
  • using System.Threading.Tasks; (1/56 files)

Common Code Pattern

Most files follow this pattern:

using (Document doc = new Document("input.pdf"))
{
    // ... operations ...
    doc.Save("output.pdf");
}

Files in this folder

FileTitleKey APIsDescription
add-blank-page-to-pdfAdd Blank Page to PDFDocument, Pages, AddShows how to load an existing PDF with Aspose.Pdf, insert an empty page at the end, and save the ...
add-custom-xmp-metadata-to-pdfAdd Custom XMP Metadata to PDFDocument, SetXmpMetadata, SaveShows how to load a PDF, create a custom XMP metadata packet, attach it to the document using Asp...
batch-convert-pdf-to-pdfa-with-reportBatch Convert PDFs to PDF/A‑1b with Compression and ReportDocument, PdfFormatConversionOptions, PdfFormatLoads each PDF from a folder, converts it to PDF/A‑1b using high compression, saves the converted...
batch-convert-pdfs-to-pdfa-1bBatch Convert PDFs to PDF/A‑1bDocument, Convert, PdfFormatShows how to iterate through a folder of PDF files, convert each to PDF/A‑1b compliance with Aspo...
batch-convert-pdfs-to-pdfa-with-csv-reportBatch Convert PDFs to PDF/A-1b with CSV ReportDocument, PdfFormat, ConvertErrorActionProcesses all PDF files in a folder, converts each to PDF/A‑1b using Aspose.Pdf, writes individua...
batch-decrypt-encrypted-pdfsBatch Decrypt Encrypted PDFs with Owner PasswordDocument, Decrypt, SaveDemonstrates how to iterate through a folder of encrypted PDF files, open each using a shared own...
batch-encrypt-pdfs-in-directoryBatch Encrypt PDFs in a DirectoryDocument, Encrypt, SaveDemonstrates how to encrypt all PDF files in a folder using a common user and owner password, app...
batch-encrypt-pdfs-with-deterministic-passwordsBatch Encrypt PDFs with Deterministic PasswordsDocument, Encrypt, PermissionsDemonstrates how to encrypt multiple PDF files in a folder using Aspose.Pdf, generating a unique ...
batch-encrypt-pdfsBatch Encrypt PDFs with User PasswordsDocument, Encrypt, SaveDemonstrates reading a JSON configuration, encrypting multiple PDF files with individual user pas...
batch-split-pdf-by-page-rangesBatch Split PDF into Sections by Page RangesDocument, Pages, SaveShows how to read page range definitions from a configuration file and split a PDF into separate ...
compress-pdf-default-settingsCompress PDF with Default Settings using Aspose.PdfDocument, SaveDemonstrates loading a PDF, saving it with Aspose.Pdf's default compression, and comparing the fi...
compress-pdf-high-optimizationCompress PDF with High Optimization and Compare File SizeDocument, OptimizationOptions, AllLoads a PDF, applies high‑level compression using Aspose.Pdf optimization options, saves the resu...
convert-pdf-to-pdfa-1bConvert PDF to PDF/A-1b preserving structureDocument, PdfFormatConversionOptions, PdfFormatDemonstrates loading a PDF with Aspose.Pdf, configuring PDF/A‑1b conversion options, performing t...
convert-pdf-to-pdfa-1b__v2Convert PDF to PDF/A‑1b ComplianceDocument, Convert, PdfFormatLoads a PDF file, converts it to PDF/A‑1b compliance while logging conversion errors, and saves t...
convert-pdf-to-pdfa1bConvert PDF to PDF/A-1b with Metadata PreservationDocument, Convert, PdfFormatDemonstrates loading a PDF, converting it to PDF/A-1b compliance while preserving metadata, and s...
convert-pdf-to-pdfx3-cmykConvert PDF to PDF/X-3 with CMYK Color SpaceDocument, OutputIntent, ConvertShows how to convert a PDF to PDF/X-3 compliance while forcing all colors to CMYK using an ICC pr...
convert-pdf-to-pdfx3-preserve-iccConvert PDF to PDF/X‑3 Preserving ICC ProfileDocument, PdfFormatConversionOptions, PdfFormatDemonstrates loading a PDF with Aspose.Pdf, converting it to PDF/X‑3 format while keeping the exi...
convert-pdf-to-pdfx3Convert PDF to PDF/X-3 while Preserving Color ProfilesDocument, Convert, PdfFormatShows how to load a PDF, convert it to PDF/X-3 compliance (which retains embedded ICC color profi...
create-pdfa1b-with-text-paragraphCreate PDF/A-1b Document with Text ParagraphDocument, Page, TextParagraphCreates a new PDF, adds a text paragraph to the first page, converts the document to PDF/A‑1b com...
create-pdfx3-document-three-pagesCreate PDF/X‑3 Document with Three PagesDocument, Add, ConvertShows how to create a new PDF, add three blank pages, convert it to PDF/X‑3 compliance, and save ...
decrypt-encrypted-pdfDecrypt Encrypted PDF with User PasswordDocument, Decrypt, SaveDemonstrates opening a password‑protected PDF, decrypting it, and saving an unprotected copy usin...
disable-font-embedding-when-saving-pdfDisable Font Embedding When Saving PDFDocument, PdfSaveOptions, SaveThe example opens an existing PDF, sets a default font in PdfSaveOptions to substitute missing fo...
download-pdf-from-url-and-saveDownload PDF from URL and Save Locally with Aspose.PdfDocument, Save, Stream)Demonstrates downloading a PDF via HttpClient, loading it into an Aspose.Pdf Document from a stre...
encrypt-pdf-aes128-verify-print-permissionsEncrypt PDF with AES‑128 and Verify Print PermissionsDocument, Permissions, CryptoAlgorithmThe example loads a PDF, applies AES‑128 encryption with user and owner passwords, sets printing ...
encrypt-pdf-aes256-no-printEncrypt PDF with AES‑256 and No Printing PermissionDocument, Encrypt, CryptoAlgorithmDemonstrates how to apply AES‑256 encryption to a PDF using Aspose.Pdf, set no permissions (disab...
encrypt-pdf-allow-form-fillingEncrypt PDF Allowing Only Form FillingDocument, Permissions, EncryptThe example loads a PDF, encrypts it with AES‑256, and sets permissions so that only form filling...
encrypt-pdf-form-fill-permissionEncrypt PDF and Allow Only Form FillingDocument, Permissions, CryptoAlgorithmDemonstrates how to encrypt a PDF with user and owner passwords, restrict permissions to form fil...
encrypt-pdf-form-filling-permissionEncrypt PDF with Form Filling Permission OnlyDocument, Permissions, CryptoAlgorithmDemonstrates how to encrypt a PDF using Aspose.Pdf, allowing only form filling and disabling cont...
encrypt-pdf-owner-password-onlyEncrypt PDF with Owner Password OnlyDocument, Permissions, EncryptShows how to encrypt a PDF using Aspose.Pdf by applying only an owner password, giving the owner ...
encrypt-pdf-rc4-128-verify-sizeEncrypt PDF with 128‑bit RC4 and Verify Size IncreaseDocument, Encrypt, PermissionsDemonstrates how to encrypt a PDF using 128‑bit RC4 encryption with Aspose.Pdf and compare the or...
...and 26 more files

Category Statistics

  • Total examples: 56

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 basic-operations 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.