Embedded fonts using Java

Hi,


Could you please help me?
How code sample below would look in Java?

[C#]

Document doc = new Document(“d:/pdftest/HTML2pdf.pdf”);

foreach (Page page in doc.Pages)

{

if (page.Resources.Fonts != null)

{

foreach (Pdf.Text.Font pageFont in page.Resources.Fonts)

{

if (!pageFont.IsEmbedded)

pageFont.IsEmbedded = true;

}

}

foreach (XForm form in page.Resources.Forms)

{

if (form.Resources.Fonts != null)

{

foreach (Pdf.Text.Font formFont in form.Resources.Fonts)

{

if (!formFont.IsEmbedded)

formFont.IsEmbedded = true;

}

}

}

}

doc.Save(“d:/pdftest/FontEmbedded.p0df”);

Hi Josh,


Thanks for contacting support.

Currently the feature to embed Font in existing PDF document is only supported in Aspose.Pdf for .NET and Aspose.Pdf for Java or Aspose.Pdf.Kit for Java does not support the feature to embed the font in existing PDF files. However we are busy testing the auto ported version of Aspose.Pdf for .NET to Java platform which will support/provide all the features as currently offered by Aspose.Pdf for .NET and it will also offer the functionality to embed fonts in existing PDF files over Java platform.

The product is under testing phase and is not yet released. Once the new Auto-ported version of Aspose.Pdf for Java becomes available, we would be more than happy to update you with the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hi Josh,


Thanks for your patience.

I am pleased to share that an autoported MergedAPI release version of Aspose.Pdf for Java 4.0.0 has been released. Please try using the latest release version and in case you encounter any issue or you have any related query, please feel free to contact.