This is a preview version of Cyotek's blog and may be missing functionality and/or unstable. Please visit for the current version of the blog.
If you encounter any problems using this preview site, please contact us with the details.

Posts tagged with 'convert'

Using custom type converters with C# and YamlDotNet, part 2

c# convert yaml type 0 Comments Downloads

Recently I discussed using type converters to perform custom serialization of types in YamlDotNet. In this post I'll concentrate on expanding the type converter to support deserialization as well.

I'll be reusing a lot of code and knowledge from the first part of this mini-series, so if you haven't read that yet it is a good place to start.

Read More

Using custom type converters with C# and YamlDotNet, part 1

c# convert yaml type 0 Comments Downloads

One of our internal tools eschews XML or JSON configuration files in favour of something more human readable - YAML using YamlDotNet. For the most part the serialisation and deserialisation of YAML documents in .NET objects is as straight forward as using libraries such as but when I was working on some basic serialisation there were a few issues.

For this demonstration project, I'm going to use a pair of basic classes.

Read More

Displaying the contents of a PDF file in an ASP.NET application using GhostScript

c# image pdf ghostscript convert 3 Comments Downloads

After receiving quite a few requests on making the PDF image conversion work in a web application, I wanted to see how hard it would be to do. Not hard at all as it turns out, I had a nice working sample running with a bare 5 minutes of work.

The sample available for download below is a basic ASP.NET application, comprised of a single page with an IHttpHandler for displaying the image. In order to make this sample as easy as possible, it uses pure server side controls and code, nothing client side.

Read More

Extending the ImageBox component to display the contents of a PDF file using C#

c# winforms image imagebox pdf ghostscript convert 2 Comments Downloads

In this article, I'll describe how to extend the ImageBox control discussed in earlier articles to be able to display PDF files with the help of the GhostScript library and the conversion library described in the previous article.

You can download the source code used in this article from the links below, these are:

Read More

Convert a PDF into a series of images using C# and GhostScript

c# image pdf ghostscript convert gsapi_new_instance gsapi_exit gsapi_delete_instance 68 Comments Downloads

An application I was recently working on received PDF files from a webservice which it then needed to store in a database. I wanted the ability to display previews of these documents within the application. While there are a number of solutions for creating PDF files from C#, options for viewing a PDF within your application is much more limited, unless you purchase expensive commercial products, or use COM interop to embed Acrobat Reader into your application.

This article describes an alternate solution, in which the pages in a PDF are converted into images using GhostScript, from where you can then display them in your application.

Read More