Class com.aspose.slides.exceptions.InvalidOperationException: Cannot Find Table 'loca' in the Font File

(短)3.4世界的聚落课件.zip (2.2 MB)

hi,ptt转pdf文件转换失败,提示错误

class com.aspose.slides.exceptions.InvalidOperationException: Cannot find table ‘loca’ in the font file.

麻烦解决一下

@aaron0309,
感谢您联系支持。

使用 Aspose.Slides for Java 24.4 我无法重现错误。我们建议您使用最新版本的 Aspose.Slides for Java

目前我们使用的就是最新的aspose-slides-24.4-android.via.java,麻烦在重现下问题,其他文档不会出现该问题

@aaron0309,
请分享以下额外信息:

  • 最简单的项目以重现错误
  • 错误发生的操作系统版本
// 新建一个空白pdf文档
File newPdffile = new File("fileName");
if (!newPdffile.getParentFile().exists()) {
    newPdffile.getParentFile().mkdirs();
}
newPdffile.createNewFile();

FileOutputStream os = new FileOutputStream(newPdffile);

PdfOptions pdfOptions = new PdfOptions();
INotesCommentsLayoutingOptions options = pdfOptions.getNotesCommentsLayouting();
options.setNotesPosition(NotesPositions.BottomFull);
Presentation pres = new Presentation(uriFile);
// 保存到 PDF 格式
pres.save(os,com.aspose.slides.SaveFormat.Pdf,pdfOptions);

大概代码如上。发生的错误系统版本事:Xiaomi Redmi Note 8 , Android1版本11 MIUI版本 12.5.5

@aaron0309,
谢谢您提供的额外信息。您能否也分享一下错误的完整堆栈跟踪?

