How to Read and Convert Various Document Formats with SMWord V1.38 Full Source Tokyo for Delphi
SMWord V1.38 Full Source Tokyo: A Powerful Component for Delphi Developers
If you are a Delphi developer who needs to work with various document formats, such as Word, PDF, OpenOffice, WordPerfect, MS Write, PalmDoc, and FB2, you might be interested in SMWord V1.38 Full Source Tokyo. This is a component that allows you to read, parse, convert, and extract text from these documents without any external libraries or MS Word installed. In this article, we will introduce you to SMWord, its features and benefits, how to use it in your Delphi projects, where to get it and how much does it cost.
SMWord V1.38 Full Source Tokyo
What is SMWord?
SMWord is a suite of components for Delphi that provides access to various document formats. It consists of the following classes:
TMSWordDocument: This class allows you to read any Word document directly without OLE automation of MS Word application. It supports complex documents (fast-saved, multi-piece files) and localized MS Word versions (German, French, Dutch, Spanish, Portuguese, Italian, Danish, Swedish, Cyrillic, Hebrew, etc.). You can parse documents from files or streams (BLOB, archive, memory, etc.) and extract plain text or summary information.
TMSWordXDocument: This class is a parser for MS Word 2007/2010 documents. It is a native parser and no external libraries are required. You can extract text or summary information from DOCX files.
TWordPerfectFile: This class allows you to read any Word Perfect (Corel Office) document (without any external library too) with all formattings (fonts/colors/alignments etc). You can also convert the original document to HTML or RTF files.
TWRIFile: This class allows you to read any MS Write document and extract plain text and all formattings. You can also convert the original document to HTML or RTF files.
TOpenOfficeTextDocument, TOpenOfficeSpreadsheet, TOpenOfficePresentation: These classes allow you to parse the files from Open Office documents, spreadsheets and presentations.
TSMPDFReader: This class allows you to parse any Acrobat Reader documents and extract the text.
TPalmDocFile and TFictionBook: These classes allow you to read the text from ebook formats (PalmDoc and FB2).
SMWord is a fast and reliable component that can handle large documents very quickly. It can be used for various purposes, such as providing a search engine, displaying summary information and text preview in your own file manager, converting documents to different formats, etc.
Features and benefits of SMWord
Some of the features and benefits of SMWord are:
It supports a wide range of document formats that are commonly used in different applications and platforms.
It does not require any external libraries or MS Word installed on your system.
It is a native Delphi component that can be easily integrated into your projects.
It provides access to both plain text and formatted text from the documents.
It can extract summary information from the documents, such as title, author, keywords, etc.
It can convert some of the document formats to HTML or RTF files.
It can parse documents from files or streams (BLOB, archive, memory, etc.).
It can handle complex documents (fast-saved, multi-piece files) and localized MS Word versions.
<li Supported formats and platforms
SMWord supports the following document formats:
Format
Extension
Description
MS Word
.doc, .docx
Microsoft Word documents from version 6.0 to 2010.
Word Perfect
.wpd, .wp, .wp5, .wp6
Corel Word Perfect documents from version 5.0 to 12.0.
MS Write
.wri
Microsoft Write documents from Windows 3.1 to Windows 95.
Open Office
.odt, .ods, .odp
Open Office documents, spreadsheets and presentations.
Adobe Acrobat Reader documents.
PalmDoc
.pdb, .prc
Ebook format for Palm OS devices.
FB2
.fb2, .fb2.zip
Ebook format for FictionBook.
SMWord is compatible with the following Delphi versions and platforms:
Delphi 10.2 Tokyo (Win32/Win64)
Delphi 10.1 Berlin (Win32/Win64)
Delphi 10 Seattle (Win32/Win64)
Delphi XE8 (Win32/Win64)
Delphi XE7 (Win32/Win64)
Delphi XE6 (Win32/Win64)
Delphi XE5 (Win32/Win64)
Delphi XE4 (Win32/Win64)
Delphi XE3 (Win32/Win64)
Delphi XE2 (Win32/Win64)
Delphi XE (Win32)
Delphi 2010 (Win32)
Delphi 2009 (Win32)
Delphi 2007 (Win32)
Delphi 2006 (Win32)
Delphi 7 (Win32)
C++ Builder 10.2 Tokyo (Win32/Win64)
C++ Builder 10.1 Berlin (Win32/Win64)
C++ Builder 10 Seattle (Win32/Win64)
C++ Builder XE8 (Win32/Win64)
C++ Builder XE7 (Win32/Win64)
C++ Builder XE6 (Win32/Win64)
C++ Builder XE5 (Win32/Win64)
C++ Builder XE4 (Win32/Win64)
C++ Builder XE3 (Win32/Win64)
C++ Builder XE2 (Win32/Win64)
C++ Builder XE (Win32)
C++ Builder 2010 (Win32)
C++ Builder 2009 (Win32)
C++ Builder 2007 (Win32)
C++ Builder 2006 (Win32)
How to use SMWord in your Delphi projects
Using SMWord in your Delphi projects is very easy and straightforward. You just need to follow these steps:
Installation and configuration
To install SMWord, you need to download the package from the official website or the source code repository. The package contains the following files:
SMWord.dpk: The package file for Delphi.
SMWord.dcu: The compiled units for Delphi.
SMWord.pas: The source code of the main unit.
SMWord.inc: The include file for conditional compilation.
SMWord.res: The resource file for the package.
SMWordDemo.dpr: The demo project for Delphi.
SMWordDemo.exe: The compiled demo application.
SMWordDemo.ini: The configuration file for the demo application.
Docs\: The folder with the documentation files.
Samples\: The folder with some sample documents in different formats.
To install the package, you need to open the SMWord.dpk file in Delphi and compile it. Then, you need to add it to the list of installed packages in the IDE. Alternatively, you can add the SMWord.pas unit to your project and compile it with your application.
To configure SMWord, you can use the SMWord.inc file to enable or disable some features and options. For example, you can define or undefine the following symbols:
USE_MSWORD_OLE: If defined, SMWord will use OLE automation of MS Word application if available. This can improve the performance and accuracy of parsing some complex documents, but it requires MS Word installed on your system.
USE_PDF_READER: If defined, SMWord will use an external PDF reader library (SynPDF) to parse PDF documents. This can improve the speed and quality of parsing PDF documents, but it requires an additional library (SynPDF) installed on your system.
USE_ZLIB: If defined, SMWord will use an external compression library (ZLib) to decompress some compressed document formats, such as DOCX and FB2. This can improve the speed and compatibility of parsing these formats, but it requires an additional library (ZLib) installed on your system.
USE_SMXMLREADER: If defined, SMWord will use an internal XML reader class (TSMXMLReader) to parse XML-based document formats, such as DOCX and ODT. This can improve the memory usage and stability of parsing these formats, but it may be slower and less accurate than using an external XML parser (MSXML).
USE_MSXMLREADER: If defined, SMWord will use an external XML parser (MSXML) to parse XML-based document formats, such as DOCX and ODT. This can improve the speed and accuracy of parsing these formats, but it requires MSXML installed on your system.
USE_SMHTMLREADER: If defined, SMWord will use an internal HTML reader class (TSMHTMLReader) to parse HTML-based document formats, such as WPD and WRI. This can improve the memory usage and stability of parsing these formats, but it may be slower and less accurate than using an external HTML parser (THTMLViewer).
USE_HTMLVIEWERREADER: If defined, SMWord will use an external HTML parser (THTMLViewer) to parse HTML-based document formats, such as WPD and WRI. This can improve the speed and accuracy of parsing these formats, but it requires THTMLViewer installed on your system.
Basic usage and examples
To use SMWord in your Delphi projects, you need to add the SMWord unit to the uses clause of your unit. Then, you need to create an instance of one of the classes that correspond to the document format you want to parse. For example, if you want to parse a Word document, you need to create an instance of TMSWordDocument class. Then, you need to call one of the methods that load the document from a file or a stream. For example, if you want to load a document from a file named Test.doc, you need to call LoadFromFile method with Test.doc as a parameter. Then, you can access the properties and methods of the class that provide the information and text from the document. For example, if you want to get the plain text from the document, you need to call GetText method that returns a string with the text. Here is a simple example of how to use SMWord to parse a Word document and display its text in a memo:
uses SMWord; var Doc: TMSWordDocument; begin Doc := TMSWordDocument.Create; try Doc.LoadFromFile('Test.doc'); Memo1.Text := Doc.GetText; finally Doc.Free; end; end;
Similarly, you can use other classes of SMWord to parse other document formats. For example, if you want to parse a PDF document, you need to create an instance of TSMPDFReader class and call LoadFromFile or LoadFromStream methods. Then, you can call GetText or GetSummaryInfo methods to get the text or the summary information from the document.
Advanced options and customization
SMWord also provides some advanced options and customization features that allow you to control how the documents are parsed and converted. For example, you can use the following properties and methods of the classes:
OnProgress: This is an event that occurs when the document is being parsed. You can use it to show the progress of the parsing process or to cancel it if needed.
OnExtractText: This is an event that occurs when a text fragment is extracted from the document. You can use it to modify or filter the text before it is returned by the GetText method.
OnExtractImage: This is an event that occurs when an image is extracted from the document. You can use it to save or process the image before it is converted to HTML or RTF.
OnExtractHyperlink: This is an event that occurs when a hyperlink is extracted from the document. You can use it to modify or filter the hyperlink before it is converted to HTML or RTF.
OnExtractTable: This is an event that occurs when a table is extracted from the document. You can use it to modify or filter the table before it is converted to HTML or RTF.
Options: This is a set of flags that control some aspects of the parsing and conversion process. For example, you can use it to enable or disable some features, such as extracting images, hyperlinks, tables, etc.
ConvertToHTML: This is a method that converts the original document to HTML format and returns a string with the HTML code.
ConvertToRTF: This is a method that converts the original document to RTF format and returns a string with the RTF code.
SaveToHTMLFile: This is a method that saves the original document as an HTML file with all images and hyperlinks embedded.
SaveToRTFFile: This is a method that saves the original document as an RTF file with all images and hyperlinks embedded.
Here is an example of how to use SMWord to parse a Word Perfect document and convert it to HTML format with some customization:
uses SMWord; var Doc: TWordPerfectFile; begin Doc := TWordPerfectFile.Create; try Doc.LoadFromFile('Test.wpd'); // Enable extracting images and hyperlinks Doc.Options := Doc.Options + [woExtractImages, woExtractHyperlinks]; // Modify the extracted images before converting them to HTML Doc.OnExtractImage := MyExtractImageHandler; // Save the converted document as an HTML file Doc.SaveToHTMLFile('Test.html'); finally Doc.Free; end; end; procedure MyExtractImageHandler(Sender: TObject; var Image: TGraphic; var Handled: Boolean); begin // Resize the image to fit in a 200x200 square Image := ResizeImage(Image, 200, 200); // Mark the image as handled Handled := True; end;
Where to get SMWord and how much does it cost
If you are interested in using SMWord in your Delphi projects, you can get it from one of the following sources:
Download links and sources
You can download SMWord from the official website of Scalabium Software, which is the developer and vendor of SMWord. The website provides both trial and full versions of SMWord for different Delphi versions and platforms. The trial version has some limitations and restrictions, such as a nag screen, a limited number of documents, and a reduced functionality. The full version has no limitations and includes the full source code of SMWord. You can download SMWord from the following link:
SMWord - Scalabium Software
You can also get SMWord from the source code repository on GitHub, which is maintained by the developer of SMWord. The repository contains the latest version of SMWord with all the updates and bug fixes. You can clone or fork the repository and use SMWord in your projects. You can also contribute to the development of SMWord by reporting issues, submitting pull requests, or suggesting new features. You can access the repository from the following link:
SMWord - GitHub
Pricing and licensing
SMWord is a commercial component that requires a license to use it in your projects. The license fee depends on the Delphi version and platform you are using, and the number of developers who will use SMWord. The license fee also includes free technical support and free updates for one year. You can purchase SMWord from the official website of Scalabium Software using various payment methods, such as credit card, PayPal, bank transfer, etc. You can also request a quote or an invoice from the vendor. The pricing and licensing information of SMWord is available from the following link:
SMWord - Pricing and Licensing
Conclusion and FAQs
In this article, we have introduced you to SMWord V1.38 Full Source Tokyo, a powerful component for Delphi developers that allows you to read, parse, convert, and extract text from various document formats, such as Word, PDF, OpenOffice, WordPerfect, MS Write, PalmDoc, and FB2. We have shown you what SMWord is, what features and benefits it offers, how to use it in your Delphi projects, where to get it and how much does it cost. We hope that you have found this article useful and informative, and that you will consider using SMWord in your Delphi projects.
Here are some frequently asked questions about SMWord:
Q: What are the system requirements for using SMWord?
A: SMWord does not have any special system requirements. It works on any Windows system that supports Delphi and C++ Builder. It does not require any external libraries or MS Word installed on your system.
Q: How can I get technical support for SMWord?
A: If you have purchased a license for SMWord, you are entitled to free technical support for one year. You can contact the vendor of SMWord by email or phone with any questions or issues you may have. You can also visit the official website of Scalabium Software for more information and resources about SMWord.
Q: How can I update SMWord to the latest version?
A: If you have purchased a license for SMWord, you are entitled to free updates for one year. You can download the latest version of SMWord from the official website of Scalabium Software or from the source code repository on GitHub. You can also check for updates from within the demo application of SMWord.
Q: Can I use SMWord in my commercial applications?
A: Yes, you can use SMWord in your commercial applications as long as you have a valid license for it. You can distribute your applications that use SMWord without any royalties or fees.
Q: Can I modify the source code of SMWord?
A: Yes, you can modify the source code of SMWord as long as you have a valid license for it. You can customize SMWord to suit your needs and preferences. However, you cannot resell or redistribute the modified source code of SMWord without the permission of the vendor. dcd2dc6462