Update Text
View as MarkdownUpdates 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
DownloadOutput
UpdateText.pdf
DownloadUpdateText.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.Templates.FontResolver.FontRegistry
- Aurigma.GraphicsMill.Templates.PsdFrameExtensions.GetFormattedText(PsdTextFrame)
- Aurigma.GraphicsMill.Templates.PsdProcessor