Crocodoc .NET API Out Of Beta

My colleague Frank Taylor and I are happy to announce that Crocodoc v1.0 for .NET is now out of Beta testing and can be downloaded from its Google Code site. Thanks to everyone who has participated in the 1.0 Beta testing and who has provided feedback or reported any issues.

And for those who may be reading this article wondering what this .NET library is for, check out my previous blog post about its beta release, Frank’s blog entry, or even the Crocodoc site itself.

Besides fixes, only one (overloaded) method has been added to this release. While the previous CrocodocDocument.Upload(string filePath) allowed you to specify a complete file path for you to upload, the method CrocodocDocument.Upload(string fileName, byte[] binary) allows you to upload a document’s byte array directly. This could be useful for when uploading files not from the file system, but say a database or content management system.

Please continue to either contact Frank or myself with any feedback, suggestions, or further issues found. And happy document embedding everyone!

Crocodoc .NET API Library Released

For those of you reading the title and asking, “What is this Crocodoc???”, Crocodoc is a tool that “converts Microsoft Office and PDF documents to HTML5 so your users can view and collaborate right in your web app.” What that means is, you can present your customers documents such as Word docs, PDFs, and Power Point presentations… embedded and viewable within your web pages. Long are the days where your customers must download your PDFs in order to view them.

That being said, my colleague and friend, Frank Taylor, needed to interact with the Crocodoc v2 REST API, but discovered Crocodoc was missing the .NET API. So after working together, we are now happy to announce that the Beta version of 1.0 for a .NET Wrapper has been released on its Google Code site. If you just want to jump straight into the action, you can download the binaries here. For those of you who might have worked with the Crocodoc Java or PHP API’s, you should feel comfortable with the .NET API.

Although the project’s Google Code site has plenty of samples (and there’s even an Examples project you can download and run as well), here’s a quick sample of its usage.

Crocodoc.ApiToken = "your-unique-api-token-right-here";
string sessionID;

try
{
    // Here, documentUUID is the uuid for the Document that you want to create a session for.
    sessionID = CrocodocSession.Create(documentUUID);
}
catch (CrocodocException ex)
{
    // Log or show error message if the Crocodoc server threw a web exception.
}

The above creates a unique session for a given document so that you can then embed it onto your webpage. The session allows you to set properties such as copyrighted, admin privies, or even allow the writing of annotations for your editors.

Here’s an example of uploading a new document to crocodoc.

try
{
    string newDocUUID = CrocodocDocument.Upload(@"C:\Documents\YourPDF.pdf");
}
catch (CrocodocException ex)
{

}

Your Help?

We have released it as version 1.0 Beta as we would like some of your help and feedback with the library. If you use Crocodoc and have been looking for a .NET API, try it out, and let us know any issues that you run into, or if you have any feature requests.

Quick Links

Crocodoc API Reference
Crocodoc .NET
Crocodoc .NET Binaries