[ERROR] FOUserAgent - Image not found. Encountered using publish r2018a

46 ビュー (過去 30 日間)
David Clemens-Sewall
David Clemens-Sewall 2018 年 4 月 26 日
I recently changed from r2016b to r2018a and now the publish function is not displaying plots. When I attempt to publish the following code to pdf I receive the subsequent error and the pdf publishes without the plot.
Code:
% test_publish.m
figure;
plot(1:10);
<<untitled.tif>>
Error
[ERROR] FOUserAgent - Image not found. URI: C:/Users/David Clemens-Sewall/AppData/Local/Temp/test_publish_01.bmp. (See position -1:-1)
[ERROR] FOUserAgent - Image not found. URI: C:/Users/David Clemens-Sewall/AppData/Local/Temp/test_publish_01.bmp. (No context info available)
I'm operating on Windows 10 and unfortunately I had already deleted r2016b so I cannot simply return to using that. By saving the plot and then loading it explicitly I can add it to the pdf. So it seems that publish is capable of loading and displaying the image it's just that matlab is trying to write the plots to a location it cannot access (the directory does exist, but when I go there I do not find the plots). I've looked at changing my temporary directory but unfortunately clear all followed by setenv doesn't seem to change that either (it keeps stubbornly returning to 'C:/Users/David Clemens-Sewall/AppData/Local/Temp/'). So I'm not sure where to go next. Thank you!
  8 件のコメント
Image Analyst
Image Analyst 2018 年 6 月 6 日
Did you change your original question and code? This code
% test_publish.m
figure;
plot(1:10);
<<untitled.tif>>
that you posted would not cause any problem. It will run (I tried it), though if you call it publish.m, it will override the build-in publish() function, which is never a good idea.
VIVEK RUHELA
VIVEK RUHELA 2019 年 2 月 27 日
I am facing the same problem in Matlab-2018b. With code given in question, I am not getting any image in pdf file. Rest plot is working fine but while publishing, I am getting the same error as reported in the question. Any other suggestions....
Thanks

サインインしてコメントする。

回答 (7 件)

Ben Drebing
Ben Drebing 2018 年 6 月 5 日
It looks like this error happens if there is a space in a folder name in the path to your current working folder. So, if you move your code somewhere else so that none of the folders in the path have a space in their name, you should be able to publish.
  5 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 5 日
Brad Stiritz, I do not think you are encountering the same problem.
ava yektaeian
ava yektaeian 2021 年 11 月 29 日
Thanks, really helpful

サインインしてコメントする。


Marc Youcef
Marc Youcef 2020 年 5 月 5 日
I am still having this issue on R2020a which is a long way from when that problem was first spot...

Cesar Martinez Delgado
Cesar Martinez Delgado 2018 年 8 月 21 日
編集済み: Cesar Martinez Delgado 2018 年 8 月 21 日
I have the same problem when I try to publish pdfs or docs. I have tried to change the entire folder to a new one that does not have space in the name. Also, I tried adding to the path the folder that is show in the error. And kind of made the entire track of the function publish to catch the mistake because it. But, it always drops the same error heading to the same path, using the OP sample: C:/Users/ David Clemens-Sewall/AppData/Local/Temp/ Any further assistance on this? Changing the user name would in theroy help, but i do not know if it is gonna mess other applications, which I would avoid to happen. thank you

Ryan Whitney
Ryan Whitney 2019 年 9 月 24 日
I continue to run into this issue. Sometimes it happens and if I change something in the code (minor, unrelated) or restart Matlab and it will output.
Other times, like RIGHT NOW (very frustrated) there appears to be nothing I can do to export this to PDF. I've had this issue on multiple versions :(.
I'd like to see MathWorks work on fixing this as they are clearly putting work into Livescripts and having the ability to run an analysis and export to PDF is super useful (still some formatting controls to work out, but I'm patient on that).
I'm running 2019b, on MacOS 10.14.6.
  1 件のコメント
Ryan Whitney
Ryan Whitney 2019 年 9 月 24 日
I've looked in the folder on my laptop where the images are supposed to be and it does not exist. So that explains the error - but I see all the plots in the viewer, but they are not where Matlab wants to look on the file system.

サインインしてコメントする。


Robert Herring
Robert Herring 2020 年 2 月 1 日
The easiest way to solve this is by changing your user environment variables so that the TMP and TEMP variable have a filepath with no spaces in them. I made a folder on my C drive called 'Temp', then set the environment variables TEMP and TMP for my user to 'C:\Temp'. The following Micrsoft tutorial will help.

Antonio Javier Barragán Piña
Antonio Javier Barragán Piña 2020 年 5 月 16 日
Adding as first line of code this works for me (it is a comple clean of MATLAB environment):
clc, clear all, close all
  4 件のコメント
Jeroen Vermond
Jeroen Vermond 2020 年 10 月 18 日
For me as well, thanks!
Bernardino Leonado Jaramillo Miranda
Bernardino Leonado Jaramillo Miranda 2021 年 12 月 7 日
sirve, gracias

サインインしてコメントする。


Sanqiang Zhong
Sanqiang Zhong 2021 年 3 月 23 日
I run into the same problem. I solve it by saving the .xml file first before converting it to PDF.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by