We are using Alpine and Docker file is having all the necessary fonts getting installed like below
# Install fonts
RUN apk add font-terminus font-inconsolata font-dejavu font-noto font-noto-cjk font-awesome font-noto-extra
RUN apk add font-vollkorn font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic
RUN apk add font-ipa font-sony-misc font-jis-misc font-isas-misc
RUN apk add font-noto-devanagari
RUN apk --no-cache add msttcorefonts-installer fontconfig && \
update-ms-fonts && \
fc-cache -f && \
rm -f /usr/bin/wget
For .Net code we are using below code and getting text in Chinese/Hindi/French language like
我在儿
मैं यहाँ हूँ
etc, it is not printing in the Pdf as it is with the below code
var doc = new Aspose.Pdf.Document(tempFileName);
var searchTerm = "\\[(?s)(.*?)\\]";
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(searchTerm);
TextSearchOptions textSearchOptions = new TextSearchOptions(true);
textFragmentAbsorber.TextSearchOptions = textSearchOptions;
doc.Pages.Accept(textFragmentAbsorber);
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
_logger.LogInformation($"ProcessGeneratePdfAsync for ProcessId-{excelProcess.ProcessId}, Identifying text fragments: {textFragmentCollection.Count}");
var sw = new Stopwatch();
sw.Start();
var foregroundColor = isTranslucent ? Color.Black : Color.White;
var backgroundColor = isTranslucent ? Color.Gray : Color.Black;
foreach (var textFragment in textFragmentCollection)
{
string text = textFragment.Text;
text = text.Replace("[", "").Replace("]", "");
textFragment.Text = text;
textFragment.TextState.ForegroundColor = foregroundColor;
textFragment.TextState.BackgroundColor = backgroundColor;
}
sw.Stop();
_logger.LogInformation($"ProcessGeneratePdfAsync for ProcessId-{excelProcess.ProcessId}, Completed applying styling for text fragments: {textFragmentCollection.Count}, time taken : {sw.ElapsedMilliseconds} ms");
doc.Save(tempFileName);
It is printing like box instead of actual text like( )
Can you please suggest what to do to fix this issue?