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

Free Support Forum - aspose.com

Enable OpenType Feature throw Exception | DOCX to PDF Conversion using Java

Hi (we have a paid licence for Aspose.Words :slight_smile: )

we have a problem when we convert docx to pdf using Aspose 20.8

we have a code like

final Document document = new Document(inputStream);
document.getLayoutOptions().setTextShaperFactory(HarfBuzzTextShaperFactory.getInstance());
synchronized (HARFBUZZ_LOCK_CONSTANT) {
    document.save(outputStream, asposeSaveOptions.getPdfSaveOptions());
} 

and we are getting :

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 42011 com.aspose.words.shaping.harfbuzz.HB.**hb_buffer_add_utf8**(J[BIII)V (0 bytes) @ 0x000000000b036767 [0x000000000b036700+0x67]

the error is inconsistent with documents

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 41693  com.aspose.words.shaping.harfbuzz.HB.hb_buffer_add_utf8(J[BIII)V (0 bytes) @ 0x000000000b6db3a7 [0x000000000b6db340+0x67]
J 45009 C2 com.aspose.words.shaping.harfbuzz.zzR.shapeText([Ljava/lang/String;II[I)[[Lcom/aspose/words/Cluster; (114 bytes) @ 0x000000000bfbd59c [0x000000000bfbc8c0+0xcdc]
J 51890 C2 com.aspose.words.zzYU3.zzZ(Lcom/aspose/words/zzYTF;Lcom/aspose/words/ITextShaperFactory;)Ljava/util/HashMap; (374 bytes) @ 0x000000000d4dc7e8 [0x000000000d4da3a0+0x2448]
J 41767 C2 com.aspose.words.zzYU5.zzZH(Lcom/aspose/words/zzYTF;)V (101 bytes) @ 0x000000000b77060c [0x000000000b76fee0+0x72c]
J 47641 C2 com.aspose.words.zzYU6.zzY(Lcom/aspose/words/zzYSD;)I (13 bytes) @ 0x000000000ca04cf8 [0x000000000ca04ca0+0x58]
J 50379 C2 com.aspose.words.zzXU.zzaD()I (33 bytes) @ 0x00000000091d0bc0 [0x00000000091d0b20+0xa0]
J 52450 C2 com.aspose.words.zzXT.zzaD()I (8 bytes) @ 0x000000000b728da0 [0x000000000b728d60+0x40]
J 51987 C2 com.aspose.words.zzZ34.zzZ(Lcom/aspose/words/zzXT;ILcom/aspose/words/ref/RefInt;)I (441 bytes) @ 0x000000000d534920 [0x000000000d533d60+0xbc0]
J 56306 C2 com.aspose.words.zzZ34.zzYLd()V (678 bytes) @ 0x000000000ded3a00 [0x000000000ded30c0+0x940]
J 46869 C1 com.aspose.words.zzZ30.zzYKZ()V (47 bytes) @ 0x000000000c60eb74 [0x000000000c60ea00+0x174]
J 50265 C1 com.aspose.words.zzYH.zzem()V (443 bytes) @ 0x000000000c5da594 [0x000000000c5d8660+0x1f34]
J 50267 C2 com.aspose.words.zzYH.zzex()Lcom/aspose/words/zzYPT; (16 bytes) @ 0x000000000a7c69ac [0x000000000a7c6860+0x14c]
j  com.aspose.words.zzGF.zzZ(Lcom/aspose/words/zzYPS;Lcom/aspose/words/zzYPY;)[Ljava/lang/Object;+181
j  com.aspose.words.zzGF.zzZ(Lcom/aspose/words/zzYPS;)Lcom/aspose/words/zzYPY;+16
j  com.aspose.words.zzZHG.zzU(Lcom/aspose/words/zzYPS;)Lcom/aspose/words/zzYPY;+36
j  com.aspose.words.zzYPS.zzYoq()Z+37
j  com.aspose.words.zzYPS.zzYKZ()V+10
J 54459 C1 com.aspose.words.zzZHG.zzS(Lcom/aspose/words/zzYPS;)Z (290 bytes) @ 0x000000000d9f7bec [0x000000000d9f5f00+0x1cec]
j  com.aspose.words.zzZHG.zzT(Lcom/aspose/words/zzYPS;)Z+143
j  com.aspose.words.zzZHG.zzU(Lcom/aspose/words/zzYPS;)Lcom/aspose/words/zzYPY;+22
j  com.aspose.words.zzYPS.zzYoq()Z+37
j  com.aspose.words.zzYPS.zzYKZ()V+10
J 52641 C2 com.aspose.words.zzYPS.zzYoN()[I (55 bytes) @ 0x000000000bc5ab04 [0x000000000bc5aa80+0x84]
J 48740 C2 com.aspose.words.zzGF.zzX(Lcom/aspose/words/zzYH;)I (49 bytes) @ 0x000000000cb666ac [0x000000000cb66240+0x46c]
J 54730 C2 com.aspose.words.zzGF.zzM(Lcom/aspose/words/zzYZF;)Z (442 bytes) @ 0x000000000b55400c [0x000000000b553ec0+0x14c]
J 50924 C2 com.aspose.words.zzYTZ.zzYx0()V (209 bytes) @ 0x000000000d1fcc30 [0x000000000d1fc5c0+0x670]
J 52566 C2 com.aspose.words.zzYTZ.zzZ(Lcom/aspose/words/zzYU0;IZZ)Z (50 bytes) @ 0x000000000d75fbe0 [0x000000000d75f380+0x860]
J 53045 C1 com.aspose.words.zzXF.zz9B()Z (51 bytes) @ 0x000000000c6c382c [0x000000000c6c2e00+0xa2c]
J 55331 C1 com.aspose.words.zzXF.zzW(Lcom/aspose/words/zzXG;I)Z (328 bytes) @ 0x00000000081756ac [0x0000000008172ee0+0x27cc]
J 53855 C1 com.aspose.words.zzXF.zzX(Lcom/aspose/words/zzXG;I)Z (66 bytes) @ 0x000000000846408c [0x0000000008463780+0x90c]
J 51622 C1 com.aspose.words.zzZ3F.zzB(Lcom/aspose/words/zzXG;)Z (172 bytes) @ 0x000000000d3f3e5c [0x000000000d3f3860+0x5fc]
J 48870 C1 com.aspose.words.zzZ3F.zzC(Lcom/aspose/words/zzXG;)Z (61 bytes) @ 0x000000000720abf4 [0x000000000720a5a0+0x654]
J 51051 C1 com.aspose.words.zzZ3F.zzYMp()V (110 bytes) @ 0x00000000084ab7d4 [0x00000000084aac80+0xb54]
J 53821 C2 com.aspose.words.zzZ2R.zzI(Lcom/aspose/words/zzZ2T;)V (146 bytes) @ 0x000000000d81766c [0x000000000d816da0+0x8cc]
J 53048 C1 com.aspose.words.zzYS0.zz9(Lcom/aspose/words/zzZ2T;)Z (241 bytes) @ 0x00000000053ca734 [0x00000000053c9360+0x13d4]
J 52510 C1 com.aspose.words.zz85.zzI(Lcom/aspose/words/zzZ2T;)V (34 bytes) @ 0x000000000ceed7ec [0x000000000ceed3e0+0x40c]
j  com.aspose.words.zz86.zzZD5()V+24
J 50150 C2 com.aspose.words.zzZ3K.zzYMI()V (307 bytes) @ 0x000000000cbac10c [0x000000000cba9280+0x2e8c]
j  com.aspose.words.Document.updatePageLayout()V+63
J 54345 C1 com.aspose.words.Document.getPageCount()I (11 bytes) @ 0x000000000d946524 [0x000000000d946280+0x2a4]
j  com.aspose.words.zzZYM.zzY(Lcom/aspose/words/zzYVT;Lcom/aspose/words/zzZK4;)V+28
j  com.aspose.words.zzZYM.zzZ(Lcom/aspose/words/zzYVT;)Lcom/aspose/words/SaveOutputParameters;+88
j  com.aspose.words.zzZDA.zzZ(Lcom/aspose/words/zzYVT;)Lcom/aspose/words/SaveOutputParameters;+31
j  com.aspose.words.Document.zzY(Lcom/aspose/words/zzYVT;)Lcom/aspose/words/SaveOutputParameters;+144
j  com.aspose.words.Document.zzZ(Lcom/aspose/words/internal/zz2O;Ljava/lang/String;Lcom/aspose/words/SaveOptions;)Lcom/aspose/words/SaveOutputParameters;+190
j  com.aspose.words.Document.zzZ(Lcom/aspose/words/internal/zz2O;Lcom/aspose/words/SaveOptions;)Lcom/aspose/words/SaveOutputParameters;+25
j  com.aspose.words.Document.save(Ljava/io/OutputStream;Lcom/aspose/words/SaveOptions;)Lcom/aspose/words/SaveOutputParameters;+11

@moshelatin

Could you please ZIP and attach your input Word document here for testing? We will investigate the issue and provide you more information on it.

for aspose use .zip (75.0 KB)
Hi Tahir

I am attaching the docx + the custom font Sample.docx (12.4 KB)

@moshelatin

We have tested the scenario using the latest version of Aspose.Words for Java 21.5 and have not found the shared issue. So, please use Aspose.Words for Java 21.5. We have attached the output PDF with this post for your kind reference. 21.5.pdf (33.4 KB)

Hi Tahir

its happen only on a load test after 1 hour of conversion from docx to pdf

for single conversion, it works great can u check it with load test?

@moshelatin

Please try the latest version of Aspose.Words 21.6 and let us know if you still face the same issue.