Imported from aspose-pdf/agentic-net-examples (
facades-pages/AGENTS.md). Install upstream withnpx skills add aspose-pdf/agentic-net-examples --skill facades-pages. Copyright stays with the author.
AGENTS - facades-pages
Facades pages in PDF using C# / .NET -- 117 verified, compile-tested examples for Aspose.PDF for .NET 26.8.0. Each
.csfile 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-pages category. This folder contains standalone C# examples for facades-pages operations. See the root agents.md for repository-wide conventions and boundaries.
Scope
- This folder contains examples for facades-pages.
- Files are standalone
.csexamples stored directly in this folder.
Required Namespaces
using Aspose.Pdf.Facades;(115/117 files) ← category-specificusing Aspose.Pdf;(78/117 files) ← category-specificusing Aspose.Pdf.Text;(6/117 files)using Aspose.Pdf.Annotations;(1/117 files)using Aspose.Pdf.Forms;(1/117 files)using System;(117/117 files)using System.IO;(108/117 files)using System.Collections.Generic;(10/117 files)using System.Linq;(1/117 files)using System.Reflection;(1/117 files)
Common Code Pattern
Most files in this category use PdfPageEditor from Aspose.Pdf.Facades:
PdfPageEditor tool = new PdfPageEditor();
tool.BindPdf("input.pdf");
// ... PdfPageEditor operations ...
tool.Save("output.pdf");
Files in this folder
| File | Title | Key APIs | Description |
|---|---|---|---|
| add-10-percent-margins-to-pdf-pages | Add 10% Margins to All PDF Pages | PdfFileEditor, AddMarginsPct |
Demonstrates how to use Aspose.Pdf.Facades.PdfFileEditor to add a uniform 10 % margin on all side... |
| add-15-percent-margins-to-pdf-pages | Add 15% Margins to PDF Pages for Booklet Layout | PdfFileEditor, AddMarginsPct |
Shows how to apply a 15 % margin to selected or all pages of a PDF using Aspose.Pdf.Facades, impr... |
| add-20-percent-margins-to-pdf-pages | Add 20% Margins to PDF Pages | PdfFileEditor, AddMarginsPct |
Demonstrates how to add uniform 20 % margins around each page of a PDF using Aspose.Pdf.Facades.P... |
| add-5-percent-margins-and-print-pdf | Add 5% Margins and Print PDF | PdfFileEditor, PdfViewer, AddMarginsPct |
Shows how to add a 5 % margin to every page of a PDF using PdfFileEditor and then print the modif... |
| add-fade-transition-to-pdf-page | Add Fade Transition to PDF Page | Document, PdfPageEditor, TransitionType |
Demonstrates how to set a fade page transition with a two‑second duration on the first page of a ... |
| adjust-page-zoom-based-on-word-count | Adjust Page Zoom Based on Word Count | Document, PdfPageEditor, TextAbsorber |
Demonstrates how to analyze each PDF page's word count and apply a dynamic zoom factor—higher zoo... |
| align-page-three-vertically-top | Align Page Three Vertically to Top Using PdfPageEditor | Document, PdfPageEditor, BindPdf |
Shows how to vertically align the content of page 3 of a PDF to the top using Aspose.Pdf's PdfPag... |
| align-page-two-left | Align Page Two Left in PDF | Document, PdfPageEditor, ProcessPages |
Demonstrates how to left‑justify the content of the second page of a PDF using Aspose.Pdf's PdfPa... |
| apply-custom-page-transitions | Apply Custom Page Transitions Based on Index | Document, PdfPageEditor, BindPdf |
Shows how to assign different transition effects to each PDF page using Aspose.Pdf's PdfPageEdito... |
| apply-different-zoom-levels-to-pdf-pages | Apply Different Zoom Levels to PDF Pages | PdfPageEditor, BindPdf, GetPages |
Shows how to assign a distinct zoom factor to each page of a PDF using the Aspose.Pdf.Facades.Pdf... |
| apply-dissolve-transition-to-pdf-page | Apply Dissolve Transition to a Specific PDF Page | Document, PdfPageEditor, ApplyChanges |
Demonstrates how to set a three‑second Dissolve page transition on page 5 of a PDF using Aspose.P... |
| apply-fade-transition-to-all-pdf-pages | Apply Fade Transition to All PDF Pages | Document, PdfPageEditor, BindPdf |
Shows how to set a uniform Fade (Dissolve) transition and duration for every page in a PDF using ... |
| apply-horizontal-alignment-to-pdf-pages | Apply Horizontal Alignment to PDF Pages | PdfPageEditor, BindPdf, HorizontalAlignment |
Shows how to set left‑justified horizontal alignment for all pages of a PDF using the PdfPageEdit... |
| apply-page-transitions-by-index | Apply Different Page Transitions Based on Index | Document, PdfPageEditor, BindPdf |
Demonstrates how to assign a different transition effect to each PDF page using Aspose.Pdf.Facade... |
| apply-rotation-size-zoom-to-pdf-pages | Apply Rotation, Size, and Zoom to PDF Pages | PdfPageEditor, BindPdf, ApplyChanges |
Demonstrates using Aspose.Pdf's PdfPageEditor facade to rotate pages, change the page size, apply... |
| apply-transition-to-odd-pages | Apply Transition to Odd Pages in PDF | Document, PdfPageEditor, BindPdf |
Shows how to add a page transition effect only to odd‑numbered pages of a PDF using Aspose.Pdf's ... |
| apply-vertical-alignment-to-selected-pdf-pages | Apply Vertical Alignment to Selected PDF Pages | PdfPageEditor, BindPdf, ProcessPages |
Demonstrates how to vertically align the content of specific pages in a PDF to the top using Aspo... |
| apply-zoom-to-non-consecutive-pdf-pages | Apply Zoom to Non-Consecutive PDF Pages | PdfPageEditor, BindPdf, ProcessPages |
Shows how to select specific non‑consecutive pages using the ProcessPages array and apply a commo... |
| assign-page-transitions-by-content | Assign Page Transitions Based on Content Type | Document, Page, PdfPageEditor |
Shows how to use Aspose.Pdf.Facades.PdfPageEditor to set different transition effects for image a... |
| audit-pdf-page-dimensions-rotation | Audit PDF Page Dimensions and Rotation Before and After Edit... | PdfPageEditor, BindPdf, GetPages |
Shows how to log each PDF page's width, height, and rotation, apply a rotation to a page, and sav... |
| batch-adjust-pdf-page-size | Batch Adjust PDF Page Size to A4 | Document, PdfPageEditor, PageSize |
Shows how to process all PDFs in a folder and set each page to a specific size (e.g., A4) using A... |
| batch-convert-pdfs-to-a4 | Batch Convert PDFs to A4 Page Size | PdfPageEditor, BindPdf, ApplyChanges |
Shows how to iterate over PDF files in a directory and resize each document to A4 using Aspose.Pd... |
| batch-rotate-first-page-pdfs | Batch Rotate First Page of PDFs | PdfPageEditor, BindPdf, PageRotations |
Shows how to process all PDF files in a folder and rotate the first page of each document by 90° ... |
| batch-set-fade-transition-pdf-slideshow | Batch Set Fade Transition for PDF Slideshow | Document, PdfPageEditor, TransitionType |
Demonstrates how to apply a fade (dissolve) transition with a 2‑second duration to all pages of a... |
| center-page-content-horizontally | Center Page Content Horizontally Using PdfPageEditor | PdfPageEditor, BindPdf, ProcessPages |
Shows how to use Aspose.Pdf.Facades.PdfPageEditor to center the existing content of a specific pa... |
| center-page-content-set-display-duration | Center Page Content and Set Display Duration on a Specific P... | PdfPageEditor, Document, BindPdf |
Demonstrates how to center the content of a specific PDF page and set its display duration using ... |
| chain-page-rotation-size-zoom-modifications | Chain Page Rotation, Size, and Zoom Modifications | Document, PdfPageEditor, Rotation |
Demonstrates how to use PdfPageEditor to rotate, resize, zoom, and reposition PDF pages in a sing... |
| change-pdf-page-size-and-undo | Change PDF Page Size and Undo to Original | PdfPageEditor, BindPdf, GetPageSize |
Shows how to capture a PDF's original page size, apply a custom size to all pages, save the modif... |
| change-pdf-page-size-to-a3 | Change PDF Page Size to A3 Using PdfPageEditor | PdfPageEditor, BindPdf, PageSize |
Shows how to resize all pages of a PDF to A3 dimensions and optionally increase resolution using ... |
| combine-page-rotation-zoom-presentation | Combine Page Rotation, Zoom, and Transitions for PDF Present... | Document, PdfPageEditor, BindPdf |
Shows how to rotate, zoom, and apply slide transition effects to every page of a PDF using Aspose... |
| ... | and 87 more files |
Category Statistics
- Total examples: 117
Category-Specific Tips
Key API Surface
Aspose.Pdf.Facades.PdfFileEditorAspose.Pdf.Facades.PdfFileEditor.DeleteAspose.Pdf.Facades.PdfFileEditor.ExtractAspose.Pdf.Facades.PdfFileEditor.SplitToEnd
Rules
- Instantiate Aspose.Pdf.Facades.PdfFileEditor and call Delete({input_pdf}, {int[]} pagesToDelete, {output_pdf}) to remove the specified pages.
- The page numbers in the array are 1‑based indices representing the pages to be removed.
- Use PdfFileEditor.Delete({input_pdf_stream}, {int[] pagesToDelete}, {output_pdf_stream}) to remove the specified pages (1‑based indices) from a PDF without loading it into a Document object.
- When working with streams, open the source PDF with FileMode.Open and create the destination PDF with FileMode.Create, then pass the streams to PdfFileEditor.Delete.
- Use PdfFileEditor.Extract({input_pdf}, new int[] {{int}, {int}, ...}, {output_pdf}) to create a new PDF containing only the listed pages.
Warnings
- The example does not explicitly dispose the FileStream objects; callers should ensure streams are closed or wrapped in using statements.
- The output file will be created or overwritten; ensure the path is correct.
- The example assumes the input PDF exists at the specified location.
- Page numbers must be within the bounds of the source document; otherwise an exception will be thrown.
- Insert overwrites the output file if it already exists.
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-pages patterns
Updated: 2026-08-20 | Run: 20260820_001147_12d7b3