Sign In  Sign Up Live-Chat
Spacer

Aspose.Words Product Family

  • Develop your own SharePoint converter!

    We are happy to present Aspose.Words for SharePoint v.1.1.0!

    To support customers developing own SharePoint applications and wanting to use fast and reliable document conversion engine this release introduces public API to our engine which can be programmatically accessed from any SharePoint application to perform document conversion. This API covers all supported file formats and conversion options for both single and multiple document conversions.
    Detailed interface specifications accompanied with dozens of C# and VB samples can be found in our API Reference.

    To download Aspose.Words for SharePoint 1.1.0, please visit http://www.aspose.com/community/files/73/sharepoint-components/aspose.words-for-sharepoint/default.aspx.

    As usual you can count on our forum to get the questions answered fast.

    Enjoy!


  • Aspose.Words for .NET 8.1 Field Engine Improvements

    Field update was first introduced in Aspose.Words for .NET 7.0 a few months ago (in fact, it was the last decade – just think about it!). You can read about it in this post: http://www.aspose.com/community/blogs/aspose.words-product-family/archive/2009/09/13/field-update-in-aspose-words-the-killer-feature-of-2009.aspx. Since then, the module we call field engine (or field evaluation engine) was significantly improved. In this post I will tell you what enhancements were made in Aspose.Words for .NET 8.1 we have just released and show what Aspose.Words is now able to do.

    • Preserve Formatting in IF Fields
    • Bookmark References
    • Cell References
    • Fixes

     

    Preserve Formatting in IF Fields

    IF fields were number one our customers wanted to be updated by the component. That’s why we implemented them from the very beginning, starting with the release where field evaluation engine was first introduced. However, there used to be a limitation: rich contents for TrueText or FalseText were not preserved. It means that if you used something like “True” or “False”, you saw just a plain text “True” or “False” after field update. Moreover, if you inserted a table or a shape into an IF field as an argument, it got lost completely.

    We are happy to announce that Aspose.Words for .NET 8.1 does support this feature. You can set anything as TrueText or FalseText value and it will be preserved when evaluating field result. Imagine you have a complex IF field whose TrueText is a table and FalseText is a shape:

    Now let’s update fields via Aspose.Words:

    Document doc = new Document("TestPreserveTables.docx");
    doc.UpdateFields();
    doc.Save(
    "TestPreserveTables Out.docx");

    (which is a standard code to update fields in the whole document). Open the resulting document, press Alt-F9 to switch to field result mode and you will notice that field result is the table, because it is TrueText for the IF field and the expression is 2 > 1, which is true:

    Now let’s change the expression to false:

    Run the field update code and open the resulting document. You will notice that field result is the shape, because it is FalseText for the IF field and the expression was changed to 2 < 1, which is false:

    Even more, TrueText or FalseText may include paragraph or section breaks, and they will be preserved as well! Let’s make sure:

    After updating fields, we see the following (note Word shows section breaks within field result as page breaks for some reason):

     

    Bookmark References

    Microsoft Word allows to reference bookmarked contents from expressions. That means that you can bookmark two numbers, say 2 and 3, as A and B, respectively, and then reference them from a formula field looking like =A+B:

    After the field is updated, its value should be 5. Let’s check if Aspose.Words knows arithmetic. Run the field update code shown above and open the resulting document. Voila:

    Too easy, isn’t it? A good pupil should handle more difficult tasks. What about A being a four cells table with a number in each cell and B being an expression that includes a formula field?

    Let’s calculate the correct result. For the bookmark A, Word sums up the values in the table, so A = 1 + 2 + 5 + 6 = 14. The average between 2 and 6 is 4, so B = 3 + 4 – 4 = 3. Hence A + B = 14 + 3 = 17.

    Run field update code and make sure the result is correct:

    Good boy! :)

     

    Cell References

    Another great feature offered by Microsoft Word (and now supported by Aspose.Words) is cell references. When an expression is inside a table, you can reference its cells by using special identifiers, which resembles the way Microsoft Excel works. For example, you can reference a single cell by using an identifier like A1, B4, F8 etc, where the letter means a column and the number means a row, thus A1 referencing the upper left cell in the table:

    Updating fields in this document by means of Aspose.Words gives the expected result:

    Apart from that, you can designate a whole cell range in your expression. Cell range may serve as an argument of a function that accepts a list of values, i.e. SUM, AVERAGE, MIN, MAX etc. In this case the function subsequently takes the value of each cell in the range.

    You can specify an explicit rectangular range like A1:B2, which means the function should work with four cells A1, A2, B1 and B2. You also can omit a letter or a number, instructing the function to take all cells between two columns or two rows, inclusively. For example, A:D means all cells between the columns A and D, including the columns themselves, and 3:3 means all cells in the row 3.

    Finally, you can use a special word like ABOVE, BELOW, LEFT or RIGHT to tell the function it should take all cells above, below, to the left or to the right of the cell the expression resides in.

    I tried to create a table that demonstrates some of these features:

    Running field update via Aspose.Words produces correct results everywhere:

    Another trick is that you can reference table cells even from outside the table. To achieve that, you should bookmark the table and precede a cell range serving as a function argument with the name of the bookmark. Let’s bookmark the table from the last example, name the bookmark Table and try to calculate the biggest value in the table using the MAX function placed outside:

    Aspose.Words correctly handles what’s going on:

     

    Fixes

    No need to say that Aspose.Words for .NET 8.1 includes a bunch of fixes for the field engine. For example, there used to be a problem with double quotes messed up when IF fields contained merge fields enclosed in double quotes. Also, hyperlinks could lose formatting after update… These and other bugs are now fixed, and as ever, feel free to post an inquiry in our support forums if you encounter any problem.

  • Aspose.Words is now available for SharePoint too!

    We are delighted to announce the availability of Aspose.Words for SharePoint, which is our latest addition to the Aspose.Words product family.

    This release, Aspose.Words for SharePoint 1.0 makes high quality document conversions for DOC/DOCX/ODT/RTF/PDF/XPS and others easily accessible to SharePoint users.

    Aspose.Words for SharePoint is built on top of the world-class Aspose.Words for .NET document processing technology and makes it available as an easy to deploy and use functionality in Windows SharePoint Services or Microsoft Office SharePoint Server environments.

    A Bit of History

    In 2007, we wrote an article about how one can use Aspose.Words for .NET and Aspose.Pdf for .NET and write a bit of code to create a DOC/DOCX to PDF converter for SharePoint themselves. This article was published at CodeProject (no longer available) and also in the Aspose.Words documentation.

    The article generated a lot of interest and support requests. Some requests were related to deficiencies of the DOC2PDF conversion and others were related to difficulties of creating and configuring a document converter for SharePoint. The article called for creating a converter according to the SharePoint Document Converters guidelines. While we always provided full and free technical support for Aspose.Words, we were reluctant to deal with  issues related to configuring a document converter in SharePoint.

    End of 2008, we have resolved most of the DOC2PDF conversion issues by releasing Aspose.Words for .NET that was capable of converting documents to PDF directly (e.g. without going through Aspose.Pdf). This is known as the "rendering engine" and allows us to convert Word documents to PDF, XPS, image formats and print with high fidelity (almost like Microsoft Word does it).

    Today, end of 2009, we are happy to announce that we have finally resolved the other part of the issues related to the creation and deployment of the SharePoint document converter. We have created a product specifically for SharePoint. Aspose.Words for SharePoint can be easily installed and deployed on Windows SharePoint Services or Microsoft Office SharePoint Server.

    Enjoy

    Please feel free to download, evaluate and also to submit feature requests and suggestions in our support forums. We have a dedicated team of developers and technical support who are eager to drive this product forward with your help.

  • Aspose.Words for Reporting Services 3.3.1 Fully Supports Multi-column Reports

    We have just released Aspose.Words for Reporting Services 3.3.1. This is a maintenance release that addresses a number of issues reported by the users, as well as fully supports multi-column reports (this feature used to be unstable until now).

    Additionally, this release supports the recently introduced Product Family license type.

    To download Aspose.Words for Reporting Services 3.3.1, please visit http://www.aspose.com/community/files/52/ssrs-rendering-extensions/aspose.words-for-reporting-services/default.aspx.

  • How to load PDF into Aspose.Words?

    You already know that Aspose.Words can convert DOC, DOCX, ODT etc to PDF very well, but you might be wondering can it convert it the other way around?

    The answer is yes. But you need to use our specialized and "experimental" product Aspose.Recognition for .NET. It can convert PDF to any document format supported by Aspose.Words, that is DOC, DOCX, ODT, MHTML and others.

    If you are interested, Aspose.Recognition internally consists of a PDF parsing module, an artificial intelligence engine that "figures out what is a paragraph and what is a table" and an embedded version of Aspose.Words to save the resulting document in any of the word processing document formats.

  • Aspose.Words for .NET 8.0 supports Nested Mail Merge Regions and more

    You might be wondering, Aspose.Words for .NET 7.0 is barely 2 months old and we already have 8.0, a major version change? Yes, and that change reflects the importance of one feature that we have finally added.

    You now can just design a template document like this:

    MERGEFIELD TableStart:Orders
    ...
        MERGEFIELD TableStart:OrderDetails
        ...
        MERGEFIELD TableEnd:OrderDetails
    MERGEFIELD TableEnd:Orders

    and then call

    doc.MailMerge.ExecuteWithRegions(myDataSet);

    and Aspose.Words will do its magic to produce an order document. Then you can of course

    doc.Save(myStream, SaveFormat.Pdf);

    etc.

    Aspose.Words' new support for nested mail merge regions allows you to generate reports from master-detail (parent-child) data with ease. If your data is inside a .NET DataSet object that has proper DataTable and DataRelationship objects set up, then all you need to do is pass a DataSet to the Aspose.Words mail merge engine. It will automatically figure out data relationships and generate a report with the required data. On the other hand, it is also easy to implement your own mail merge data source interfaces IMailMergeDataSource and IMailMergeDataSourceRoot to generate a report from any data source be it a LINQ query, XML file or a set of business objects. We will be writing more in the blog and in the documentation about this great new feature. This release is "nested mail merge V1.0" and includes only the features mentioned above. There is a lot more we plan to add to the reporting functionality in Aspose.Words in the future. Feel free to submit us your requests via the Support Forums.

    There are more great new features, see the download page http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry207287.aspx

  • Configure Individual Reports with Aspose.Words for Reporting Services 3.3.0

    When exporting RDL reports to Microsoft Word documents, you can configure the export by specifying different configuration settings. You can control document layout, page breaks, page orientation, and so on.

    There is one noticeable drawback, though. You can only configure the export at a Reporting Services instance level. That means you modify the rsreportserver.config file and it affects all the reports processed by the instance. But what if you have a single report that, for example, contains a text on top of an image and you want to export this report in positioned layout mode, while the rest should derive default settings?

    This was impossible until Aspose.Words for Reporting Services 3.3.0. Now you can specify configuration XML right in the report which will affect this report only. To know more, please read the Report level configuration section in the following documentation topic:

    http://www.aspose.com/documentation/ssrs-rendering-extensions/aspose.words-for-reporting-services/configuration-explained.html

    To download Aspose.Words for Reporting Services 3.3.0, please visit

    http://www.aspose.com/community/files/52/ssrs-rendering-extensions/aspose.words-for-reporting-services/default.aspx

  • Create/Remove/Preserve Mail Merge Data Source in Documents

    Many customers have requested the following features over the time:

    1. Make sure Aspose.Words does not lose mail merge data source settings in a document during open/save or conversion.
    2. Ability to specify a mail merge data source for a document programmatically.
    3. Ability to query or clear mail merge settings specified in a document.

    We are happy to tell that we have implemented this. We have added the Document.MailMergeSettings property and MailMergeSettings, Odso, OdsoFieldMapData, OdsoRecipientData classes.

    The current plan is as follows:

    1. Aspose.Words for Java 3.3 that has just been released here supports mail merge settings in DOC and DOCX formats and conversions between them and provides the public API.
    2. Aspose.Words for .NET 7.1 that is due out next week supports mail merge settings in DOC, DOCX and WordML formats and conversions and the public API as well.
    3. Support for mail merge settings in RTF will be coming next month.
    4. An article how to create a mail merge data source and code examples will be coming soon.

     

  • How-to: Print a Document on a Server via the XpsPrint API

    Below is an excerpt from a new article in our documentation, click here to view the full article and downlod source code.

    This article can be useful to anyone who wants to submit an XPS document to the unmanaged XpsPrint API from a .NET application. But the main goal of this article is to show how to print a word processing document from an ASP.NET or Windows Service application using Aspose.Words and the XpsPrint API.

    Problem

    When you develop a .NET application and you need to produce some printed output, you can use the classes in the System.Drawing.Printing namespace or the WPF classes. But, as it turns out, if you develop an ASP.NET or Windows Service application, then your options for printing are severely limited, because Microsoft recommends against using these approaches. See the links below for more information.

    • http://support.microsoft.com/kb/324565 - The use of the .NET Framework Printing classes is not supported from a service. This includes ASP pages, which generally run in the context of the server service.
    • http://msdn.microsoft.com/en-us/library/system.drawing.printing.aspx - Classes within the System.Drawing.Printing namespace are not supported for use within a Windows service or ASP.NET application or service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions.
    • http://msdn.microsoft.com/en-us/library/bb613549.aspx - The use of WPF to build Windows services is unsupported. Because WPF is a presentation technology, the Windows service requires the appropriate permissions to perform visual operations that involve user interaction. If the Windows service does not have the appropriate permissions, there may be unexpected results.

    The Aspose.Words.Document object provides a family of the Print methods to print documents and these methods print via the .NET printing classes defined in the System.Drawing.Printing namespace. There are many customers of Aspose.Words who use this printing method in their server-side applications without any problems, but there is a way to comply with Microsoft’s recommendations and it is described in this article.

    Solution

    The proper way to print documents according to Microsoft is to use the unmanaged XpsPrint API. This API is available on Windows 7, Windows Server 2008 R2 and also on Windows Vista, provided the Platform Update for Windows Vista is installed.

    Since Aspose.Words can easily convert any document to XPS, we only need to write code that passes an XPS document to the XpsPrint API. The only problem is that the XpsPrint API is unmanaged and it requires some knowledge of the Platform Invoke.

  • Aspose.Words for JasperReports: Featuring Page Margins, Page Breaks, Page Numbers and More

    We have just released Aspose.Words for JasperReports 1.3.0. The new version includes a number of features that we hope you will find useful. Those are: page margins, page breaks of different types, and the support for Microsoft Word fields that allows, for example, export page numbers that will be dynamically updated while the generated document is being edited.

    Let's discuss all of the features in details.

    Page Margins

    Unfortunately, at the moment JasperReports print model does not allow exporters detect page margins specified in the report design. Hence, Aspose.Words for JasperReports uses a special algorithm to work this around.

    The algorithm works as follows. All page margins are set to a default value that is used by Microsoft Word when creating a new document (1 inch). If some report elements are located closer to page edges, then the corresponding page margins are reduced appropriately. That is, page margins are set to the value of 1in or less, depending on report design.

    You can change the default 1in value by specifying what page margins the exporter should try to enforce. Use the following parameter for that:

    JasperReports:

     

       import com.aspose.words.jasperreports.*;

     

       AWDocExporter exporter = new AWDocExporter();

       exporter.setParameter(AWExporterParameter.PAGE_MARGINS, “1in;1in;0.5in;0.5in”);

       exporter.exportReport();

     

     

    JasperServer:

     

    <bean id="aw_exportParameters" class="com.aspose.words.jasperreports.AWExportParametersBean">

        <property name="pageMargins" value="1in;1in;0.5in;0.5in"/>

    </bean>

     

     

    The value of the parameter is a string of the form

    "left_margin;right_margin;top_margin;bottom_margin",

    where the following units of measure are allowed:

    ·          in - inches (default, may be omitted)

    ·          cm - centimetres

    ·          mm - millimetres

    ·          px - pixels

    ·          pt - points

    Note you can use different units of measure in the same string or omit some of margin values.

    Page Breaks

    Aspose.Words for JasperReports supports three ways page breaks are inserted between document pages:

    ·          Normal page breaks

    ·          Section breaks (i.e. one section per page – default mode)

    ·          No page breaks in the document at all

    The "section breaks" mode is chosen as default because there may be headers and footers throughout the document that contain different data. Microsoft Word requires different headers/footers should be placed in different sections.

    You can change the page breaks inserted to regular (not section) breaks by using the following parameter:

    JasperReports:

     

       import com.aspose.words.jasperreports.*;

     

       AWDocExporter exporter = new AWDocExporter();

       exporter.setParameter(AWExporterParameter.PAGE_BREAKS, AWExporterParameter.PAGE_BREAKS_NORMAL);

       exporter.exportReport();

     

     

    JasperServer:

     

    <bean id="aw_exportParameters" class="com.aspose.words.jasperreports.AWExportParametersBean">

        <property name="pageBreaks" value="0"/>

    </bean>

     

     

    You can instruct the exporter to avoid any usage of page breaks (so that report contents are simply exported continuously) by using the following parameter:

    JasperReports:

     

       import com.aspose.words.jasperreports.*;

     

       AWDocExporter exporter = new AWDocExporter();

       exporter.setParameter(AWExporterParameter.PAGE_BREAKS, AWExporterParameter.PAGE_BREAKS_NONE);

       exporter.exportReport();

     

     

    JasperServer:

     

    <bean id="aw_exportParameters" class="com.aspose.words.jasperreports.AWExportParametersBean">

        <property name="pageBreaks" value="2"/>

    </bean>

     

     

    Note that in these modes, since the generated document consists of one section, only first pair of header and footer will be exported.

    Inserting Fields

    Aspose.Words for JasperReports provides a unique feature that allows inserting Microsoft Word fields to any point of the document. This can be used to insert page numbers that are dynamically updated as the document is being edited, TOC (table of contents), and many other things.

    To enable field code recognition, use the following parameter:

    JasperReports:

     

       import com.aspose.words.jasperreports.*;

     

       AWDocExporter exporter = new AWDocExporter();

       exporter.setParameter(AWExporterParameter.RECOGNIZE_FIELDS, true);

       exporter.exportReport();

     

     

    JasperServer:

     

    <bean id="aw_exportParameters" class="com.aspose.words.jasperreports.AWExportParametersBean">

        <property name="recognizeFields" value="true"/>

    </bean>

     

     

    Once this parameter is set to true, the exporter treats any text enclosed in curve brackets ({}) as a field code and exports it appropriately. For example, the following text

    Page { PAGE } of { NUMPAGES },

    will contain two fields in the produced document, PAGE and NUMPAGES, whose are calculated to the current page number and the total number of pages in the document, respectively.

    You can add any field arguments and switches supported by the field. For example, to insert a timestamp of document creation, insert the following text:

    { DOCPROPERTY CreateTime }

     

    To download Aspose.Words for JasperReports 1.3.0, please visit http://www.aspose.com/community/files/67/jasperreports-exporters/aspose.words-for-jasperreports/default.aspx.

  • Aspose.Words for Reporting Services Now Supports XPS (XML Paper Specification) and EPUB (Electronic Publication) Export Formats

    We are glad to announce a new release of Aspose.Words for Reporting Services. We have added the support for two new export formats, namely XPS (XML Paper Specification) and EPUB (Electronic Publication). Also, the new version is based on Aspose.Words for .NET 7.0 that was recently published, too (don't forget to check out the new field update feature, by the way :) ).

    To download Aspose.Words for Reporting Services 3.2.0, as well as to read a full list of fixes and improvements, please visit http://www.aspose.com/community/files/52/ssrs-rendering-extensions/aspose.words-for-reporting-services/default.aspx.

  • Useful Links - What's New in Aspose.Words for .NET 7.0.0

    In the last few days we have already blogged about most of what was coming up in Aspose.Words for .NET 7.0.0 so here is just a brief recap and a collection of useful links.

     

    Field Update Engine V1.0

    Aspose.Words for .NET can now update fields that are most frequently used in mail merge and report generation.

    It was first announced in this blog post. With some changes it became the first topic in the Working with Fields section in the documentation. We hope to see more in this section later on.

    This functionality will soon appear in Aspose.Words for Java. Next versions will support update of more field types, for example TOC. TOC update is not updated in this release.

     

    .NET Framework 4.0, Windows 7 and Visual Studio 2010 are Supported

    To be honest, this did not require much work from us. We've just tested and it worked well. But the most interesting thing is what test projects we were building: we created a couple of samples for Windows Azure.

     

    Windows Azure is Supported

    The news were first published in the Running Aspose.Words in the Windows Azure Cloud blog post.

    Now there is a NEW Windows Azure feature page in the documentation.

    There is also the Windows Azure Platform section in the Programmers Guide that contains more technical information and How-to articles for the samples we've created.

    We take Windows Azure seriously and will fully support all your requests in the forums. There are more sample projects (and probably specialized features) for Windows Azure in the pipeline.

     

    Conversion to PDF Works on Mono

    First mentioned in this blog post.

    Now we have a How-to: Run Aspose.Words with Mono article in the documentation.

    Please note we have only tested on openSUSE 11.1 so far and not tested on other operating systems. Conversion to PDF works well in most cases (very similar to the way it works on .NET), but it still has a few rough edges, especially about configuring TrueType fonts renderer on Linux for better (more accurate from the Aspose.Words' point of view) output. This will improve and become simpler in future versions. Feel free to comment.

     

    Document Rendering Enhancements

    We have addressed some of the highly popular requests and issues in the document renderer.

    For example, when converting to PDF or printing, shading with percentage fill color looked ugly with dot dithering. E.g. 20% yellow on solid blue background looked awfull making any text on top of it impossible to read. Now we have implemented the same algorithm like in Microsoft Word for smooth mixing of colors. This nice smooth color is output to all rendering formats PDF, XPS, images and printing.

     

    Shapes are Converted to Images when Exporting to HTML

    This is a cool new feature that I have not yet blogged about.

    Earlier versions of Aspose.Words just ignored all AutoShapes in a document when exporting to the HTML family of formats. There were no rectangles, arrows, stars or anything except images to be found in the resulting document.

    But during our earlier work on document rendering we have created all the necessary code for converting shapes into images. This time we have just made the HTML exporter to tap into the existing rendering feature and as a result, you can actually see all shapes in the exported HTML.

    Really the great thing is that this works not only for HTML export, but the whole family of HTML formats supported by Aspose.Words: HTML, XHTML, MHTML and EPUB.

    There are still some limitations. For example text is not rendered inside shapes to HTML, it appears after the shape as normal text. Also, floating shapes are positioned inline in HTML. But overall, it is a big step forward for Aspose.Words.

    See below how all Microsoft Word Auto Shapes now appear in exported HTML.
    Free Image Hosting at www.ImageShack.us


    Any custom shapes or ClipArt is rendered well too.
    Free Image Hosting at www.ImageShack.us

    Updated Sample Projects

    Make sure to check out the updated Aspose.Words for NET Samples download. It now includes the samples for Windows Azure and for displaying Word documents in Silverlight.

     

    New Articles in the Documentation

    Some are still marked as "drafts", but you can see we are cranking up the production line.

     

    How To Download

    As usual, for the full list of changes and to download see Aspose.Words downloads.

     

  • Convert DOC, DOCX and more to PDF - on Mono!

    How about creating an application that generates DOC files, or maybe converts DOC and DOCX to PDF and much more, all on openSUSE or Ubuntu? Yes, you can run Aspose.Words for .NET with Mono and take the exciting document processing capabilities really multi-platform.

    Aspose.Words has been known to work on Mono for quite a while, yet conversion to PDF (rendering) was not working. Document rendering was a major feature that we first released at end of 2008 and it worked on .NET only.

    Now I am happy to tell that over the last few months we've invested a considerable effort into making the upcoming Aspose.Words for .NET 7.0 to convert documents to PDF well. Here is a little preview.

    Supported Platforms

    We have used the virtual machine from the Mono website and tested in the following configuration:

    ·         Aspose.Words for .NET 7.0

    ·         Mono 2.4

    ·         openSUSE 11.1

    We hope Aspose.Words will run with Mono in other operating systems too, but at this stage we have not performed any other testing.

    Supported Features

    Aspose.Words for .NET was initially designed to be used on Windows systems with the .NET Framework. We must give credit to the developers working on the Mono project, because when we just tried to run Aspose.Words on Mono we’ve been delighted to see that most of the functionality was working straight away.

    But Aspose.Words for .NET is a big product that relies on many .NET features and not all of them are available in Mono or not working exactly like in .NET because Mono is still under development. In some cases we’ve managed to implement missing functions ourselves, yet in some cases the result is a limitation or a difference in the output because our work on the multi-platform capabilities of Aspose.Words is still in progress.

    The following table contains a brief list of Aspose.Words features and comments about their level of support on Mono.

    Feature

    Supported on Mono

    Comment

    Load and save DOC, OOXML, RTF, WordprocessingML

    Yes

     

    Load and save OpenDocument, HTML/XHTML

    Yes

     

    Save MHTML, EPUB, TXT

    Yes

     

    Convert between the above formats

    Yes

     

    Convert to PDF, XPS

    Yes

    Layout of text on a page might be different from the .NET version (less accurate).

    Images in the PNG 16RGBA format are not supported.

    Lines drawn using a brush or texture are not supported.

    Not all gradient fills are supported.

     

    Render document pages to images

    No

    Work in progress. Some coordinate transformation modes in Mono are not working like in .NET.

    Program with the Document Object Model

    Yes

     

    Mail merge from ADO.NET data sources

    Yes

     

    Mail merge from custom data sources

    Yes

     

  • Field Update in Aspose.Words - The Killer Feature of 2009

    Overview

    Aspose.Words for .NET 7.0 that will be released in the next few days includes a new exciting feature: Field Update.

    Fields in a document are like placeholders where some useful data can be inserted. For example, a field can be a page reference, formula or a mail merge field. A field in a Microsoft Word document consists of a field code and field result. The field code is an instruction about how the field result needs to be updated or calculated. An application that processes a document and encounters a field might have the functionality to interpret the instructions contained in the field code and update the field result with a new value. This is called field update.

    Usually, a field, when inserted in Microsoft Word, already contains an up to date value. For example, if the field is a formula or a page number, it will contain a correct calculated value for the given version of the document. But if you have an application that generates or modifies a document with fields, for example combines two documents or populates with data, then for the document to be useful, all fields should ideally be updated.

    All applications that need to process Microsoft Word documents with fields face the task of supporting the fields. Having seen several solutions, I identify three main levels of support for fields:

    A.      Do not support all or some fields (skip, destroy during open/save)

    B.      Roundtrip (keep intact during open/save)

    C.      Fully support (roundtrip and update result when needed)

    Fields in Microsoft Word documents are complex. There are over 50 field types (each needs its own result calculation procedure), formulas and expressions, bookmarks and references, functions and various switches. Fields can also be nested.

    It is interesting to note that while the syntax and behavior of Microsoft Word fields is well documented (thanks to Office OpenXML), there is really no other software exists, except Microsoft Word itself, that can interpret and update all fields in Microsoft Word documents at level C.

    Aspose.Words is a class library designed for server-side processing of Microsoft Word documents and the question of supporting fields is an important one. Aspose.Words earlier versions were standing at level B+. All fields in a document were preserved during open/save and conversions and it was possible to update results of some simple fields. Aspose.Words for .NET 7.0 with its new field update feature brings us much closer to level C.

    History of Fields in Aspose.Words

    Since its first appearance at the end of 2003, Aspose.Words provided the ability to generate reports (populate documents with data) using the standard Microsoft Word mail merge fields.

    The problem that we immediately noticed was that customers often already had template documents for mail merge and they contained complex expressions involving nested IF, MERGEFIELD, formulas and functions. Aspose.Words was only capable of processing the simple MERGEFIELD and NEXT fields, no nesting, no expressions. The customers had an ugly job of reworking their templates and we used to recommend “take the logic out of the document and put into the code”. We just could not offer anything else when the customers just wanted to start using Aspose.Words with existing templates.

    Fast forward to end of 2009 and we’ve finally managed to find the time to do what you’ve been asking for so long.

    Aspose.Words for .NET 7.0 includes what we call “Field Update Engine V1.0”. The main goal of this milestone is to support evaluation of the IF fields during mail merge. But we’ve done more than that, read on.

    Supported Fields

    Calculation of the following fields is supported in Aspose.Words for .NET 7.0:

    ·         = (formula field)

    ·         IF

    ·         COMPARE

    ·         DATE

    ·         TIME

    ·         MERGEFIELD

    ·         MERGEREC

    ·         MERGESEQ

    ·         NEXT

    ·         NEXTIF

    ·         DOCPROPERTY

    ·         DOCVARIABLE

    There are also several fields that Aspose.Words can update, but they are calculated by the Layout Engine when Aspose.Words renders a document (converts to PDF, XPS, images or prints). These fields have been supported and have not changed with the release of this version; I just mention them for completeness:

    ·         PAGE

    ·         PAGES

    ·         PAGEREF

    ·         REF

    ·         SECTION

    ·         SECTIONS

    Sophisticated Parsing

    Aspose.Words follows the way Microsoft Word processes fields and as a result it correctly handles:

    ·         Nested fields
    IF { =OR({ COMPARE { =2.5 +PRODUCT(3,5 ,8.4) } > 4}, { =2/2 }) } = 1 "Credit not acceptable" "Credit acceptable"

    ·         Field argument can be a result of a nested field.

    ·         Fields can be nested within a field code as well as in the field result.

    ·         Spaces/no spaces, quotes/no quotes, escape characters in fields etc
    MERGEFIELD \f"Text after""Field \n\ame with \" and \\ and \*"\bTextBefor\e

    ·         Fields that span across multiple paragraphs.

    = (Formula) Fields

    Aspose.Words now provides a very serious implementation of the formula engine and supports the following:

    ·         Arithmetic and logical operators
    =(54+4*(6-77)-(5))+(-6-5)/4/5

    ·         Functions
    =ABS(-01.4)+2.645/(5.6^3.5)+776457 \# "#,##0"

    ·         References to bookmarks
    =IF(C>4, 5,ABS(A)*.76) +3.85

    ·         Number formatting switches
    =00000000 \# "$#,##0.00;($#,##0.00)"

    The following functions in expressions are supported: ABS, AND, AVERAGE, COUNT, DEFINED, FALSE, IF, INT, MAX, MIN, MOD, NOT, OR, PRODUCT, ROUND, SIGN, SUM, TRUE.

    IF and COMPARE Fields

    Just some of the IF expressions that Aspose.Words can easily calculate should give you an idea of how powerful this feature is:

    ·         IF 3 > 5.7^4+MAX(4,3) True False

    ·         IF "abcd" > "abc" True False

    ·         IF "?ab*" = "1abdsg" True False

    ·         IF 4 = "2*2" True False

    ·         COMPARE 3+5/34 < 4.6/3/2

    DATE and TIME Fields

    Aspose.Words supports all date and time formatting switches available in Microsoft Word, some examples are:

    ·         DATE  \@ "d-MMM-yy"

    ·         DATE  \@ "d/MM/yyyy h:mm am/pm"

    Mail Merge Fields

    It is fair to say that demand for field calculation in Aspose.Words was mostly driven by customers who use the Aspose.Words’ mail merge feature (a.k.a reporting).

    Earlier versions of Aspose.Words only supported the basic usage of the MERGEFIELD and NEXT fields. Some advanced capabilities, not found in Microsoft Word’s mail merge, such as mail merge regions, inserting images and mail merge event handlers were also provided.

    But many customers had template documents with various nested IF, MERGEFIELD and formulas and simply wanted an easy way to migrate from using Microsoft Word’s mail merge to Aspose.Words.

    Aspose.Words for .NET 7.0 finally delivers this by providing an extensive implementation for fields that are most frequently encountered in mail merges.

    There is now no limit to the complexity of mail merge fields in your documents. You can use IF, formulas, nest them and even calculate the merge field’s name using a formula.

    Some examples of mail merge fields that Aspose.Words now supports:

    ·         Mail merge field switches
    MERGEFIELD  FirstName \* FirstCap \b "Mr. "

    ·         Nested merge fields in a formula
    IF { MERGEFIELD Value1 } >= { MERGEFIELD Value2 } True False

    ·         Calculate the name of the merge field at runtime
    MERGEFIELD { IF { MERGEFIELD Value1 } >= { MERGEFIELD Value2 } FirstName"LastName" }

    ·         Conditional move to next record in the data source
    NEXTIF { MERGEFIELD Value1 } <= { =IF(-2.45 >= 6*{ MERGEFIELD Value2 }, 2, -.45) }

    How to Update Fields Programmatically

    The default behavior in Aspose.Words is to preserve fields in a document intact.

    When you execute a mail merge, the all fields in the document will be automatically updated. This is because mail merge is, in fact, a case of a field update. The program encounters a mail merge field and needs to update its result, which involves grabbing the value from the data source and inserting it into the field. The logic is of course more complicated, for example, when reached the end of the document/mail merge region, but not the end of the data source, then duplicate the region and update the new set of fields.

    To explicitly update fields in the whole document, simply call Document.UpdateFields.

    To update fields contained in part of a document, obtain a Range object and call the Range.UpdateFields method. In Aspose.Words, you can obtain a Range for any node in the document tree, such as Section, HeaderFooter, Paragraph etc using the Node.Range property.

    At the moment, using UpdateFields will not update fields that are related to the page layout algorithms (e.g. PAGE, PAGES, PAGEREF). The page layout-related fields are automatically updated when you render a document (save to PDF, XPS or print). You can explicitly update page layout-related fields by calling Document.UpdatePageLayout.

    Format Switches

    A field in a document can have formatting switches that specify how the resulting value should be formatted. Aspose.Words supports the following format switches:

    ·         \@ - date and time formatting

    ·         \# - number formatting

    ·         \* Caps

    ·         \* FirstCap

    ·         \* Lower

    ·         \* Upper

    ·         \* CHARFORMAT – format result according to the first character of the field code.

    ·         \* MERGEFORMAT – format result according to how the old result is formatted (limited support at the moment).

    Date and Number Formatting in Fields

    When Aspose.Words calculates a field result, it often needs to parse a string into a number or date value and also to format it back to a string.

    Aspose.Words always uses the current thread culture to perform parsing and formatting when calculating field values.

    To control the culture used during field calculation, just set the Thread.CurrentThread.CurrentCulture property to a culture of your choice before invoking field calculation.

    Limitations

    Here is a list of known limitations in the current version of the Aspose.Words field calculation engine:

    ·         Only the specified field types are calculated.

    ·         The \* MERGEFORMAT switch support is limited.

    ·         Update of fields that span across multiple sections is not supported.

    ·         References to values of cells in a table are not supported.

    ·         Range can represent only a node (with all its children) in a tree, not an arbitrary length of text.

    What’s Next

    Now, when we’ve done the hardest part (implemented the field parsing and calculation engine), we will simply work to support calculation of all the remaining Microsoft Word document fields.

    In the next few releases expect to see exciting things like complete calculation of Table of Contents (TOC).

  • DOCX, ODT and HTML network performance tune up in Aspose.Words for Java 3.2

    We are happy to present Aspose.Words for Java 3.2.

    This release includes over 200 fixes and enhancements.

    There are many enhancements in handling of DOCX, ODT and HTML documents. Most of these changes are copies of changes made earlier in the .NET version of Aspose.Words.

    But there are also some Java specific improvements. There are performance improvements when dealing with DOCX, ODT, HTML documents and images. For example, in one test, loading an HTML document with images that are stored remotely has improved by the factor of 100.

    To see the complete list of changes and to download the new release see Aspose.Words download.

More Posts Next page »