"Failed to load HTTP resource" when trying to publish a pdf

216 Ansichten (letzte 30 Tage)
Oskari
Oskari am 16 Mär. 2025
Kommentiert: Timothy am 17 Apr. 2025
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 Kommentar
Thomas
Thomas am 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?

Melden Sie sich an, um zu kommentieren.

Antworten (5)

NVSL
NVSL am 26 Mär. 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 Kommentar
Alex
Alex am 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?

Melden Sie sich an, um zu kommentieren.


Katy
Katy am 17 Apr. 2025
I was having the same issue. Updating to R2025a fixed it!

Lazaros
Lazaros am 15 Apr. 2025
I am having the same issue

Sydney
Sydney am 16 Apr. 2025
I have the same issue as well. Weird because my code is very short and doesn't require any path inputs.

Timothy
Timothy am 17 Apr. 2025
Bearbeitet: Timothy am 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 Kommentare
Sydney
Sydney am 17 Apr. 2025
I updated my matlab and it fixed it!
Timothy
Timothy am 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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by