GithubHelp home page GithubHelp logo

pavlodenys / docraptor-csharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from docraptor/docraptor-csharp

0.0 0.0 0.0 2.36 MB

A native C# client for the DocRaptor document generation service.

License: Other

C# 96.80% Shell 3.20%

docraptor-csharp's Introduction

DocRaptor C# Native Client Library

This is a DLL and NuGet package for using DocRaptor API to convert HTML to PDF and XLSX.

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

Installation

Command line:

nuget.exe install DocRaptor

Package Manager Console:

Install-Package DocRaptor

Download DLLs: get DocRaptor.dll from GitHub

Usage

See examples for runnable examples with file output, error handling, etc.

using DocRaptor.Client;
using DocRaptor.Model;
using DocRaptor.Api;
using System.IO;

class Example {
  static void Main(string[] args) {
    Configuration.Default.Username = "YOUR_API_KEY_HERE"; // this key works for test documents
    DocApi docraptor = new DocApi();

    Doc doc = new Doc(
      Test: true,                                                    // test documents are free but watermarked
      DocumentContent: "<html><body>Hello World</body></html>",      // supply content directly
      // DocumentUrl: "http://docraptor.com/examples/invoice.html",  // or use a url
      Name: "docraptor-csharp.pdf",                                  // help you find a document later
      DocumentType: Doc.DocumentTypeEnum.Pdf                         // pdf or xls or xlsx
      // Javascript: true,                                           // enable JavaScript processing
      // PrinceOptions: new PrinceOptions(
      //   Media: "screen",                                          // use screen styles instead of print styles
      //   Baseurl: "http://hello.com"                               // pretend URL when using document_content
      // )
    );

    byte[] create_response = docraptor.CreateDoc(doc);
  }
}

Docs created like this are limited to 60 seconds to render, check out the async example which allows 10 minutes.

We have guides for doing some of the common things:

More Help

DocRaptor has a lot of more styling and implementation options.

Stuck? We're experts at using DocRaptor so please email us if you run into trouble.

Development

The majority of the code in this repo is generated using swagger-codegen on docraptor.yaml. You can modify this file and regenerate the client using script/generate_language csharp.

The generated client needed a few fixes

Release Process

  1. Pull latest master
  2. Merge feature branch(es) into master
  3. script/test
  4. Increment version in code:
  • swagger-config.json
  • DocRaptor.nuspec
  • src/main/csharp/DocRaptor/Properties/AssemblyInfo.cs
  • src/main/csharp/DocRaptor/Client/Configuration.cs (2 places)
  1. Update CHANGELOG.md
  2. Commit "Release vX.Y.Z"
  3. Push to GitHub
  4. Tag version: git tag 'vX.Y.Z' && git push --tags
  5. Build package using script/build
  6. script/nuget push bin/DocRaptor.X.Y.Z.nupkg
  7. Verify package release at https://www.nuget.org/packages
  8. Open https://github.com/DocRaptor/docraptor-csharp/tags and make a new release for the version. Use the git tag as the name, CHANGELOG entries as the description, and attach bin/*.dll and bin/*.xml to the release
  9. Refresh documentation on docraptor.com

Version Policy

This library follows Semantic Versioning 2.0.0.

docraptor-csharp's People

Contributors

jqr avatar jason-o-matic avatar jamespaden avatar mediocretes avatar esquivalient avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.