HtmlLoadOptions Constructor (LoadFormat, String, String) |
Namespace: Aspose.Words
// If we want to load an .html document which contains an image linked by a relative URI // while the image is in a different location, we will need to resolve the relative URI into an absolute one // by creating an HtmlLoadOptions and providing a base URI HtmlLoadOptions loadOptions = new HtmlLoadOptions(LoadFormat.Html, "", ImageDir); Document doc = new Document(MyDir + "Missing image.html", loadOptions); // While the image was broken in the input .html, it was successfully found in our base URI Shape imageShape = (Shape)doc.GetChildNodes(NodeType.Shape, true)[0]; Assert.True(imageShape.IsImage); // The image will be displayed correctly by the output document doc.Save(ArtifactsDir + "HtmlLoadOptions.BaseUri.docx");