2024-05-06 18:17:02.811 22718-23095 ChooseA4FileActivity com.printgo E License set successfully.
2024-05-06 18:17:09.290 22718-22718 Choreographer com.printgo I Skipped 388 frames! The application may be doing too much work on its main thread.
2024-05-06 18:17:09.308 22718-22718 Looper com.printgo W PerfMonitor doFrame : time=19ms vsyncFrame=0 latency=6469ms procState=2
2024-05-06 18:17:09.311 22718-23049 OpenGLRenderer com.printgo I Davey! duration=6490ms; Flags=0, IntendedVsync=458827980524966, Vsync=458834447191374, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=458834452616738, AnimationStart=458834452724082, PerformTraversalsStart=458834452823925, DrawStart=458834462327779, SyncQueued=458834466317675, SyncStart=458834467719967, IssueDrawCommandsStart=458834467901842, SwapBuffers=458834469835019, FrameCompleted=458834472376790, DequeueBufferDuration=853177, QueueBufferDuration=1295781, GpuCompleted=0,
2024-05-06 18:17:15.439 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 220235(7732KB) AllocSpace objects, 734(48MB) LOS objects, 49% free, 17MB/35MB, paused 92us total 130.548ms
2024-05-06 18:17:22.296 22718-22731 com.printgo com.printgo I Method exceeds compiler instruction limit: 37230 in com.aspose.slides.Collections.Generic.List com.aspose.slides.ts.ui()
2024-05-06 18:17:22.322 22718-22731 com.printgo com.printgo I Method exceeds compiler instruction limit: 40965 in com.aspose.slides.Collections.Generic.List com.aspose.slides.ts.pp()
2024-05-06 18:17:22.356 22718-22731 com.printgo com.printgo I Method exceeds compiler instruction limit: 31461 in com.aspose.slides.Collections.Generic.List com.aspose.slides.ts.c4()
2024-05-06 18:17:22.379 22718-22731 com.printgo com.printgo I Method exceeds compiler instruction limit: 31389 in com.aspose.slides.Collections.Generic.List com.aspose.slides.ts.xr()
2024-05-06 18:17:22.402 22718-22731 com.printgo com.printgo I Method exceeds compiler instruction limit: 37140 in com.aspose.slides.Collections.Generic.List com.aspose.slides.ts.j1()
2024-05-06 18:17:22.431 22718-22731 com.printgo com.printgo I Method exceeds compiler instruction limit: 37329 in com.aspose.slides.Collections.Generic.List com.aspose.slides.ts.sj()
2024-05-06 18:17:22.645 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 198806(9245KB) AllocSpace objects, 42(2452KB) LOS objects, 49% free, 23MB/47MB, paused 90us total 139.808ms
2024-05-06 18:17:43.068 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 439439(14MB) AllocSpace objects, 145(4912KB) LOS objects, 45% free, 28MB/52MB, paused 88us total 160.979ms
2024-05-06 18:17:45.016 22718-22718 Choreographer com.printgo W Frame time is 0.104495 ms in the future! Check that graphics HAL is generating vsync timestamps using the correct timebase.
2024-05-06 18:17:50.634 22718-22718 Choreographer com.printgo W Frame time is 0.02335 ms in the future! Check that graphics HAL is generating vsync timestamps using the correct timebase.
2024-05-06 18:18:00.608 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 621321(17MB) AllocSpace objects, 11(2928KB) LOS objects, 39% free, 37MB/61MB, paused 170us total 262.669ms
2024-05-06 18:18:01.521 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 652449(12MB) AllocSpace objects, 5(244KB) LOS objects, 13% free, 53MB/61MB, paused 125us total 131.575ms
2024-05-06 18:18:01.919 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 835472(20MB) AllocSpace objects, 7(444KB) LOS objects, 27% free, 62MB/86MB, paused 90us total 327.861ms
2024-05-06 18:18:02.350 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 883232(16MB) AllocSpace objects, 10(540KB) LOS objects, 9% free, 77MB/86MB, paused 108us total 184.503ms
2024-05-06 18:18:02.557 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=17 ms, max=17 ms.
2024-05-06 18:18:02.868 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 864520(16MB) AllocSpace objects, 8(492KB) LOS objects, 22% free, 80MB/104MB, paused 96us total 452.939ms
2024-05-06 18:18:02.959 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=16 ms, max=16 ms.
2024-05-06 18:18:03.493 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 701199(14MB) AllocSpace objects, 6(344KB) LOS objects, 9% free, 94MB/104MB, paused 111us total 132.809ms
2024-05-06 18:18:03.985 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=19 ms, max=19 ms.
2024-05-06 18:18:04.166 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 1336846(24MB) AllocSpace objects, 12(688KB) LOS objects, 15% free, 128MB/152MB, paused 112us total 580.692ms
2024-05-06 18:18:04.226 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=4, avg=15 ms, max=30 ms.
2024-05-06 18:18:04.859 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 1212732(23MB) AllocSpace objects, 12(688KB) LOS objects, 14% free, 130MB/152MB, paused 107us total 203.615ms
2024-05-06 18:18:04.909 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=24 ms, max=24 ms.
2024-05-06 18:18:05.196 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=18 ms, max=18 ms.
2024-05-06 18:18:05.954 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 1833262(34MB) AllocSpace objects, 17(932KB) LOS objects, 11% free, 178MB/202MB, paused 118us total 829.325ms
2024-05-06 18:18:06.456 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 1295511(26MB) AllocSpace objects, 9(516KB) LOS objects, 11% free, 177MB/201MB, paused 120us total 200.597ms
2024-05-06 18:18:09.225 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 1094574(24MB) AllocSpace objects, 32(1772KB) LOS objects, 11% free, 177MB/201MB, paused 113us total 812.551ms
2024-05-06 18:18:14.979 22718-22731 com.printgo com.printgo I Compiler allocated 4365KB to compile boolean com.aspose.slides.ms.System.i1.ui(java.lang.String, java.lang.String, java.lang.String, boolean, com.aspose.slides.ms.System.i1[], com.aspose.slides.ms.System.u0[], com.aspose.slides.internal.r9.c4, int, boolean, boolean[], boolean[])
2024-05-06 18:18:17.033 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 402365(11MB) AllocSpace objects, 130(9020KB) LOS objects, 11% free, 188MB/212MB, paused 109us total 845.128ms
2024-05-06 18:18:19.517 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 720059(19MB) AllocSpace objects, 55(1500KB) LOS objects, 9% free, 191MB/212MB, paused 100us total 133.182ms
2024-05-06 18:18:26.827 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 506100(13MB) AllocSpace objects, 45(3268KB) LOS objects, 8% free, 194MB/212MB, paused 107us total 114.102ms
2024-05-06 18:18:30.601 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=17 ms, max=17 ms.
2024-05-06 18:18:34.023 22718-22731 com.printgo com.printgo I Compiler allocated 4408KB to compile void com.aspose.slides.cx9.ui(com.aspose.slides.jg[], boolean[])
2024-05-06 18:18:36.352 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=17 ms, max=17 ms.
2024-05-06 18:18:40.320 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=16 ms, max=16 ms.
2024-05-06 18:18:42.837 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=17 ms, max=17 ms.
2024-05-06 18:18:44.555 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=17 ms, max=17 ms.
2024-05-06 18:18:45.655 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=20 ms, max=20 ms.
2024-05-06 18:18:47.073 22718-23049 RenderInspector com.printgo W DequeueBuffer time out on com.printgo/com.jdprint.ui.ChooseA4FileActivity, count=1, avg=18 ms, max=18 ms.
2024-05-06 18:18:47.369 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 1019941(50MB) AllocSpace objects, 3(108KB) LOS objects, 9% free, 220MB/244MB, paused 112us total 953.705ms
2024-05-06 18:18:47.777 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 888321(41MB) AllocSpace objects, 0(0B) LOS objects, 10% free, 208MB/232MB, paused 108us total 105.149ms
2024-05-06 18:18:48.181 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 430955(24MB) AllocSpace objects, 0(0B) LOS objects, 8% free, 213MB/232MB, paused 126us total 112.714ms
2024-05-06 18:18:48.521 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 353867(21MB) AllocSpace objects, 0(0B) LOS objects, 7% free, 216MB/232MB, paused 106us total 100.176ms
2024-05-06 18:18:51.324 22718-22732 com.printgo com.printgo I Background concurrent copying GC freed 2316383(78MB) AllocSpace objects, 0(0B) LOS objects, 9% free, 223MB/247MB, paused 113us total 983.502ms
2024-05-06 18:18:51.763 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 705180(41MB) AllocSpace objects, 0(0B) LOS objects, 10% free, 208MB/232MB, paused 114us total 167.290ms
2024-05-06 18:18:51.898 22718-22731 com.printgo com.printgo I Compiler allocated 4206KB to compile void com.aspose.slides.ijx.ui(com.aspose.slides.r1, com.aspose.slides.x6g, com.aspose.slides.yx8, boolean, com.aspose.slides.xz1, boolean, int[], com.aspose.slides.mc, boolean[])
2024-05-06 18:18:52.922 22718-22732 com.printgo com.printgo I Background young concurrent copying GC freed 739112(19MB) AllocSpace objects, 0(0B) LOS objects, 8% free, 213MB/232MB, paused 106us total 149.952ms
2024-05-06 18:19:45.921 22718-23095 System.err com.printgo W class com.aspose.slides.exceptions.InvalidOperationException: Cannot find table ‘loca’ in the font file.
2024-05-06 18:19:45.921 22718-23095 System.err com.printgo W com.aspose.slides.internal.ut.y5.ui(Unknown Source:21)
2024-05-06 18:19:45.922 22718-23095 System.err com.printgo W com.aspose.slides.internal.ut.y5.ui(Unknown Source:75)
2024-05-06 18:19:45.922 22718-23095 System.err com.printgo W com.aspose.slides.internal.ut.je.ui(Unknown Source:32)
2024-05-06 18:19:45.922 22718-23095 System.err com.printgo W com.aspose.slides.internal.k5.lu.ui(Unknown Source:7)
2024-05-06 18:19:45.923 22718-23095 System.err com.printgo W com.aspose.slides.internal.k5.c4.ui(Unknown Source:13)
2024-05-06 18:19:45.923 22718-23095 System.err com.printgo W com.aspose.slides.internal.k5.ui.ui(Unknown Source:126)
2024-05-06 18:19:45.923 22718-23095 System.err com.printgo W com.aspose.slides.internal.k5.lu.ui(Unknown Source:5)
2024-05-06 18:19:45.924 22718-23095 System.err com.printgo W com.aspose.slides.internal.fy.en.ui(Unknown Source:23)
2024-05-06 18:19:45.924 22718-23095 System.err com.printgo W com.aspose.slides.internal.fy.en.pp(Unknown Source:6)
2024-05-06 18:19:45.924 22718-23095 System.err com.printgo W com.aspose.slides.internal.fy.d5.ui(Unknown Source:42)
2024-05-06 18:19:45.924 22718-23095 System.err com.printgo W com.aspose.slides.internal.fy.sj.ui(Unknown Source:306)
2024-05-06 18:19:45.925 22718-23095 System.err com.printgo W com.aspose.slides.internal.fy.lu.ui(Unknown Source:23)
2024-05-06 18:19:45.925 22718-23095 System.err com.printgo W com.aspose.slides.internal.fy.i1.ui(Unknown Source:2)
2024-05-06 18:19:45.925 22718-23095 System.err com.printgo W com.aspose.slides.hr.ui(Unknown Source:477)
2024-05-06 18:19:45.925 22718-23095 System.err com.printgo W com.aspose.slides.hr.ui(Unknown Source:30)
2024-05-06 18:19:45.926 22718-23095 System.err com.printgo W com.aspose.slides.mpo.pp(Unknown Source:0)
2024-05-06 18:19:45.926 22718-23095 System.err com.printgo W com.aspose.slides.Presentation.ui(Unknown Source:559)
2024-05-06 18:19:45.926 22718-23095 System.err com.printgo W com.aspose.slides.Presentation$2.ui(Unknown Source:6)
2024-05-06 18:19:45.927 22718-23095 System.err com.printgo W com.aspose.slides.internal.t9.ui.ui(Unknown Source:6)
2024-05-06 18:19:45.927 22718-23095 System.err com.printgo W com.aspose.slides.internal.t9.pp.ui(Unknown Source:0)
2024-05-06 18:19:45.927 22718-23095 System.err com.printgo W com.aspose.slides.Presentation.save(Unknown Source:5)

@aaron0309
谢谢您提供的额外信息。

我们已经在我们的内部问题跟踪系统中开了以下的新工单,并将根据 Free Support Policies 中提到的条款来进行修复。

Issue ID(s): SLIDESANDROID-505

如果您需要优先获得支持,可以通过 Paid Support Services 获取,并直接与我们的付费支持管理团队联系。

@aaron0309,
异常发生是因为缺少字体。我们使用 FontsLoader 类加载了 “Segoe UI Emoji” 字体,异常消失了。请尝试使用这个解决方案。

FontsLoader.loadExternalFonts(new String[] { "your_path_to_fonts" });

Custom PowerPoint Font in Java|Aspose.Slides Documentation