Save Spot Image To PDF
Saves an image with a spot color to PDF.
Сode Snippet
using (var spotImage = new Bitmap(300, 300, PixelFormat.Format8bppSpot, RgbColor.White))
{
spotImage.Ink = new Ink("PANTONE Red 032 C", new RgbColor(243, 40, 55));
using (var gr = spotImage.GetAdvancedGraphics())
{
var brush = new RadialGradientBrush();
brush.ColorStops = new ColorStop[]
{
new ColorStop() { Color = RgbColor.White, Position = 0.0f },
new ColorStop() { Color = RgbColor.Black, Position = 1.0f },
};
brush.StartPoint = new System.Drawing.PointF(gr.Width / 2, gr.Height / 2);
brush.EndPoint = brush.StartPoint;
brush.StartRadius = 0;
brush.EndRadius = 300;
gr.FillRectangle(brush, 0, 0, gr.Width, gr.Height);
}
using (var pdfWriter = new PdfWriter("SpotImage.pdf"))
{
Pipeline.Run(spotImage + pdfWriter);
pdfWriter.Close();
}
}
Output
SpotImage.pdf
DownloadSpotImage.png
For AI-assisted development: Download Graphics Mill Code Samples XML Catalog