Graphics Container

Codecs Format Conversion Drawing Bitmap Pipeline Write Read Metadata Transform Text Color Conversion PDF JPG TIFF Channels Filesystem Adobe Resources Color Management Resize Color Adjustment Multiple frames Graphics Container Text Layout Formatted Text PSD Clipping Paths EXIF Personalization Branched Pipeline Color Profile PSD Processor Crop Extra Channels Font Interoperability Lossless JPEG Spot Color Thumbnail WEBP Advanced GIF IPTC Rotate WPF Art Text Indexed format PNG Stream TGA Watermark XMP Compression EPS Gradient Image Validation Modify Container SVG VDP Green Screen Pixel Access Rasterization RAW Transparentize Vignette BMP

Add and remove pages in an existing PDF

This sample shows how to insert and delete pages of an existing PDF document. Since PDF pages can't be edited in place, it reopens the source file with PdfReader and rebuilds it page by page with PdfWriter: copying each page's content with GetContent and Graphics.DrawContainer, skipping the page to remove, and adding a brand-new page where one should be inserted.

Combine multiple PDF files into one document

This sample shows how to combine the pages of several existing PDF files into a single multi-page PDF document. It opens each source file with PdfReader, copies every page's vector content into a new document with PdfWriter and Graphics.DrawContainer, preserving each source page's own size and resolution.

Enum Container Elements

Enumerates the elements of a graphics container.

Overlay one PDF's graphics onto another

This sample shows how to overlay the vector content of one PDF file, such as a seal or logo, onto every page of another PDF file. It reads the stamp from "Seal.pdf" and the page content from "GraphicsContainer.pdf" with PdfReader, shrinks the stamp's GraphicsContainer to a fixed size with Scale, then draws the page content and the stamp together onto each output page with PdfWriter and Graphics.DrawContainer.

PDF To SVG

Reads vector content from a PDF file and saves it to an SVG format.

Rasterize a PDF page two ways: quick vs. full control

This sample compares the two ways to turn a PDF page into a bitmap. PdfFrame.GetBitmap is the quickest option, but it always returns a 24-bit RGB bitmap at the page's own resolution. Getting the page's vector content with GetContent and rasterizing it separately with GraphicsContainerRasterizer is slower, since rendering goes through the vector content rather than a ready-made bitmap, but it allows any target pixel format and resolution, such as an alpha-capable format at a higher DPI than the source page.

Recolor Red Strokes

Demonstrates how to modify the stroke colors of shapes within a graphics container by detecting red strokes and recoloring them.

Replace Process Color

Converts the specified process color into a spot color saving graphics container to the PDF format.

SVG To PDF

Converts SVG file to PDF format.

For AI-assisted development: Download Graphics Mill Code Samples XML Catalog