We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Subset fonts not populating text fields

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,


Sorry for the delayed response. While testing your scenario with Aspsoe.Pdf for .NET 8.0, I’m unable to replicate the issue. Please download and try latest API, hopefully your issue will be resolved. If issue persist then can you please share your sample code to reproduce the issue?

Please feel free to contact us for any further assistance.

Best Regards,