Hi am evaluating Aspose slides for Java for converting PPTx to PDF and this PPTx was built with licensed fonts like Arial/TImes New Roman/Verdena. And this conversion happens on Linux. I added code as addEmbeddedFont with the input stream of font as parameter. So do i need license of Arial font here?
Cause
When converting PPTX files that use licensed fonts like Arial, Times New Roman, or Verdana, it is essential to ensure that you possess the appropriate licenses for those fonts, particularly when embedding them in your output PDF. The licensing requirements for fonts can vary based on their usage and distribution.
Solution
To embed fonts in your PDF output using Aspose.Slides for Java, you must have the proper licenses for those fonts. This is crucial to avoid any legal issues related to font licensing. Ensure that you have the font files and the rights to use those fonts in your application.
Code
Here’s a simple example of how to embed a font in your presentation:
import com.aspose.slides.*;
public class EmbedFontExample {
public static void main(String[] args) {
// Load your presentation
Presentation presentation = new Presentation("input.pptx");
// Load the font file
InputStream fontStream = new FileInputStream("path/to/your/font.ttf");
// Add the embedded font
FontsManager.addEmbeddedFont(fontStream);
// Save the presentation as PDF
presentation.save("output.pdf", SaveFormat.Pdf);
}
}
Make sure to replace "path/to/your/font.ttf"
with the actual path to your font file.
Next Steps
- Verify that you have the licenses for the fonts you are using.
- Test the code to ensure that the fonts are embedded correctly in the PDF.
- If you encounter any issues, consult the Aspose documentation for further guidance on font licensing and embedding.
If you have any further questions or need additional assistance, feel free to ask!
what is Subset embedding and do Aspose do subset embedding or full font embedding
@ysomaraju,
You do not need to buy a separate licence for Arial, Times New Roman or Verdana just to embed them in the PDF that Aspose.Slides produces. What matters is that the font files you feed to addEmbeddedFont
were obtained under a valid Microsoft or Monotype licence (for example by installing the ttf-mscorefonts-installer package or by using fonts that came with a licensed copy of Windows or Office). The standard EULA for the Microsoft Core Fonts allows “document embedding” of these fonts, and the files themselves already carry the “editable” or “print & preview” embedding flag, so a PDF generator may include a subset of the glyphs without further permission.
The IFontsManager interface allows you to embed a font in a presentation with either all characters (best for editing by others) or only the characters used (best for reducing file size).
presentation.getFontsManager().addEmbeddedFont(fontData, EmbedFontCharacters.All);
EmbedFontCharacters | Aspose.Slides for Java API Reference
More examples:
Embedded Font - PowerPoint Java API|Aspose.Slides Documentation