"Failed to load HTTP resource" when trying to publish a pdf
283 views (last 30 days)
Show older comments
Hi, I'm getting a this error message in the command window when I try to publish my code as a pdf in Matlab. Publishing it as a HTML or doc file doesn't give any errors. My code works fine and does not get any errors when running it.
"Error using mlreportgen.re.internal.xml.transform.Transformer/transform"
"Unable to parse input file: {my file location}"
"Reason: failed to load HTTP resource"
The input file points to a .xml file that has the same name as the .m file I try to publish.
In addition, sometimes the reason changes to "Content error in the external subset".
This error occurs on my Windows 10 desktop and my Windows 11 laptop. I'm using MATLAB Version: 24.1.0.2837808 (R2024a) Update 7 in both.
1 Comment
Thomas
on 15 Apr 2025
Hi,
I have the same issue, but only since a few days.
Approx. 2 weaks ago it worked fine with exact the same scripts and the same Matlab Version 2023b.
So what has changed in the last 2 weeks?
Answers (5)
NVSL
on 26 Mar 2025
I understand you are facing error(s) when trying to publish your MATLAB code to pdf despite the code being error-free.
You can try to go through following MATLAB Answers thread and make sure you are following all the steps correctly.
Alternately, you can publish your MATLAB code into html using the “publish” function by using the following command in MATLAB Command Window.
publish(“file.m”, ‘html’);
This publishes your code to HTML format, and you can open it by double-clicking the published HTML file, which opens it in a browser.
You can print the file as a PDF using the "CTRL+P" keyboard shortcut or the print button located at the top-left corner of the browser.Hope this helps!
1 Comment
Alex
on 15 Apr 2025
Hi, I'm also dealing with this issue but the other thread didn't seem to help. Is there any specific reasons this error would occur?
Sydney
on 16 Apr 2025
I have the same issue as well. Weird because my code is very short and doesn't require any path inputs.
0 Comments
Timothy
on 17 Apr 2025
Edited: Timothy
on 17 Apr 2025
I have a similar error. My error seems to be linked to publishing graphs. Does anyone have any suggestions to get around this and publish as a PDF I really need this for an assignment. I'm on the latest Mac Os and I have 2024a education edition
Error using mlreportgen.re.internal.xml.transform.Transformer/transform
Unable to parse input file: (File Location).
Reason: failed to load external entity
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
2 Comments
Timothy
on 17 Apr 2025
I'm on 2024a update 7. Long will it take to go to 2025a because I don't have that kind of time
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!