service-it-01#32663
Hello,
like the subject explain it, when I Render a PSD template, the position of elements in result (in jpg) are a little bit different than the original.
I join my code and also original and render.
Do you have any idea why ?
Original
attach #1392
Render
attach #1391
like the subject explain it, when I Render a PSD template, the position of elements in result (in jpg) are a little bit different than the original.
I join my code and also original and render.
Do you have any idea why ?
Original
attach #1392
Render
attach #1391
//Create a font fetcher and specify a local folder to download fonts to.
var fontResolver = new FontResolver(@"Fonts");
//Set font source for the fetcher.
//Add a local font source.
fontResolver.AddSource(new FileSystemSource(@"C:\tmp\PSD\Fonts"));
var psdProcessorFont = new PsdProcessor(fontResolver);
var missingFonts = psdProcessorFont.GetMissingFonts(file);
if (missingFonts.Count() > 0)
{
Console.WriteLine("The following fonts are not found in the given font sources: ");
foreach (var font in missingFonts)
Console.WriteLine(" {0}", font);
}
else
{
}
var psdProcessor = new PsdProcessor(fontResolver);
psdProcessor.TextCallback = (processor, textFrame, textstring) =>
{
var text = processor.ProcessText(textFrame);
try
{
if (textFrame.Name == "CustomerName")
{
text.String = "<p><span>Cher David,</span></p>";
}
return text;
}
catch
{
return text;
}
};
psdProcessor.Render(file, file.Replace(".psd",".jpg"));