Problem viewing header image
显示 更早的评论
Hello!
I am generating a report using a Word Template. The template works without problems when using it directly from MS Word. When I insert it in my code though, the image header in the generated Word file shows up as a red cross with the text "image can´t be displayed". I have tried to make the header image an inline image, so that it is on the same level as the text, but that didn´t change anything.
Here is part of the code:
import mlreportgen.dom.*;
doc = Document('Protokoll_1', 'docx', 'Template_Protokoll_1');
holeId = moveToNextHole(doc);
fprintf('Current hole ID: %s\n', holeId);
append(doc, Table_Init_1);
holeId = moveToNextHole(doc);
fprintf('Current hole ID: %s\n', holeId);
append(doc,Image('C:\Users\Konstantina\Documents\MATLAB/Bild1.png'));
close(doc);
rptview('Protokoll_1', 'docx');
Thanks in advance for your help!
Konstantina
3 个评论
Alok Nimrani
2019-2-21
There seems to an error with the image path: 'C:\Users\Konstantina\Documents\MATLAB/Bild1.png'. The last separator is a forward slash (/) instead of backslash (\). I would recommend to try again after correcting the path.
Walter Roberson
2019-2-21
forward slash valid in Windows except for some parts of the command shells .
Daniel
2019-2-22
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Template Matching 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!