I was always interested if the service that, for example, WebSnapr provides is practically useful. Having snapshots of a linked pages looks very cool indeed, but does not really provide much information, at least for me.

But recently I have found a nice use case for a similar service. For tables in my IoC Frameworks posts, I was using parts of a Zoho spreadsheet embedded through an iframe. However, Google Code wikis do not allow iframe embedding.

The easy solution was to use built-in wiki table markup, but in this case I would lose all color coding and ability to download the whole sheet as Excel. The interesting solution was to embed snapshot of an iframe, as an image. This would also allow me to solve the iframe problem for RSS readers that do not support them.

My original idea was to use Firefox or Chrome (via Chromium project) to do the snapshots, but I have not managed to use the Mono.Mozilla on Windows and I was too lazy to dive into Chromium.

IE was the simplest remaining choice, so using information from the great article of Peter Bromberg, I have built my own implementation of web snapshotting service. The main difference between my snapshots and other services is that my service can actually determine the correct size of the snapshot.

For example, this is a snapshot of my IoC frameworks table:

You can click it to see the source of the snapshot. As you can see, it has correct size (instead of being fixed to 1024×768 or another screen size). On an unrelated note, it is an updated version of framework comparison, now including LinFu (which was updated to pass all feature tests).

In Google Code it looks like this.

Additional interesting usage for this would be iframe-widget embedding to locations that do not support iframes. For example, it is possible to embed a list of RSS feed headers or twitter messages in Google Code using this technique.

You can svn-download source code from Google Code. It is really bare for now, no good error-handling and no resizing support (all snapshots are always displayed in full size). However it may be a good starting point.

Looking at this project, I think that it would be very interesting to have a .NET wrapper for Chrome APIs that would allow anyone to automate Chrome, which probably will make snapshot extraction much faster and not COM-reliant.

  • http://nesteruk.org Dmitri Nesteruk

    Hi, I saw your post on StackOverflow regarding use of AvalonEdit, so I ended up downloading it and playing with it a bit. Unfortunately, after an hour of exception after exception, I gave up. So I was wondering if I could blatantly ask for your help :) because I really want this to get working, but with a 0% documentation level in the API, I'm finding actually using AvalonEdit to be hell on earth. Pleeease?

  • http://blog.ashmind.com Andrey Shchekin

    Ok, what exceptions are you getting? They might have broken something since the version I downloaded, or I could have occasionally set some options that is required by it to work correctly.

  • http://spbalt.net Dmitri Nesteruk

    Well, I drop a TextEditor component onto my form, and everhthing crashes. I suppose there is some 'proper' way to use it, but what I would really love is an example, because I could find none on the internet.

  • http://spbalt.net Dmitri Nesteruk

    Well, I drop a TextEditor component onto my form, and everhthing crashes. I suppose there is some 'proper' way to use it, but what I would really love is an example, because I could find none on the internet.

  • http://blog.ashmind.com Andrey Shchekin

    Well I had crash I think, and that was related to the fact that text was not set — it required at least “” to be provided.
    But they have fixed it since, so now everything should work well.

    I can't really give an example since all my usage is commercial and it is hard to untie a meaningful example from the app itself.

    But can you provide the crash stack trace?

  • http://www.facebook.com/KillerMind David Neubauer

    Worked like a charm, you just made my Saturday. Thanks Andrey

  • http://www.facebook.com/KillerMind David Neubauer

    Worked like a charm, you just made my Saturday. Thanks Andrey

  • dailywake

    Great Work
    i download project and there file AllowedUrlList.xml not found.
    i find problem with make example.
    WebSnapshot.Create(url, size);
    AshMind.Web.Snapshots.Sizing.IWebSnapshotSize size;
    how i can put size for IWebSnapshotSize ;
    Regrads