Draw Spot On CMYK
View as MarkdownDraws a text and an image on the spot channel, using the existing CMYK image as a background.
Code 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
Used APIs
- Aurigma.GraphicsMill.Bitmap.ColorManagement
- Aurigma.GraphicsMill.Bitmap.Transforms
- Aurigma.GraphicsMill.Codecs.ImageReader
- Aurigma.GraphicsMill.Codecs.ImageReader.Create(String)
- Aurigma.GraphicsMill.Codecs.ImageWriter.Close
- Aurigma.GraphicsMill.Codecs.PdfWriter
- Aurigma.GraphicsMill.Codecs.PdfWriter.GetGraphics
- Aurigma.GraphicsMill.ColorManagementProvider.Convert(PixelFormat)
- Aurigma.GraphicsMill.ColorManagementProvider.Ink
- Aurigma.GraphicsMill.Drawing.Graphics.CreateFont(String,Single)
- Aurigma.GraphicsMill.Drawing.Graphics.DrawImage(Bitmap,Single,Single)
- Aurigma.GraphicsMill.Drawing.Graphics.DrawText(Text)
- Aurigma.GraphicsMill.Drawing.PlainText
- Aurigma.GraphicsMill.Drawing.PlainText.Alignment
- Aurigma.GraphicsMill.Drawing.PlainText.Position
- Aurigma.GraphicsMill.Drawing.SolidBrush
- Aurigma.GraphicsMill.Drawing.Text.Brush
- Aurigma.GraphicsMill.Drawing.TextAlignment
- Aurigma.GraphicsMill.Ink
- Aurigma.GraphicsMill.SpotColor
- Aurigma.GraphicsMill.Transforms.ResizeInterpolationMode
- Aurigma.GraphicsMill.Transforms.ResizeMode
- Aurigma.GraphicsMill.TransformsProvider.Resize(Int32,Int32,ResizeInterpolationMode,ResizeMode)