Hello,
I need to accomplish the following:
-The user chooses a Word files to import in ScaleRichView
- During the import I should change the Font type and the font size (e.g. in the Word it was Times Roman 12, but in the ScaleRichView it should be Arial 10)
- The paragraph alignment should be changed too (e.g. in the Word it was Justify, but in the ScaleRichView it should be Left)
-The regular and bold parts should have a special style. This means for example that a word which was bold will stop being bold in ScaleRichView, but it will be a pre-defined style e.g. MyBoldStyle
- The margins should not change (the margins should have the values of the original ScaleRichView document).
Is there a way to import Word documents in ScaleRichView?
Import Word in a special way
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
First, it's better to use RTF.
DocX files can be imported using TRVOfficeConverter, but some formatting may be lost in this way.
Next, you can load in a hidden TSRichViewEdit first, then modify collections of styles. Then save to a memory stream using SRVHidden.RichViewEdit.SaveRVFToStream, and then load to the final editor using SRV.RichViewEdit.InsertRVFFromStream.
DocX files can be imported using TRVOfficeConverter, but some formatting may be lost in this way.
Next, you can load in a hidden TSRichViewEdit first, then modify collections of styles. Then save to a memory stream using SRVHidden.RichViewEdit.SaveRVFToStream, and then load to the final editor using SRV.RichViewEdit.InsertRVFFromStream.