WebArchiveX COM API


Samples | Changelog | Overview

WebArchiveX COM is a full-featured tool that lets you create web archive MHT files. Please see the introduction page for an extensive overview. 

Please note that the following samples might not work as is. In order to build web archive MHT correctly and efficiently we suggest to learn this API and write code that fits your specific needs. WebArchiveX is powerful and versatile - use it wisely and you will get superb results. 

Not sure you can use it? Not sure how to use it? Have any other questions? Please don't hesitate to contact our Tech. Support. All you questions will be answered within 24 hours.

Performance Note: In order to improve performance we recommend to use MaxThreadCount property. InspectMarkups, InspectScripts and LowerUrls methods also . If you use WebArchiveX in ASP, we recommend MakeArchiveStream. With this method you can write the result web archive MHT directly into ASP Response object.

Security Note: Please note that the process that launches WebArchiveX must have all needed file-system privileges in order to be able to create temporary directories, log files, output web archive MHT files etc.. It might be useful to run WebArchiveX as a raw-configured COM+ class if you need to impersonate an appropriate Windows account (that has all required permissions). Raw-configured COM+ class is a regular COM registered in COM+ but using no COM+ services (e.g. Just-in-time Activation, Transactions or Synchronization). For more information please refer to "Transactional COM+: Build Scalable Applications".


Have any question? Please don't hesitate to contact our Tech. Support.
Kindly email your comments and suggestions to webmaster at csystems.co.il


Methods

NameDescription
LicenseCode Set the license code received from C Systems
InitializeRestores the initial state of WebArchiveX module
MakeArchiveBuild MHT web archive (single MHT file)
MakeArchiveStrBuild MHT web archive and returns it as a string
MakeArchiveStreamBuild MHT web archive and writes it into an output stream
MakeArchiveFromDocBuild MHT web archive from an HTML document object
MakeArchiveZipBuilds MHT web archive compressed in ZIP (use .zip extension)
MakeArchiveGzBuilds MHT web archive compressed in GZ (use .mht.gz extension)
SetCharsetChange default encoding charset
AddMimeTypeAdd new / replace existing MIME type
RemoveMimeTypeRemove existing MIME type
ClearMimeTypesRemove all registered MIME types
AddResourceTagAdd new / replace existing resource tag
RemoveResourceTagRemove existing resource tag
ClearResourceTagsRemove all registered resource tags
AddScriptTypeAdd new / replace existing script type
ClearScriptTypesRemove all registered script types
AddServerScriptTypeAdd new / replace existing server script type
ClearServerScriptTypesRemove all registered server script types
AddMarkupTypeAdd new / replace existing markup type
ClearMarkupTypesRemove all registered markup types
AddFileManually add files to the output web archive 
AddPreParsingFilterAdd regular expression filter to apply before parsing
ClearPreParsingFiltersRemove all pre-parsing filters 
AddPostParsingFilterAdd regular expression filter to apply after parsing
ClearPostParsingFiltersRemove all post-parsing filters
GetSystemTempDir Retrieves the path of the directory designated for temporary files
ZipFile Compress a single file into a ZIP archive
SetCredentials Set user credentials for accessing protected web sites
SetProxyCredentials Set user credentials for archiving through a protected proxy
ArchiveAndEncrypt* Build and encrypt web archive
ArchiveAndSend* Build and email web archive
ArchiveZipAndSend* Build and email compressed web archive
ArchiveEncryptAndSend* Build, encrypt and email web archive
DecryptToFile* Decrypt web archive into file
DecryptToString* Decrypt web archive into a stream object

* - These methods require properly registered CapiCom.dll and WebArchiveXUtils.dll 
(included in "Utils" directory of WebArchiveX distribution)

Properties

NameDescription
LogFileSet log file path
LogLevelSets minimal log level
SpiderLevelSets maximal spider level.
LinkMendingSets whether links should be updated
LinkMessageMessage for out-of-scope links
LowerUrlsSet to True for case-insensitive web servers
TempDirCustom temporary directory, empty by default
CallbackWindowHandle of window that will receive progress messages
CallbackMessageIDProgress message ID. Default is WM_USER + 1 
BaseDirPath to an alternative base directory
InfoWindowWindow handler to receive progress report messages
InfoMessageIDProgress message ID. Default is WM_USER + 1
InspectMarkupsIf True WebArchiveX scans all markup files scrupulously
InspectScriptsIf True WebArchiveX scans all script files scrupulously
RootDomainOnlyIf True WebArchiveX spiders the root domain only 
DirIsMarkupIf True WebArchiveX considers directory URLs as markups
VersionRead-only, returns WebArchiveX version string
DelTempFilesIf True, WebArchiveX will remove temporary files after archiving
ProxyUrlWrite-only, sets URL of Internet proxy server 
ProxyPortWrite-only, sets port of Internet proxy server
HttpTimeoutHTTP timeout value (milliseconds)
MaxThreadCountSize of the internal thread pool
AddBaseTagIf True WebArchiveX will add/overwrite <BASE> tag

Samples

.NET C# Example

Show Code

Java Script Example

Show Code

ASP Example: VB Script (without error handling)

Show Code

ASP Example: Java Script (without error handling)

Show Code

VB Example

Show Code

C++ Example

Show Code


- WebArchiveX Website - C Systems Website


C Systems - Creative software solutions since 1996. All rights reserved. Terms of use.