Hello,
I am having an issue where setting the embedded fonts as subset is not populating text fields on our PDF’s.
To be clear, we have PDF documents being generated from templates that contain both rich text fields and text fields. We populate this data via tag names and then set all the fonts to subset via the code below. This works very well for our rich text but it removes the text from the regular text fields. Is there any other way to accomplish this? It would be a huge overhaul to change every tag to a rich text field.
Thanks,
Anthony
The code:
foreach (Page page in doc.Pages)
{
if (page.Resources.Fonts != null)
{
foreach (Aspose.Pdf.Text.Font pageFont in page.Resources.Fonts)
{
if (pageFont.IsEmbedded)
{
pageFont.IsSubset = true;
}
}
}
foreach (XForm form in page.Resources.Forms)
{
if (form.Resources.Fonts != null)
{
foreach (Aspose.Pdf.Text.Font formFont in form.Resources.Fonts)
{
if (formFont.IsEmbedded)
{
formFont.IsSubset = true;
}
}
}
}
}
Hi Anthony,