We think this is the quickest and easiest way to generate good looking PDF documents from a .NET application or web site using either C# or VB.
The Scryber library allows developers to declaratively define documents, pages, components and even
styles in an xml file. Load that file, perform any manipulations required and render the document to an output stream.
It is now possible to create PDF documents that are branded, designed and consistent.
Why PDF
It seems to be always hard work to create PDF's, especially good looking, consistent, flowing PDF's. Now Scryber makes it much easier.
An email or html page lacks presence, they have no perceived value. As html has become more dynamic so it's ability to represent a static document is reduced, and printing is not appropriate.
PDF has a physicality not available with current browser renditions of HTML.
Scryber is a valuable tool in your box of tricks.
Download the package
scryber is now available to download and install directly from Visual Studio and NuGet. This is the preferred method for all users of .NET 4.0+, for users of 2.0 - 3.5 you can still install from the release.
VSIX extension is available here...
http://visualstudiogallery.msdn.microsoft.com/1f14c378-c102-4687-a16f-ce4eaaef845dAnd the NuGet package (does not include the item templates) is available here
http://www.nuget.org/packages/scryber/Or simply search for scryber from within Visual Studio Extensions and Updates
Hello World
As a quick example of your xml file
<?xml version="1.0" encoding="utf-8"?>
<pdf:Document xmlns:pdf="Scryber.Components, Scryber.Components"
auto-bind="true" >
<Pages>
<pdf:Page id="MyFirstPage" >
<Content>
Hello World
</Content>
</pdf:Page>
</Pages>
</pdf:Document>
And then output the document
protected void Page_GeneratePDF(object sender, CommandEventArgs e)
{
PDFDocument doc = PDFDocument.ParseDocument("./App_Data/PDFs/Document.pdfx");
doc.ProcessDocument(this.Response);
}
OK - Nice, but not that special
If that was all, then it might be interesting, but nothing spectacular, right?
Well what about...
- cascading styles,
- data binding,
- custom components,
- or even writing your own extensions.
Would that spark interest? Thought so...
Learning More
There is a walkthrough for creating a dynamic styled PDF document on CodeProject
http://www.codeproject.com/Articles/531083/Generating-dynamic-PDF-documents-with-ScryberAnd we are building the documentation at scryber.co.uk
http://www.scryber.co.uk/HowTo.aspx