Error using Matlab's publish function to create a pdf
显示 更早的评论
On 3 of my students' laptops that have Matlab installed, regardless of whether I use the publish function in the Command Window, or the publish tab at the top, I cannot get Matlab to generate a pdf. It gives me the same error on all 3 laptops:
Error using mlreportgen.re.internal.xml.transform.CompiledStylesheet
All of my other students are not having this issue on their computers. I have tried seeing if this has been asked before or other people have had this error but I am not finding anything on the mathworks website. I have taught this class for years and have never seen this error using the publish function before.
10 个评论
Steven Lord
2025-1-29
That doesn't look like the full and exact text of the error message. Please show us all the text displayed in red in the Command Window (and if there are any warning messages displayed in orange, please show us those too.) The exact text may be useful and/or necessary to determine what's going on and how to avoid the warning and/or error.
Radford
2025-1-29
Samuel
2025-1-31
I'm having the same exact error. It makes a .html without complaining, but for some reason a PDF is the end of the world.
Steven Lord
2025-1-31
Does this happen with any MATLAB file or is it only specific files?
If you created a new file and typed just this command in it, do you receive the same error publishing it?
x = 1+1
If that works, can you locate a file with that .xsl file name on the computer where the publishing process works and one where the publishing process fails?
Linda
2025-1-31
I also have new students that just downloaded the latest version of MATLAB to their devices in the last week with the same issue. It is not all students, but two hit me up after class with the exact same issue. The were both windows devices and one was an HP laptop. The code they run works fine when executed in the Cloud version, but their local configuration is giving them this error. It is unable to parse stylesheet document: file_path\program_name.xsl.
I confirmed in the configuration, nothing is in the path for XSL. And the htm folder is created, but it errors out on the problem above.
Linda
2025-1-31
And it was all of their .m files. There was no xsl file in the MATLAB file folders.
Steven, I am also having this exact issue and tried this. I get the same exact error when attempting to publish the script "x = 1+1". I have a student license and am using the MATLAB applcation on a windows PC. I just have .m files and .dat files in the output folder.
Update: Published the PDFs in MATLAB online just fine.
Radford
2025-2-3
John
2025-2-3
I am having the same issue with my own computer.
Mira
2025-2-9
same here
采纳的回答
更多回答(6 个)
Sivsankar
2025-2-11
1 个投票
I encountered the same issue when attempting to export a MATLAB file as a PDF in Update 4 of MATLAB R2024b. However, when I reverted back to Update 3, the process worked without any errors. Additionally, it also worked when using MATLAB Online. I suggest trying these options to see if they resolve the issue for you
Thanks.
AFWAN
2025-2-3
0 个投票
The error you're experiencing with MATLAB seems to be related to issues with rendering PDFs using the publish function. Probably MATLAB Version Conflict, ensure that the MATLAB version used by your students is compatible with the publish feature.
1 个评论
Linda
2025-2-3
These are brand new installs. Others in the class did the same download and did not get this issue. Where would they get different publish feature versions?
Steven Lord
2025-2-3
0 个投票
I tried searching our internal bug database but I didn't find anything that looked exactly like this issue. I've reached out to the developers responsible for the publishing feature. They recommend that anyone who has encountered this issue contact Technical Support directly using this link and work with them to investigate the issue so they can determine the cause and provide a workaround and/or a fix.
2 个评论
Anton
2025-2-9
This appears to be the second time publishing to PDF was broken in the last year or so. Why does this keep happening?
Christopher Stapels
2025-2-25
We hear your concern, and apologize for the issue. I'm sure it is frustrating to have the function stop working. I was not able to reproduce the issue, so i is possible our testing environment may not be covering all possible hardware setups. Your help reporting the issue will allow us to improve coverage for testing.
Carson
2025-2-3
0 个投票
I ran into the same error. I was able to export as html > click the print button > save as pdf.
Swapnil
2025-2-3
0 个投票
Hey, I'm experiencing the same issue. I found a fix. Under the publish button there is a dropdown, click that. That should pop open a menu, click "Edit Publishing Options...". Next I changed my output from "html" to "doc". That saved my work to word doc, from word doc I was able to save it to a pdf.
To sum this up I changed my publish output from html to doc, then saved it as a pdf from Microsoft Word.
Hope this helps!
Taehon
2025-4-15
0 个投票
I solve this problem by updating my R2024b_update4 to 5.
类别
在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!