Closed Kezzya closed 1 month ago
Hello, yes this is still possible. look at documentation here Image Processing. I've just added a small code sample for clarification
But what if I have images local in /Images/ folder, do I need to change some settings?
I just don't see them in my docx file, don't know why, I think I parse HTML right, because visually it shows me my tags, so I dont know what the problem
If your image are in your local folder, you still must use the BaseImageUrl:
string baseUri = Path.Combine(Environment.CurrentDirectory, "images");
var converter = new HtmlConverter(mainPart, new DefaultWebRequest {
BaseImageUrl = new Uri(baseUri) });
await converter.ParseBody("<img src='wikipédia.png'>");
You can also provide a ILogger to the WebRequest to troubleshoot, or copy-paste the code of the DefaultWebRequest, and provide your own version (that way, you will be able to debug step by step). What is the file format extension?
If that still doesn't work, please share your image with me.
What is the file format extension? application/vnd.openxmlformats-officedocument.wordprocessingml.document
Yes it is still doesn't work, hmm. Before your library I used openxml alt chunks and also had problems with images, they were displayed like "x"
btw I write my project not in core version, just asp.net mvc 4.7.2, could it be the problem?
No, I doubt this is the problem as I support .Net 4.6.2. I was asking the file format of your image, not your docx.
png
Ok can you pm me your image to [deleted]?
I can put it here
I put full path of my project in baseUri variable and now it works, thanks for help :)
Hello. When I put <img src="urlWEBSITE"...> my docx file become blank, but, but if I put with img src="myfolder/image.png" parsing without images at all, but with text. I use the latest version of this program. In the oldets as I see in documentation I could adjust image settings, but now it is impossible, isn't it?
ASP.NET MVC