Advanced
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
Assemble Pipeline manually
In general, the Pipeline API assumes that each element may have several receivers, and each of them receives the same data to process. Here we illustrate how to implement the use case shown in the Create linear pipeline sample using the Pipeline class only for running, while constructing the data flow manually.
You can read more information about pipelines in the documentation.
Conditionally adding pipeline elements
This sample demonstrates how to conditionally add elements to a pipeline based on the properties of the input image. It shows how to create thumbnails in the sRGB color space with a specified DPI value.
You can read more information about pipelines in the documentation.
Read and write PDF page boxes
This sample shows how to define print production page boundaries (MediaBox, CropBox, BleedBox, TrimBox, and ArtBox) when writing a 300 DPI PDF, and how to read them back afterwards. It builds a bleed-aware business card layout with PdfWriter and PdfPage, converting real-world sizes to pixels with UnitConverter, then reopens the file with PdfReader to show that CropBox, BleedBox, TrimBox, and ArtBox always come back in points regardless of the page's DPI.
Using the OnInit event to configure pipeline elements
What if we want to adjust pipeline element settings depending on the actual input data? In most cases you have access to the source element, but in more sophisticated scenarios the pipeline may be large, and it may be hard to track all possible changes of the image parameters. Or you may decide to split the pipeline assembly logic into several methods. In this case, it is possible to change pipeline element settings from an OnInit event handler. You get the actual image parameters that the element receives from its source, and change the properties according to those parameters. In this example, we'll scale the original image by a factor of 2.5 while preserving its aspect ratio, and place a watermark image in the center. The watermark image will be half the size of the bottom image.
You can read more information about pipelines in the documentation.
For AI-assisted development: Download Graphics Mill Code Samples XML Catalog