Drawing Object Features Supported on FlatOPC Import
You can insert new images of any type into a document by using the DocumentBuilder.InsertImage method or by setting the image of an existing shape using the Shape.ImageData property. All of the following image types listed in the table below this overview are supported. When a document contains multiple references to the same image from an from an external address (e.g the internet) then the image is only downloaded once. It is useful to know how images are stored in the model when you insert a new image using Aspose.Words There are three classes of image from the Aspose.Words point-of-view.
- Microsoft Word Native (which can be stored directly in model without any changes). These are the JPEG, PNG, and PICT formats and are left untouched during insertion.
- Windows Metafiles (can also be stored directly in the model). These are the EMF and WMF vector formats and are left untouched during insertion.
- Microsoft Word Non-Native. These are not supported and have to be converted (to PNG) before being stored in the model. These are the GIF, TIFF and BMP formats.
Aspose.Words automatically converts the formats found in the third item if such a format is inserted into a document. The reason why the formats found in the third item must be converted to PNG is because Microsoft Word formats don’t support the GIF or TIFF formats. It makes sense to store these in memory in a format that is supported by Microsoft Word. Note that when you insert an image of these types in Microsoft Word it also converts them to PNG in the same way behind the scenes. BMP is the exception and is supported by Microsoft Word. However, since a BMP stored in memory is often very large it too is converted to PNG to save memory.
Note that PNG is a lossless compression format, so there is no degregration of image quality using the above techniques. If you are using Aspose.Words for Java you may need to ensure that you have the appropriate JAI image libraries installed in order for Aspose.Words to convert GIF, TIFF and BMP formats to PNG. If the required functionality is missing you may recieve a “Image type not supported” exception. See the following links in the documentation for further information:
|Alternative text||Yes||- Shape.AltText|
See the following link in the documentation for further information:
|Text Direction||Yes||- TextBox.LayoutFlow|
|Linked Textboxes||Yes||Linked text boxes are supported in Aspose.Words model, however there is currently no API to access or modify these values.|
|Resize To Fit Text||Yes||- TextBox.FitShapeToText|
|Text in Other Shapes||Yes|
OLE Objects represent embedded content in a Microsoft Word document, such as an embedded Excel or Powerpoint document. The OLE object is dynamic and can be edited or updated through Microsoft Word. This feature is fully supported and preserved during document conversion. OLE data can be accessed and modified through properties of the Shape class. You can extract and save OLE data to stream or disk. Currently embedding new or updating existing OLE Objects is not supported in Aspose.Words. See the following links in the documentation for further information:
|Linked||Yes||Note that Aspose.Words cannot update an OLE link. However you can modify a link only OLE object to point to a new location which can provide a partial way of changing OLE objects.
When such a document is saved and opened in Microsoft Word it will detect the change in link and prompt the user to update the linked object. This results in the linked object appearing in the document.
Such a tecnhique will only work for Word formats and if the document is opened in an editor which allows to update OLE objects (such as Microsoft Word). If the link is changed and the document to a different format such as PDF then the original content will still appear in the output.
|Auto Update||Yes||- OleFormat.AutoUpdate|
|Ole Object Data||Yes||
|Ole Object Picture||Yes||- OleFormat.OleIcon|
|Source Range||Yes||- OleFormat.SourceItem|
ActiveX Controls are preserved and supported during import. ActiveX is normally imported as a Shape node. Some ActiveX may also have an assosicated field. You currently cannot create or modify existing ActiveX controls in a document. You can however retrieve certain parts of data from controls (mostly parts assosicated with the graphic of the control).
|Persistent Properties Storage||Yes|
Aspose.Words supports almost all Shape and Image elements. References to external images such as ones on the internet are automatically downloaded as well. All of these elements are imported into Aspose.Words as Shape nodes. Using Aspose.Words you can create any type of new shape including images, AutoShapes etc. you can also access, modify and remove such elements from a document. Most common properties such as borders or position can be modified through the API. There is currently no API for modifying advanced shape properties e.g ArcSize of a RoundRectangle. There is also no API for creating or modifiying advanced features such as Diagrams, Ink Annotations or Charts. These elements are retained fully during conversion. Shapes which are linked to external resources such as images on the internet can be automatically downloaded when required. See the following links in the documentation for further information:
|Stars and Banners||Yes|
|Signature Line||Planned||Signature line content is currently preserved in image form only. You cannot access or validate the digital signature attached to a signature line yet or extract the signature as plain text.
Creating new signature lines is currently unsupported.
These features will be included as soon as possible.
|Diagrams (VML)||Yes||VML graphics format is normally used in pre-OOXML formats such as DOC or RTF.|
|SmartArt (VML)||Yes||Represented as a groupshape with child shapes representing the different elements.
You can add, modify or remove parts of the smart art. You can also extract the plain text content.
|Charts (VML)||Yes||Currently there is no API for accessing or modifying the content of a chart.
You cannot retrieve the text of a chart.
|Hyperlink on Shape||Yes||- Shape.HRef|
|Watermark||Yes||A watermark in a Microsoft Word document is actually a text shape or image centered in the middle of the page but in the header or footer. This allows the watermark to appear behind all content and as faded.||- How to Add a Watermark to a Document|
WordArt is imported as a Shape object in Aspose.Words. This class provides properties to extract and modify properties of a WordArt object. Using Aspose.Words you can create new WordArt graphics. Note that not all WordArt features are avalible through the API. See the following links in the documentation for further information:
|Text Spacing||Yes||- TextBox.Spacing|
|Vertical Text||Yes||- TextBox.TextPathAlignment|
|Even Height||Yes||- TextPath.SameLetterHeight|
|Align and Justify Text||Yes||- Textbox.TextPathAlignment|
Horizontal Line Object
Horizontal Line Objects are represented as a Shape node in Aspose.Words. Since a Shape can also represent an image there is a property which returns if this shape is a Horizontal Line Object. Using Aspose.Words you can create new or modify existing Horizontal Rule objects. See the following link in the documentation for further information:
|Width||Yes||Width appears in the API only as absoloute points and not as percent as what Horizontal Line widths are normally calcuated in.The percent value can be calculated by using the width of the page.||- Shape.Width|
Aspose.Words supports creating objects with a variety of different positioning settings. Almost all possible settings are supported in the Aspose.Words model. You can also access and modify existing shape’s positioning. See the following links in the documentation for further information:
|Floating||Yes||In a Word document floating content is anchored to a paragraph. When a document is loaded into Aspose.Words this anchor is represented by the position of the Shape node in relation to Paragraph and the Runs of text.|
|Wrap Type||Yes||- Shape.WrapType|
|Wrap Sides||Yes||- Shape.WrapSide|
|Distance from Text||Yes||
|Polygon Wrap Points||Planned||This property is currently lost upon import of Word documents.
This feature will be included a future verison.
|Horizontal Alignment||Yes||- Shape.HorizontalAlignment|
|Horizontal Position Relative To||Yes||- Shape.RelativeHorizontalPosition|
|Vertical Alignment||Yes||- Shape.VerticalAlignment|
|Vertical Position Relative To||Yes||- Shape.RelativeVerticalPosition|
|Anchor Lock||Yes||- Shape.AnchorLocked|
|Allow Overlap||Yes||- Shape.AllowOverlap|
|Layout in Table Cell||Yes||There is currently no API to access this shape setting.|
|Width and Height||Yes||
|Scale||Yes||There is currently no way to access scale of Shape loaded in Aspose.Words.
The size of the shape after scale is applied is calculated and stored as the public size of the Shape. This size can be found using the Shape class.
|Lock Aspect Ratio||Yes|
Using Aspose.Words you can access, modify and remove most fill properties of a shape. See the following link in the documentation for further information:
|No Fill||Yes||- Shape.Filled|
|Solid Fill||Yes||- Shape.FillColor|
|Gradient Fill||Yes||There is currently no API for accessing or modifying the graident fill of a shape.|
|Pattern Fill||Yes||The raw bytes of the Pattern fill can be extracted only. A new pattern can not be set.||- Fill.ImageBytes|
|Picture or Texture Fill||Yes||The raw bytes of the Texture fill can be extracted only. A new texture or image can not be set.||- Fill.ImageBytes|
See the following links in the documentation for further information:
|Line Fill||Yes||- Stroke.ImageBytes|
|Line Width||Yes||- Stroke.Weight|
|Compound Type||Yes||- Stroke.LineStyle|
|Dash Type||Yes||- Stroke.DashStyle|
|Cap Type||Yes||- Stroke.Cap|
|Join Type||Yes||- Stroke.JoinStyle|
Most shadow properties are preserved during import. There is currently no API to access shadow data of a graphic object. This will be added in a future version.
Most 3D properties are retained during import. There is currently no API to access or modify these properties on graphic objects. This will be added in a future version.