Spot the web RSS 2.0
# Saturday, December 15, 2007

PDFsharp is the Open Source library that easily creates PDF documents from any .NET language.

The same drawing routines can be used to create PDF documents, draw on the screen, or send output to any printer.

Here are just a few highlights:

  • Creates PDF documents on the fly from any .Net language
  • Easy to understand object model to compose documents
  • One source code for drawing on a PDF page as well as in a window or on the printer
  • Modify, merge, and split existing PDF files
  • Images with transparency (color mask, monochrome mask, alpha mask)
  • Newly designed from scratch and written entirely in C#
  • The graphical classes go well with .Net
  • Includes MigraDoc Lite for high level text layouting (you can use both PDFsharp and MigraDoc Lite in one document)

Hello World Sample

This sample shows how to create a PDF document, add a page, draw some text, and save it to disk.

// Create a new PDF document
PdfDocument document = new PdfDocument();
 
// Create an empty page
PdfPage page = document.AddPage();
 
// Get an XGraphics object for drawing
XGraphics gfx = XGraphics.FromPdfPage(page);
 
// Create a font
XFont font = new XFont("Verdana", 20, XFontStyle.Bold);
 
// Draw the text
gfx.DrawString("Hello, World!", font, XBrushes.Black,
  new XRect(0, 0, page.Width, page.Height),
  XStringFormat.Center);
 
// Save the document...
string filename = "HelloWorld.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);
The result is this:
HelloWorld.pdf (2.41 KB)

Saturday, December 15, 2007 10:59:35 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0] - Trackback
.Net | Programming
# Monday, December 10, 2007

Today, Google released their Chart API. Basically, the Google Chart API allows you to dynamically generate charts for use in your web applications. All you do is pass your data in the querystring and an image is returned. This isn't really a service to get too excited about, but it is pretty simple to use and it's Free.

Here is a bit about this:

The Google Chart API lets you dynamically generate charts. To see the Chart API in action, open up a browser window and copy the following URL into it:

http://chart.apis.google.com/chart?cht=p3&chd=s:hW&chs=250x100&chl=Hello|World

Press the Enter or Return key and - presto! - you should see the following image:

Yellow line chart

I decided to code up a small ASP.NET Server Control that uses the Google Chart API to put simple line graph charts on a page.

How to use this control:

Put the Chart control on the page:

<GoogleAPI:Chart runat="server" id="Chart1" 
   Width="200" Height="150" LineColor="ff0000"
   BackgroundColor="efefef"
   ToolTip="Hello World">
</GoogleAPI:Chart>

In the page load event define the values to be charted:

Chart1.MaxValue = 60;

Chart1.Values.Clear();

Chart1.Values.Add("Jan", 10);
Chart1.Values.Add("Feb", 20);
Chart1.Values.Add("Mar", 30);
Chart1.Values.Add("Apr", 50);
Chart1.Values.Add("May", 5);
Chart1.YAxisLabels.Add("0 Kb");
Chart1.YAxisLabels.Add("25+ Kb");
Chart1.YAxisLabels.Add("50+ Kb");

And, that's all you have to do to put a Chart on your page using the control.

The result is this:

Download the example / source code here: GoogleChartAPI.rar (3.33 KB)

Monday, December 10, 2007 4:21:29 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0] - Trackback
.Net | Google | Programming | Visual Studio
# Sunday, December 09, 2007

Last week (december 5th) Microsoft announced the Volta technology preview, a developer toolset for building multi-tier web applications using existing and familiar tools, techniques and patterns.

Volta’s declarative tier-splitting enables developers to postpone architectural decisions about distribution until the last possible responsible moment. Also, thanks to a shared programming model across multiple-tiers, Volta enables new end-to-end profiling and testing for higher levels of application performance, robustness, and reliability. In effect, Volta extends the .NET platform to further enable the development of software+services applications, using existing and familiar tools and techniques.

You architect and build your application as a .NET client application, assigning the portions of the application that run on the server tier and client tier late in the development process.

After tier assignments, Volta's deep integration with Visual Studio debugger and testing infrastructure dramatically improves the deployment experience for developers.

  • Volta automatically creates communication, serialization, and remoting code. Developers simply write custom attributes on classes or methods to tell Volta the tier on which to run them.
  • Developers may base tier assignments on any criteria, such as load management, performance, or location of critical assets and capabilities. Because Volta automates the hidden plumbing code, it is easy for developers to experiment with varying assignments of classes and methods to tiers.
  • Developers can use all the .NET languages, libraries, and tools they already know, including debuggers, profilers, test generators, refactoring, and code analysis tools.

Volta offers deep integration with Visual Studio 2008, including debuggers, profilers, and testing frameworks. Developers can step through code seamlessly from one tier to another, can set breakpoints on any tier, and trace flows of control across distributed systems.

What do you need to use Volta?

The Volta developer toolset requires Visual Studio 2008 and the .NET Framework 3.5 for writing and building applications. Volta applications run virtually anywhere, even where an MSIL runtime is not available. A Volta client-side application can run in most standards-compliant browsers, but can also be targetted also take advantage of MSIL runtimes like the .NET CLR.
 
All this sounds great, except the requirements that are trying to enforce the developers to use Visual Studio 2008 and the new .NET Framework 3.5.
 
I wonder why the long wait for this release? And why it does not compatible with .NET Framework 2.0?
 
BTW, It is just me or the Volta logo reminds firefox logo a bit:
 

  <- VS ->   

Sunday, December 09, 2007 2:41:46 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0] - Trackback
.Net | Microsoft | Programming | Visual Studio | Volta
Navigation
Archive
<December 2007>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Guy Levin
Sign In
Statistics
Total Posts: 63
This Year: 0
This Month: 0
This Week: 0
Comments: 14
Themes
All Content © 2010, Guy Levin