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

300 vues (au cours des 30 derniers jours)
Oskari
Oskari le 16 Mar 2025
Commenté : Timothy le 17 Avr 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 commentaire
Thomas
Thomas le 15 Avr 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?

Connectez-vous pour commenter.

Réponses (5)

NVSL
NVSL le 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 commentaire
Alex
Alex le 15 Avr 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?

Connectez-vous pour commenter.


Katy
Katy le 17 Avr 2025
I was having the same issue. Updating to R2025a fixed it!
  1 commentaire
Sydney
Sydney le 17 Avr 2025
I also updated my matlab and it fixed it!

Connectez-vous pour commenter.


Lazaros
Lazaros le 15 Avr 2025
I am having the same issue

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

Timothy
Timothy le 17 Avr 2025
Modifié(e) : Timothy le 17 Avr 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 commentaires
Sydney
Sydney le 17 Avr 2025
I updated my matlab and it fixed it!
Timothy
Timothy le 17 Avr 2025
I'm on 2024a update 7. Long will it take to go to 2025a because I don't have that kind of time

Connectez-vous pour commenter.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by