Problem viewing header image
Show older comments
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 Comments
Alok Nimrani
on 21 Feb 2019
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
on 21 Feb 2019
forward slash valid in Windows except for some parts of the command shells .
Daniel
on 22 Feb 2019
Answers (0)
Categories
Find more on Template Matching 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!