- When using the Publish button, select "Publish to HTML" instead of PDF. Then, use an external method, such as Print to PDF on Windows, to convert the HTML to PDF.
- For MATLAB scripts - Convert the MATLAB script to a live script by right-clicking the MATLAB script and selecting Open as Live Script. Then, use Export -> Export to PDF in the Live Editor tab. If you have figures that you want to include in your PDF document, run the new live script first and then export it to PDF.
Why do I see an error, "failed to load HTTP resource", when I publish a script as a PDF in MATLAB R2024a and R2023b?
77 views (last 30 days)
Show older comments
MathWorks Support Team
on 5 May 2025
Answered: MathWorks Support Team
on 5 May 2025
Occasionally, when I try to publish a MATLAB script as a PDF in MATLAB R2024a or MATLAB R2023b, I receive the following error:
Error using mlreportgen.re.internal.xml.transform.Transformer/transform
Unable to parse input file: "[filepath]\html\[filename].xml".
Reason: failed to load HTTP resource
.
Error in publish
Error in publish
Are there any solutions or workarounds?
Accepted Answer
MathWorks Support Team
on 5 May 2025
When using MATLAB R2023b and R2024a, you might encounter a sporadic error when publishing a MATLAB script as a PDF document by using either the Publish button or the "publish" function:
"Error using mlreportgen.re.internal.xml.transform.Transformer/transform"
"Unable to parse input file: {my file location}"
"Reason: failed to load HTTP resource"
This issue has been addressed starting in MATLAB R2024b and subsequent releases.
Security Consideration: The R2024a and R2023b versions of MATLAB Publish download a Document Type Definition file over http, which is not encrypted.
To receive the latest security fixes and patches, upgrade to the latest MATLAB version.
For earlier releases, you can use either of these options to work around this issue:
0 Comments
More Answers (0)
See Also
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!