Update Text

View as Markdown

PersonalizationPSD Processor

Updates text layer 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.StringCallback = (processor, textFrame) =>
{
    var textString = textFrame.GetFormattedText();

    if (textFrame.Name == "Name")
    {
        textString = "Type your name";
    }

    return textString;
};

psdProcessor.Render("BusinessCard.psd", "UpdateText.pdf");

Input

BusinessCard.psd

Download

Output

UpdateText.pdf

Download

UpdateText.png

UpdateText.png

Used APIs