Update Text Color

View as Markdown

PersonalizationPSD Processor

Updates 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

Download

Output

UpdateTextColor.pdf

Download

UpdateTextColor.png

UpdateTextColor.png

Used APIs