Update Text Color
View as MarkdownUpdates text color of PSD image and saves to PDF file.
Code Snippet
var psdProcessor = new PsdProcessor();
var psName = psdProcessor.FontResolver.FontRegistry.Add("ARIALUNI.TTF")[0].PostscriptName;
psdProcessor.FontResolver.FontRegistry.FallbackFonts.Add(psName);
psdProcessor.TextCallback = (processor, textFrame, textString) =>
{
var text = processor.ProcessText(textFrame);
text.String = textString;
if (textFrame.Name == "Name")
{
text.Brush = new SolidBrush(RgbColor.Red);
}
return text;
};
psdProcessor.Render("BusinessCard.psd", "UpdateTextColor.pdf");
Input
BusinessCard.psd
DownloadOutput
UpdateTextColor.pdf
DownloadUpdateTextColor.png
Used APIs
- Aurigma.GraphicsMill.Codecs.Psd.PsdFrame.Name
- Aurigma.GraphicsMill.Drawing.CustomFontRegistry.Add(String)
- Aurigma.GraphicsMill.Drawing.FontAddResult.PostscriptName
- Aurigma.GraphicsMill.Drawing.FontRegistry.FallbackFonts
- Aurigma.GraphicsMill.Drawing.SolidBrush
- Aurigma.GraphicsMill.Drawing.Text.Brush
- Aurigma.GraphicsMill.Drawing.Text.String
- Aurigma.GraphicsMill.Templates.FontResolver.FontRegistry
- Aurigma.GraphicsMill.Templates.PsdProcessor