Can Aspose.PDF for Java Be Set To Always Substitute Fonts?

Hello,

Aspose sales sent us here to ask if Aspose.PDF for Java can be set to always substitute fonts if none are embedded in the PDF to convert to Word. We speculate that the lack of embedded fonts is why it keeps erring; for example:

Causing: java.lang.RuntimeException: class com.aspose.pdf.exceptions.FontNotFoundException: Font Arial can not found.
! com.aspose.pdf.internal.l6if.l1h.l1h(Unknown Source)
! com.aspose.pdf.internal.l4y.lI.lI(Unknown Source)
! com.aspose.pdf.internal.l4y.lj.lI(Unknown Source)
! com.aspose.pdf.internal.l3n.lu.lj(Unknown Source)
! com.aspose.pdf.internal.l3n.lu.lb(Unknown Source)
! com.aspose.pdf.internal.l3n.lu.lf(Unknown Source)
! com.aspose.pdf.internal.l3n.lu.lf(Unknown Source)
! com.aspose.pdf.l13t.lI(Unknown Source)
! com.aspose.pdf.l13t.lb(Unknown Source)
! com.aspose.pdf.ApsUsingConverter.lI(Unknown Source)
! com.aspose.pdf.ApsUsingConverter.lf(Unknown Source)
! com.aspose.pdf.l4j.lI(Unknown Source)
! com.aspose.pdf.ADocument.lj(Unknown Source)
! com.aspose.pdf.ADocument.lI(Unknown Source)
! com.aspose.pdf.Document.lI(Unknown Source)
! com.aspose.pdf.ADocument.save(Unknown Source)
! com.aspose.pdf.Document.save(Unknown Source)
! fileconverter.conversion.AsposeService.realConvert(AsposeService.java:45)
! fileconverter.conversion.AsposeService.lambda$convertDocument$3(AsposeService.java:71)
! rx.functions.Functions$4.call(Functions.java:114)
! rx.internal.operators.OperatorZip$Zip.tick(OperatorZip.java:252)
! rx.internal.operators.OperatorZip$Zip$InnerSubscriber.onNext(OperatorZip.java:323)
! rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:395)
! rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:355)
! rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:846)
! rx.internal.operators.OperatorTake$1.onNext(OperatorTake.java:79)
! rx.internal.operators.OnSubscribeFromIterable$IterableProducer.slowPath(OnSubscribeFromIterable.java:117)
! rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(OnSubscribeFromIterable.java:89)
! rx.internal.operators.OperatorTake$1$1.request(OperatorTake.java:112)
! rx.Subscriber.setProducer(Subscriber.java:211)
! rx.internal.operators.OperatorTake$1.setProducer(OperatorTake.java:96)

Thanks in advance for any help!

-Brian

P.S. Bonus: if anyone has any pointers to expected conversion performance, optimal AWS configuration, etc. for Aspose.PDF for Java. :blush:

@btn

Aspose.PDF requires fonts when PDF is converted to Word document. If compatible fonts are not found on your system, the exception will be raised. You need to install fonts that are used in your PDF on the machine where you are converting PDF to Word.

If you are converting PDF to Word on non-Windows operating system, we recommend you to install msttcorefonts package. msttcorefonts is considered globally legal for installation because the license for the fonts allow them to be installed and by omission, installed on non-Windows operating systems, without a Windows license.

1 Like