Free Support Forum - aspose.com

Aspose.Words on client-side using Silverlight 2?

Hi

I read with interest your blog post noting that on the server side some of the big new names in document collaboration are using Aspose (http://www.aspose.com/community/blogs/aspose.words/archive/2008/05/02/aspose-words-the-engine-of-choice-for-online-word-processors.aspx#comments).

My question is whether Aspose.Words will work on the client side in Silverlight 2? So doing some basic Doc-To-Html conversion on the client side to offload it from the server?

Could this work now? Are there plans to make the libraries (or parts) work with Sliverlight 2?

Cheers.

Andy

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Could you please clarify how you would like to use Aspose.Words on client side?

Only javascripts can work on client side. All other logic is processed on the server side. Any way you should upload document to the server, perform conversion and sent it back to client side.

Best regards.

I'm not wishing a document viewer control in Silverlight.

I would like to open a file from the file system (via Open File dialog) or Isolated Storage in Silverlight 2 and convert the Doc/Docx file to HTML or text. Not on the server, on the client. So that this rich client app can allow the user to tailor and update the HTML/text before it even gets uploaded to the server. So this will make it easier to host the app on Google App Engine or other cloud type hosting, where Aspose.Word may not be able to be installed on the server. Or to simply put less load performing conversions on IIS hosting. Hence, browser based conversion, within Silverlight 2.

I'm obviously slightly unclear on which standard libraries - such as Aspose.Word - would work/compile with Silverlight 2 into an XAP file (with XAML views, and .dlls, hopefully including Aspose.Word).

I'm also only really talking a basic conversion feature set on Silverlight, rather than all the merge/macro support aspects - load, convert and save only.

Many thanks.

Andy

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for more information. We will investigate this issue and provide you more information.

Best regards.

Thank you for your interest. We are looking at Silverlight certainly. There was not much we could do for early Silverlight version, but with version 2 things seem to be more interesting.

We will do tests on Silverlight 2 asap and try to make sure Aspose.Words works fully.

I hear that you only need conversion features, but another customer might wish to use something of the document object model or reporting features.

What size of Aspose.Words.dll download do you think will be acceptable in the Silverlight environment?

By the way, Aspose.Editor our word processor control internally uses Aspose.Words to work with documents and it is downloadable to a client. In one mode it works inside Internet Explorer as a .NET control. It is not Silverlight though, but client mode still.

> What size of Aspose.Words.dll download do you think will be acceptable in the Silverlight environment?

Aspose.Words.dll seems to be 2.4Mb? And in a zipped XAP as Silverlight gets deployed, it seems to be around 861Kb. I'm fine with that really, as the client app could have a friendly UI to explain the download, and then it will get cached. Under 1Mb seems OK for something like this.

As an alternative there are samples of on demand assembly deployment (http://joel.neubeck.net/2008/03/silverlight-how-to-on-demand-assembly-deployment/) which I'd assume might be a good plan for this type of deployment, for a larger assembly like Aspose.Words.

Well I suppose as I mentioned with my requirements, I'd be happy for a Silverlight version perhaps with the Drawing, Reporting and Viewer APIs removed. Though of course I'm sure it's not as simple as that.

It's great to hear that you might explore Silverlight usage, as with rich client apps, pre-conversion on the client could be a very interesting prospect.

Cheers.

Andy

I would like to add my vote for this too, would be great to have document conversion on the client using Silverlight, I would have a lot of scenarios where I can use such.

To all clients who are interested in using Aspose.Words on the client in Silverlight 2:

How would you demo this to your boss? What will your demo do and how Aspose.Words will be involed?

My use case that I would like to demo is a smart multiple upload tool for documents, combining:

  • multiple upload, with visual Silverlight control to show list of pending document uploads
  • pre-conversion of doc/docx to XHTML on client side using Aspose.Words, with preview of content in containing page of Silverlight control using HTML Bridge and innerHTML directly onto HTML page, so not displaying HTML/Doc in Silverlight
  • some basic transformation of this XHTML on client before confirming upload, with HTMLTidy style C# library, this custom transform will be specific to the site/applications content rules eg. convert Page Breaks to HR or add custom
    wrappers to figures etc. again allowing basic preview on client before upload

    The comparable use case for Aspose.Cells on the client - a smarter uploader - would be to on the client find out the Column names before upload, preview their names, and choose which will be used for import on the server side.

    Cheers.

    Andy

Will your documents contain images in them? When converting to HTML Aspose.Words needs to write them to some folder as files. Given a sandbox-like nature of a Silverlight application you could easily run into problems with that. Maybe you could use Aspose.Words export to MHTML instead so the images are embedded all in a single output file/stream.

If you want a preview before upload, maybe you could use Aspose.Words export to XAML FlowDocument and show that inside Silverlight? Export to XAML in Aspose.Words is coming soon.

In this specific use case, the documents wouldn’t include images, or images could be ignored. Though as you say, MHTML files could provide the source to extract only the HTML. Direct conversion to FlowDocument would be very cool. However, the reason for wanting the HTML (without images) on the client-side with doc-to-html via Aspose.Words was to preview in HTML some default conversions eg. Word columns to

, page breaks to tabbed HTML, headings to
    list of anchor links etc. and preview that in the browser, to confirm before upload. Once converted by Aspose.Words these preview custom transforms could be done by XSLT, programatically in C# or other technique, then pushed to the browser from Silverlight uploader control via HTML Bridge.

Well, I played with Silverlight 2 and even tryed building Aspose.Words for Silverlight and I can tell we will certainly make Aspose.Words to run on the client side in Silverlight 2.

It is not a one day job however because some common .NET classes that Aspose.Words uses are not available in Silverlight. Sufficient to say that System.Drawing is (understandably) missing in Silverlight but Aspose.Words uses at least Color and Image classes. Also some collection classes such as ArrayList, SortedList and Hashtable are not available in Silverlight (but there are replacements). Only few System.Text.Encoding classes are available. XmlTextReader and deriving from it is not available. NUnit is tricky to get running as far as I can tell.

All in all there will be enough tasks for 2-3 months of solid work if we start now. And I don't think we can start now. I would actually prefer to wait for Silverlight release. It will be interesting to see how many of the classes that are missing now they will add. For example it is clear they will not add support for GDI+ images because Silverlight is cross platform, but I think it would be really nice if they add more supported encodings. We cannot read a DOC file properly without 1252 encoding. It would be a waste if we write this code and then release version of Silverlight makes it unnecessary.

Thanks for looking into this. The encoding aspects do seem a bit of a restriction, if they are more limited in Silverlight.

I suppose in general I'm hoping that some of the libraries such as Aspose follow the path of .Net 3.5 SP1 in that there will be a number of "profiles" to allow deployment on either Server, Desktop Client or RIA Client (Silverlight), like the Client Profile now available for .Net. So as much can be implemented on each as possible, but keeping size down.

I'm assuming Silverlight 2 will be Release in August (they're rushing for the Olympics!). So it would be great to see some libraries coming to Silverlight (in alpha/beta) soon after that.

Cheers.

Andy

Hi!

Has there been any progress in this direction? Silverlight 3 should make things easier.

Thanks,
Chris

Hi Chris,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words. unfortunately, this issue is still opened. You will be notified as soon as it is resolved.

Best regards.

Rom (and all) --

Please help.

I am new here and trying to find out what Aspose can (and cannot) do with Silverlight in the area of displaying and editing documents in a Silverlight 3 application.

It looks like the displaying of documents is done, as noted here...

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/display-word-documents-in-silverlight.html

However, what about the editing of documents?

I see the class libraries seems to support the import/export/conversion to/from all the necessary formats that we have (Doc, Odt, Docx, Rtf, Html) etc-- but can those libraries all be used from within a Silverlight-based document editor control?

However, I need a Silverlight-based document editor for such. Do you have one?

Our goal is to get to take a variety of single-file input (Doc, Odt, Docx, Rtf, Xml, Html), convert to a our application's standard format (which will probably be Odt), allow the user to edit online, and allow export as Odt or other fomat-- and repeat that process as many time as desired.

We can do all that with RTF already but the problem is "embedded images" which we cannot currently support while still maintaining the "must be a single file" requirement.

What would you suggest?

Please advise.

Thank you.

-- Mark Kamoski

Hi Mark,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words. Aspose.Words is a class library for working with Word documents programmatically. It does not provide any graphic user interface for editing/viewing documents.

In the example, Aspose.Words used to convert Word documents to XPS format, which can be used to show document preview in Silverlight or WPF applications.

There are a lot of good products on the market, which allows editing of MS Word documents, like "TX Text Control", "Subsystems TE", "TextDynamics", "Rad Editor", "ALLText HT/Pro". Also there are some web-based editors like Buzzword, Google Docs, ZohoWriter. You can try using one of them.

Best regards.

Hi there,

Has there been any more progress on getting Aspose.Words operating in a silverlight environment? The recent Silverlight 4 release increased the platforms capability to the point where it has become feasible to completely port our companies product line over to it. The only item which we can't port right at the moment, is the use of the Aspose assemblies for Word document generation.

There are many benefits for moving over to Silverlight not least of which is cross platform capability (i.e. MAC), but without silverlight versions of Aspose, we can't make everything work online AND offline.

The product line is intended to be implemented as a set of out-of-browser applications that will also operate when the client computer is in a disconnected state. I understand that we could use the new COM interop features to access Aspose.Words, but that is a PC only solution and not compatible with MAC versions of silverlight. The conventional way of doing it (connecting to an ASP.NET service to generate the report) obviously is not possible when operating in a disconnected state.

Any information you can provide would be greatly appreciated!

Many thanks

Louis

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately, there is no Aspose.Words version for Silverlight. Silverlight does not have .NET GDI+ but Aspose.Words needs it. We need to get rid this dependency particularly to synchronize .NET and Java versions of Aspose.Words. This is our high priority task at the moment. When we complete this work – working with graphics will be abstracted away so we can then look at making a Silverlight version. We will let you know when such version of Aspose.Words is available.

Best regards.

Hi all,

I just want to get a confirmation that whether i can preview any word document

using Aspose.Words.dll in silverlight 3 or 4.

Thanks