agentleFS
aspose-pdfaspose-pdf/agentic-net-examples/facades-texts-and-images/AGENTS.md

agentic-net-examples / facades-texts-and-images

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

C# examples for facades-texts-and-images using Aspose.PDF for .NET

The file

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

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    Always release resources by calling Close() on the PdfConverter when finished.

    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-texts-and-images

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

Scope

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

Required Namespaces

  • using Aspose.Pdf.Facades; (28/28 files) ← category-specific
  • using Aspose.Pdf; (14/28 files) ← category-specific
  • using Aspose.Pdf.Text; (5/28 files)
  • using System; (28/28 files)
  • using System.IO; (27/28 files)
  • using System.Drawing.Imaging; (3/28 files)
  • using System.Drawing; (2/28 files)
  • using System.Linq; (2/28 files)
  • using Microsoft.VisualStudio.TestTools.UnitTesting; (1/28 files)
  • using NUnit.Framework; (1/28 files)
  • using System.Threading; (1/28 files)
  • using System.Threading.Tasks; (1/28 files)

Common Code Pattern

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

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

Files in this folder

FileTitleKey APIsDescription
add-background-png-to-all-pdf-pagesAdd Background PNG to All PDF PagesDocument, Rect, BindPdfShows how to load a PDF, retrieve each page's dimensions, and overlay a PNG image as a background...
add-header-image-to-pdf-documentsAdd Header Image to PDF DocumentsPdfFileStamp, BindPdf, AddHeaderShows how to insert a header image into one or more PDF files using Aspose.Pdf.Facades.PdfFileSta...
add-image-and-text-to-pdf-with-audit-loggingAdd Image and Text to PDF with Audit LoggingDocument, PdfFileMend, AddImageLoads a PDF, adds an image and a formatted text watermark to page 1, logs each AddImage and AddTe...
add-image-and-text-watermark-to-pdfAdd Image and Semi‑Transparent Text Watermark to PDFPdfFileStamp, Stamp, FormattedTextDemonstrates how to combine an image and semi‑transparent text into a single stamp and apply it a...
add-image-to-each-pdf-page-dynamic-positionAdd Image to Each PDF Page with Dynamic PositioningDocument, Page, PdfFileMendLoads a PDF, calculates each page's dimensions, and places a PNG image in the bottom‑right corner...
add-image-to-pdf-pageAdd Image to Specific PDF PagePdfFileMend, BindPdf, AddImageShows how to use Aspose.Pdf.Facades to insert an image onto a chosen page of a PDF at given recta...
add-image-to-pdf-using-pdffilemendAdd Image to PDF Using PdfFileMend with Try‑FinallyPdfFileMend, BindPdf, AddImageDemonstrates how to bind a PDF, insert an image on a page, save the result, and guarantee that Pd...
add-image-to-pdf-with-format-validationAdd Image to PDF with Format ValidationPdfFileMend, BindPdf, AddImageDemonstrates how to validate an image's file format and then add the image to a PDF page using As...
add-image-verify-pdf-byte-sizeAdd Image to PDF and Verify Byte Size IncreaseDocument, PdfFileMend, BindPdfCreates a minimal PDF, binds it with PdfFileMend, adds a PNG image, saves the modified document, ...
add-images-to-pdf-with-error-handlingAdd Images to PDF with Error HandlingPdfFileMend, AddImage, CloseDemonstrates how to insert multiple images into a PDF using Aspose.Pdf's PdfFileMend facade while...
add-multi-line-text-block-page-3Add Multi‑Line Text Block with Custom Line Spacing to Page 3PdfFileMend, Document, PageDemonstrates how to use the PdfFileMend facade to bind an existing PDF, create a multi‑line TextP...
add-png-image-to-pdf-pageAdd PNG Image to Specific PDF Page using PdfFileMendPdfFileMend, BindPdf, AddImageDemonstrates how to bind an existing PDF with PdfFileMend, insert a PNG image onto page two at de...
add-promotional-text-to-specific-pdf-pagesAdd Promotional Text to Specific PDF PagesPdfFileStamp, Stamp, FormattedTextShows how to insert the same promotional message on pages 3, 5, and 7 of a PDF using Aspose.Pdf's...
add-text-at-coordinates-verify-positionAdd Text at Specific Coordinates and Verify PositionDocument, Page, TextFragmentCreates a blank PDF, adds a text fragment at defined X/Y coordinates using TextBuilder, saves and...
add-tiff-image-to-last-page-pdfAdd TIFF Image to Last Page of PDF using PdfFileMendPdfFileMend, BindPdf, AddImageDemonstrates how to use Aspose.Pdf.Facades.PdfFileMend to embed a TIFF image onto the final page ...
add-wrapped-footer-to-pdf-pagesAdd Word‑by‑Word Wrapped Footer to PDF PagesDocument, PageInfo, FormattedTextShows how to use Aspose.Pdf Facade API to add a formatted footer that wraps word‑by‑word across t...
async-add-image-to-pdfAsynchronously Add Image to PDF Using PdfFileMendPdfFileMend, BindPdf, AddImageDemonstrates how to modify a PDF on a background thread by adding an image to the first page with...
batch-add-company-logo-to-pdfsBatch Add Company Logo to PDFsPdfFileMend, BindPdf, AddImageShows how to process all PDF files in a folder and overlay a PNG company logo at the top‑right co...
batch-extract-images-from-pdfsBatch Extract Images from PDFs with Page and Index NamingPdfExtractor, BindPdf, StartPageShows how to process multiple PDF files, extract images from each page using Aspose.Pdf.Facades.P...
configure-word-wrapping-bywords-add-long-textConfigure Word Wrapping ByWords and Add Long Text to PDFDocument, PdfFileMend, IsWordWrapThe example shows how to enable word wrapping on a PDF using PdfFileMend, set the wrap mode to By...
extract-images-from-pdf-pagesExtract Images from Specific PDF PagesPdfExtractor, BindPdf, StartPageShows how to use Aspose.Pdf.Facades.PdfExtractor to extract all images from pages 2‑5 of a PDF an...
extract-images-from-pdf-to-pngExtract Images from PDF to PNG using PdfExtractorPdfExtractor, BindPdf, ExtractImageDemonstrates how to use Aspose.Pdf's PdfExtractor to extract all images from a PDF document and s...
insert-png-signature-image-on-every-pdf-pageInsert PNG Signature Image on Every PDF PagePdfFileMend, BindPdf, AddImageDemonstrates how to use PdfFileMend to add a PNG signature image to the bottom‑left corner of eac...
overlay-semi-transparent-gif-on-pdfOverlay Semi-Transparent GIF on PDFPdfFileMend, BindPdf, AddImageDemonstrates how to place a semi‑transparent GIF over an existing PNG in a PDF using CompositingP...
remove-all-images-from-pdfRemove All Images from PDFPdfContentEditor, BindPdf, DeleteImageShows how to delete every image in a PDF using Aspose.Pdf's PdfContentEditor facade and save the ...
remove-image-from-pdf-pageRemove Image from Specific PDF PagePdfContentEditor, BindPdf, DeleteImageDemonstrates how to delete a particular image identified by its object ID from page four of a PDF...
replace-jpeg-with-bmp-first-pageReplace JPEG with High‑Resolution BMP on First PDF PageDocument, PdfContentEditor, BindPdfDemonstrates how to replace the first image on page one of a PDF with a higher‑resolution BMP usi...
replace-low-res-images-with-high-res-pngsReplace Low-Resolution Images with High-Resolution PNGs in P...Document, PdfContentEditor, PdfExtractorDemonstrates how to iterate through each page of a PDF, detect embedded images, and replace low‑r...

