Problem viewing header image
Afficher commentaires plus anciens
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 commentaires
Alok Nimrani
le 21 Fév 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
le 21 Fév 2019
forward slash valid in Windows except for some parts of the command shells .
Daniel
le 22 Fév 2019
Réponses (0)
Catégories
En savoir plus sur Template Matching dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!