MATLAB Answers

Create PDF of Live Script produces broken PDF file

44 views (last 30 days)
Jon on 13 Nov 2017
Edited: Danielle on 2 Mar 2018
I am running MATLAB 2017a, on a MacBook Pro (2017, 15"), under OS X 10.13.1. When I try to save a Live Script as PDF, I get about 1000 java errors. The PDF is still generated, BUT the PDF file is broken - Acrobat will not open it.
When I open the same Live Script, under the same OS, but on my 2013 MBA, the PDF is generated with a thousand JAVA errors, BUT the PDF is not broken. Adobe Acrobat will open the PDF.
So it would appear that there is some interaction between the new crop of MBPs and MATLAB that is a problem. My MBP is Model Name: MacBook Pro Model Identifier: MacBookPro14,3 Processor Name: Intel Core i7 Processor Speed: 3.1 GHz Number of Processors: 1 Total Number of Cores: 4 L2 Cache (per Core): 256 KB L3 Cache: 8 MB Memory: 16 GB Display: 15.4-inch (2880 x 1800) Graphics: Radeon Pro 560 4 GB ...
My version of Java is current. I typically run with an external Thunderbolt display, but that is not the issue - I get the same result on the MBP if I run only the laptop screen.
For me, and I would guess anyone that is trying to use Live Scripts as a way to generate class-ready materials as PDF that this is a significant problem.
I would add - whether a good PDF is generated or not... seeing all those JAVA errors is disconcerting, and puzzling.
Best, ---jon---
Steffany Reyna Marquez
Steffany Reyna Marquez on 15 Nov 2017
Hello! I have exactly the same issue as Jon (a long message error and PDF empty). I run MATLAB 2017a in macOs highSierra (10.13.1). I updated my computer to this last version of macOS yesterday and whenever I click on "export to PDF" I get the following error:
Exception in thread "AWT-EventQueue-0" com.mathworks.util.event.EventListenerInvocationException: Error firing event:
caused by:
java.lang.OutOfMemoryError: Java heap space
at org.apache.fop.fonts.truetype.FontFileReader.<init>(
at org.apache.fop.fonts.autodetect.FontInfoFinder.find(
at org.apache.fop.fonts.FontAdder.add(
at org.apache.fop.fonts.FontDetectorFactory$DefaultFontDetector.detect(
at org.apache.fop.fonts.FontManager.autoDetectFonts(
at org.apache.fop.fonts.DefaultFontConfigurator.configure(
at org.apache.fop.render.PrintRendererConfigurator.getCustomFontCollection(
at org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(
at org.apache.fop.render.intermediate.IFUtil.setupFonts(
at org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(
at org.apache.fop.area.RenderPagesModel.<init>(
at org.apache.fop.area.AreaTreeHandler.setupModel(
at org.apache.fop.area.AreaTreeHandler.<init>(
at org.apache.fop.render.RendererFactory.createFOEventHandler(
at org.apache.fop.apps.Fop.createDefaultHandler(
at org.apache.fop.apps.Fop.<init>(
at org.apache.fop.apps.FOUserAgent.newFop(
at org.apache.fop.apps.FopFactory.newFop(
at com.mathworks.hg.print.MWFopFactory.newFop(
at com.mathworks.mde.liveeditor.widget.rtc.export.PDFFileUtils.write(
at com.mathworks.mde.liveeditor.widget.rtc.export.PDFExporter.writeXSLToPDFWithFile(
at com.mathworks.mde.liveeditor.widget.rtc.export.PDFExporter.export(
at com.mathworks.mde.liveeditor.LiveEditorClient.handleSaveAsNonMlxFile(
at com.mathworks.mde.liveeditor.LiveEditorClient.access$700(
at com.mathworks.mde.liveeditor.LiveEditorClient$5.saveAsAboutToHappen(
at com.mathworks.widgets.datamodel.AbstractFileBackingStore.saveToFile(
at com.mathworks.widgets.datamodel.AbstractFileBackingStore.doSaveToFileAndUpdateBackingStore(
at com.mathworks.widgets.datamodel.AbstractFileBackingStore.doNegotiateSaveAs(
at com.mathworks.widgets.datamodel.AbstractBackingStore.negotiateSaveAs(
at com.mathworks.util.event.EventListenerList$1.invoke(
at com.sun.proxy.$Proxy7.listItemSelected(Unknown Source)
at com.mathworks.toolstrip.plaf.TSListCellRenderer.mouseReleased(
at java.awt.AWTEventMulticaster.mouseReleased(
at java.awt.Component.processMouseEvent(
at javax.swing.JComponent.processMouseEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.LightweightDispatcher.retargetMouseEvent(
at java.awt.LightweightDispatcher.processMouseEvent(
at java.awt.LightweightDispatcher.dispatchEvent(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$300(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(
I have to say that this error has not appeared before updating to highSierra (I have been working with live scripts for the past 2 months with the older version Sierra).
Hope this helps you to try and find the bug in the software. Best Regards Steffany

Sign in to comment.

Accepted Answer

Jon on 16 Nov 2017
THANKS! Increasing the Java heap size by 50% did correct the problem on the LiveScript I was working with. Since you indicate that this problem was on some machines with the most recent Sierra (which is High Sierra, 10.13.1, I thoought you might want to know more characteristics of my machine. (Below - if more would be useful let me know.)
I really appreciate the responsiveness of the MathWorks in times like this!
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro14,3
Processor Name: Intel Core i7
Processor Speed: 3.1 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 16 GB
Boot ROM Version: MBP143.0167.B00
SMC Version (system): 2.45f0
Serial Number (system): <snip>
Hardware UUID: <snip>
Video Cards
Intel HD Graphics 630: Chipset Model: Intel HD Graphics 630 Type: GPU Bus: Built-In VRAM (Dynamic, Max): 1536 MB Vendor: Intel Device ID: <snip> Revision ID: 0x0004 Automatic Graphics Switching: Supported gMux Version: 4.0.29 [3.2.8] Metal: Supported, feature set macOS GPUFamily1 v3
Radeon Pro 560: Chipset Model: Radeon Pro 560 Type: GPU Bus: PCIe PCIe Lane Width: x8 VRAM (Total): 4 GB Vendor: AMD (0x1002) Device ID: <snip> Revision ID: 0x00c0 ROM Revision: 113-C980AJ-927 VBIOS Version: 113-C9801AU-A02 EFI Driver Version: 01.00.927 Automatic Graphics Switching: Supported gMux Version: 4.0.29 [3.2.8] Metal: Supported, feature set macOS GPUFamily1 v3 Displays: Color LCD: Display Type: Built-In Retina LCD Resolution: 2880 x 1800 Retina Framebuffer Depth: 30-Bit Color (ARGB2101010) Mirror: Off Online: Yes Rotation: Supported Automatically Adjust Brightness: No Thunderbolt Display: Display Type: LCD Resolution: 2560 x 1440 Framebuffer Depth: 30-Bit Color (ARGB2101010) Display Serial Number: <snip> Main Display: Yes Mirror: Off Online: Yes Rotation: Supported Automatically Adjust Brightness: No Connection Type: DisplayPort

More Answers (1)

Martin Knelleken
Martin Knelleken on 16 Nov 2017
George, Steffany
Thanks for your reply/post. For unknown reasons, you're running out of Java memory on certain machines with the most recent Sierra version. We've to figure out why this happens and how to handle this more nicely.
For now you can try to increase the Java Heap Memory in MATLAB. See matlab/matlab_external/java-heap-memory-preferences.html
I expect an increase of 50% would be sufficient.
I hope that helps.
- Martin
  1 Comment
Danielle on 2 Mar 2018
Hi Martin. I am experiencing the same problem. I have tried increasing the Java Heap memory but my file continues to stay broken and not opening. It also does not want to print. Any other suggestions?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!