Method SaveWebPage
- Namespace
- DotNetBrowser.Browser
- Assembly
- DotNetBrowser.dll
SaveWebPage(string, string, SavePageType)
Initiates the saving process of the currently loaded web page. The web page can be saved as a single HTML file or the file with resources. Before saving a web page make sure that it is not being loaded. It is recommended to completely loaded the web page and only then save it.
bool SaveWebPage(string filePath, string resourcesPath, SavePageType saveType)
Parameters
filePathstringan absolute path to a file in which the web page will be saved.
resourcesPathstringan absolute path to a directory in which the resources (e.g. images, css) of the web page will be saved. If the directory does not exist, it will be created
saveTypeSavePageTypedetermines how the web page will be saved: as an HTML file with all the required resources (e.g. images, css etc.), a single HTML or MHTML file
Returns
- bool
trueif the saving process has been initialized successfully,falseotherwise.
Exceptions
- ObjectDisposedException
The IBrowser has already been disposed.
- ConnectionClosedException
The connection to the Chromium engine is closed.
- ArgumentException
The
filePathis null, empty, or consists only of white-space characters.- ArgumentException
The
resourcesPathis null, empty, or consists only of white-space characters.