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

220 visualizaciones (últimos 30 días)
Oskari
Oskari el 16 de Mzo. de 2025
Comentada: Timothy el 17 de Abr. de 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 comentario
Thomas
Thomas el 15 de Abr. de 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?

Iniciar sesión para comentar.

Respuestas (5)

NVSL
NVSL el 26 de Mzo. de 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 comentario
Alex
Alex el 15 de Abr. de 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?

Iniciar sesión para comentar.


Katy
Katy el 17 de Abr. de 2025
I was having the same issue. Updating to R2025a fixed it!

Lazaros
Lazaros el 15 de Abr. de 2025
I am having the same issue

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

Timothy
Timothy el 17 de Abr. de 2025
Editada: Timothy el 17 de Abr. de 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 comentarios
Sydney
Sydney el 17 de Abr. de 2025
I updated my matlab and it fixed it!
Timothy
Timothy el 17 de Abr. de 2025
I'm on 2024a update 7. Long will it take to go to 2025a because I don't have that kind of time

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by