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

Free Support Forum - aspose.com

Core fonts always embedded when preserving form fields

I want to be able to save a Word document to PDF while preserving form-fields which can contain custom fonts.
Those fonts need to be fully embedded in the document so document can be filled and flattend afterwards.
I found out that the resulting PDF document is very large when using standard fonts, for example Times New Roman or Arial. (500kb per font used)

It seems that when using form-fields, core fonts / standard fonts are always embedded:

Code snippet:
save_options = PdfSaveOptions()
save_options.setCompliance(PdfCompliance.PDF_15)
save_options.setPreserveFormFields(True)
save_options.setEmbedFullFonts(True)
save_options.setUseCoreFonts(True)
save_options.setEmbedStandardWindowsFonts(False)
save_options.setFontEmbeddingMode(PdfFontEmbeddingMode.EMBED_NONSTANDARD)

Document doc = Document("doc_with_form_field.docx")
doc.save('doc_with_form_field.pdf', save_options)

Tested with Aspose Words 16.11.0
Hi Robbert,

Thanks for your inquiry. We suggest you please read the detail of PdfSaveOptions's properties.

In your case, we suggest you please use only following PdfSaveOptions properties. Hope this helps you.

save_options = PdfSaveOptions()
save_options.setPreserveFormFields(True)
save_options.setFontEmbeddingMode(PdfFontEmbeddingMode.EMBED_NONSTANDARD)

Document doc = Document("doc_with_form_field.docx")
doc.save('doc_with_form_field.pdf', save_options)
This does not solve my problem as it subsets nonstandard fonts.
See example attached.
When I change the textboxfield and enter some characters that are not already included in the document a different font is used for those characters which is not as desired.
Hi Robbert,

Thanks for your inquiry. As per my understanding, you want to embed fonts in the Pdf except standards fonts e.g. "Times New Roman", "Arial" etc. We have logged this issue as WORDSNET-14500 in our issue tracking system. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for .NET 18.12 update and this Aspose.Words for Java 18.12 update.