Category Statistics

  • Total examples: 28

Category-Specific Tips

Key API Surface

  • Aspose.Pdf.CgmImportOptions
  • Aspose.Pdf.Facades.ExtractImageMode
  • Aspose.Pdf.Facades.ImportFormat
  • Aspose.Pdf.Facades.PdfContentEditor
  • Aspose.Pdf.Facades.PdfContentEditor.BindPdf(string)
  • Aspose.Pdf.Facades.PdfContentEditor.DeleteImage()
  • Aspose.Pdf.Facades.PdfContentEditor.DeleteImage(int, int[])
  • Aspose.Pdf.Facades.PdfContentEditor.Save(string)
  • Aspose.Pdf.Facades.PdfConverter
  • Aspose.Pdf.Facades.PdfExtractor
  • Aspose.Pdf.Facades.PdfFileMend
  • Aspose.Pdf.Facades.PdfPageEditor
  • Aspose.Pdf.Facades.PdfProducer

Rules

  • Bind a PDF file to a PdfConverter with BindPdf({input_pdf}) before any conversion.
  • Invoke DoConvert() on the PdfConverter to initialize the conversion process.
  • Export the bound PDF to a TIFF image using SaveAsTIFF({output_tiff}) after DoConvert() has been called.
  • Always release resources by calling Close() on the PdfConverter when finished.
  • Bind the PDF document to a PdfExtractor instance using BindPdf({input_pdf}) before any extraction operation.

Warnings

  • PdfConverter belongs to the Aspose.Pdf.Facades namespace, which may be considered legacy in newer SDK versions; verify compatibility.
  • The example uses System.Drawing.Imaging.ImageFormat for the output format, which may require additional NuGet packages (e.g., System.Drawing.Common) on non‑Windows platforms.
  • GetNextImage overwrites files if the generated {output_image_path} collides; ensure unique filenames.
  • GetNextImage writes the image data to the provided stream; the stream should be positioned appropriately before further use.
  • The example writes images to files using DateTime.Now.Ticks for naming, which may cause naming collisions in rapid successive runs.

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-texts-and-images 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.