Draw Spot On CMYK
Draws a text and an image on the spot channel, using the existing CMYK image as a background.
Сode Snippet
using (var bgImageReader = ImageReader.Create("Copenhagen_CMYK.jpg"))
using (var pdfWriter = new PdfWriter("SpotWithProcessColors.pdf"))
{
Pipeline.Run(bgImageReader + pdfWriter);
using (var gr = pdfWriter.GetGraphics())
using (var spotImage = new Bitmap("Sheep.gif"))
{
var ink = new Ink("PANTONE Red 032 C", new RgbColor(243, 40, 55));
var spotColor = new SpotColor(ink, 255);
var text = new PlainText("Spot color text", gr.CreateFont("Arial", 150))
{
Position = new System.Drawing.PointF(gr.Width / 2, gr.Height / 2),
Alignment = TextAlignment.Center,
Brush = new SolidBrush(spotColor),
};
gr.DrawText(text);
// After these operations, the loaded image reflects a spot color
spotImage.ColorManagement.Ink = ink;
spotImage.ColorManagement.Convert(PixelFormat.Format16bppAspot);
spotImage.Transforms.Resize(400, 400, Aurigma.GraphicsMill.Transforms.ResizeInterpolationMode.Linear, Aurigma.GraphicsMill.Transforms.ResizeMode.Fit);
gr.DrawImage(spotImage, gr.Width - spotImage.Width, gr.Height - (spotImage.Height / 3));
}
pdfWriter.Close();
}
Input
Copenhagen_CMYK.jpg
Sheep.gif
Output
SpotWithProcessColors.pdf
DownloadSpotWithProcessColors.png
For AI-assisted development: Download Graphics Mill Code Samples XML Catalog