Scryber.Core 5.0.1-alpha

The Scryber PDF Generation library for dotnet 5

Scryber is an advanced PDF generation tool that allows complete definition of a dynamic PDF document based on XML, XHTML (and code)  including cascading styles, databinding and referenced files easily from your Apps or MVC web apps or Javascipt ajax calls.
This framework is built entirely in .NETCore and is released under the LGPL licence so you can link to it in commercial applications.

This is a prerelease version of Scryber.Core.
There is a newer version of this package available.
See the version list below for details.
Install-Package Scryber.Core -Version 5.0.1-alpha
dotnet add package Scryber.Core --version 5.0.1-alpha
<PackageReference Include="Scryber.Core" Version="5.0.1-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Scryber.Core --version 5.0.1-alpha
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Scryber.Core, 5.0.1-alpha"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Scryber.Core as a Cake Addin
#addin nuget:?package=Scryber.Core&version=5.0.1-alpha&prerelease

// Install Scryber.Core as a Cake Tool
#tool nuget:?package=Scryber.Core&version=5.0.1-alpha&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

scryber.core

The dotnet core scryber pdf creation library

Scryber PDF Library

The scryber library is an advanced, complete, document creation library for dotnet 5.
It supports the easy definition of documents, pages, content, shapes and images by xml template, html and css, or simple code.

With a styles based layout it is easy to create good looking and flowing documents.
Binding in your models and datasources allows you to quickly generate the template and output to pdf.

Getting Started

The easiest way to begin is to use the Nuget Packages here

scryber.core package
(Base libraries for GUI or console applications)

OR for asp.net mvc

scryber.core.mvc package
(Which includes the scryber.core package).

The full documentation is available here

scryber.core documentation

Hello World Plus

Just a bit more than a hello world example.

Create your template pdfx (xml) file.


      <?xml version='1.0' encoding='utf-8' ?>
      <doc:Document xmlns:doc='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Components.xsd'
                    xmlns:styles='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Styles.xsd'
                    xmlns:data='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Data.xsd' >
        <Params>
          <doc:String-Param id='Title' value='Hello World'  />
        </Params>
        <Styles>
          <styles:Style match='doc:Page'>
            <styles:Font family='Arial' size='14pt' />
          </styles:Style>

          <styles:Style match='.heading' >
            <styles:Fill color='#FF7777'/>
            <styles:Text decoration='Underline'/>
          </styles:Style>
      
        </Styles>
        <Pages>

          <doc:Page styles:margins='20pt'>
            <Content>
              <doc:H1 styles:class='heading' text='{@:Title}' />
              <doc:Div>We hope you like scryber.</pdf:Div>

            </Content>
          </doc:Page>
        </Pages>

      </doc:Document>

From your application code.


      //using Scryber.Components

      static void Main(string[] args)
      {
          using(var doc = Document.ParseDocument("[input template].pdfx"))
          {
              doc.Params["Title"] = "Hello World from Scryber";
              var page = doc.Pages[0] as Page;
              page.Contents.Add(new Label(){ Text = "My Content" });
              doc.SaveAsPDF("[output file].pdf");
          }
      }

Or from an MVC web application


      //using Scryber.Components
      //using Scryber.Components.Mvc

      public IActionResult HelloWorld(string title = "Hello World from Scryber")
      {
        using(var doc = Document.ParseDocument("[input template].pdfx"))
          {
              doc.Params["Title"] = title;
              var page = doc.Pages[0] as Page;
              page.Contents.Add(new Label(){ Text = "My Content" });
          
              return this.PDF(doc); // inline:false, outputFileName:"HelloWorld.pdf"
          }
      }

And the output

Hello World Output

Check out Read the Docs for more information on how to use the library.

scryber.core documentation

Getting Involved

We would love to hear your feedback. Feel free to get in touch.
Issues, ideas, includes are all welcome.

If you would like to help with building, extending then happy to get contributions

scryber.core

The dotnet core scryber pdf creation library

Scryber PDF Library

The scryber library is an advanced, complete, document creation library for dotnet 5.
It supports the easy definition of documents, pages, content, shapes and images by xml template, html and css, or simple code.

With a styles based layout it is easy to create good looking and flowing documents.
Binding in your models and datasources allows you to quickly generate the template and output to pdf.

Getting Started

The easiest way to begin is to use the Nuget Packages here

scryber.core package
(Base libraries for GUI or console applications)

OR for asp.net mvc

scryber.core.mvc package
(Which includes the scryber.core package).

The full documentation is available here

scryber.core documentation

Hello World Plus

Just a bit more than a hello world example.

Create your template pdfx (xml) file.


      <?xml version='1.0' encoding='utf-8' ?>
      <doc:Document xmlns:doc='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Components.xsd'
                    xmlns:styles='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Styles.xsd'
                    xmlns:data='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Data.xsd' >
        <Params>
          <doc:String-Param id='Title' value='Hello World'  />
        </Params>
        <Styles>
          <styles:Style match='doc:Page'>
            <styles:Font family='Arial' size='14pt' />
          </styles:Style>

          <styles:Style match='.heading' >
            <styles:Fill color='#FF7777'/>
            <styles:Text decoration='Underline'/>
          </styles:Style>
      
        </Styles>
        <Pages>

          <doc:Page styles:margins='20pt'>
            <Content>
              <doc:H1 styles:class='heading' text='{@:Title}' />
              <doc:Div>We hope you like scryber.</pdf:Div>

            </Content>
          </doc:Page>
        </Pages>

      </doc:Document>

From your application code.


      //using Scryber.Components

      static void Main(string[] args)
      {
          using(var doc = Document.ParseDocument("[input template].pdfx"))
          {
              doc.Params["Title"] = "Hello World from Scryber";
              var page = doc.Pages[0] as Page;
              page.Contents.Add(new Label(){ Text = "My Content" });
              doc.SaveAsPDF("[output file].pdf");
          }
      }

Or from an MVC web application


      //using Scryber.Components
      //using Scryber.Components.Mvc

      public IActionResult HelloWorld(string title = "Hello World from Scryber")
      {
        using(var doc = Document.ParseDocument("[input template].pdfx"))
          {
              doc.Params["Title"] = title;
              var page = doc.Pages[0] as Page;
              page.Contents.Add(new Label(){ Text = "My Content" });
          
              return this.PDF(doc); // inline:false, outputFileName:"HelloWorld.pdf"
          }
      }

And the output

Hello World Output

Check out Read the Docs for more information on how to use the library.

scryber.core documentation

Getting Involved

We would love to hear your feedback. Feel free to get in touch.
Issues, ideas, includes are all welcome.

If you would like to help with building, extending then happy to get contributions

Release Notes

5.0.1-alpha

Increased support for the HTML parsing with entities and DTD, along with the upgrade to dotnet 5

1.0.1-alpha

Significant updates to the Components namespace (removing the PDF prefix); support for the match='' style attribute; prioritizing style application based on selectors and complexity; direct parsing of XHTML; and support for styles based page breaking. With updated unit tests

1.0.0.25
-----------------
Updated and improved HTML and Markdown handling.

1.0.0.24
-------------------
Package for release to Nuget Public
Updated for the allow missing images option and fixed height and width for 0 resolution
Added the xsd files to the root of the components project
Added a readme.txt file
Added column-widths to the components and styles, with support for varable widths.
Page numbering falls back to the page number format set on the page if not explicitly set.
Removed the Page number prefix instead only supprting the page number display format
Updated to add the static cache provider service
Added the template property to the Placeholder, and support for updating templates to parameters
Stronger typing on the parameters and object parameter, and support for XML pararmeters as XPath or XNode values.
Passing any controller to the template generation so that it can be used to bind to events in templates.
Updated the data components for ForEach, With, If, Choose:When to be able to use xpath and object binding expressions on the value property.
Updated the PDFUser Component to use Params not Items
Updated the bindings and Params. Autobind on the document defaults to true.
Added the binding expressions as default in the parsing options
Fixed the query string overrides on the item native values
PDFDocument fix for remote references.


1.0.0.5

Fixes for path mapping on Mac / Unix / Windows when loading reference paths. Updated for the schema references and scrybersettings.json in the Scryber.Core.Schemas package

Added the default namespaces to the ParsingOptions, and updated version to match MVC and OpenType

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Scryber.Core:

Package Downloads
Scryber.Core.Mvc
The Mvc extensions for the Scryber.Core PDF creation engine - change the way you make documents. Scryber is an advanced PDF generation engine based around HTML templates with CSS styles and SVG drawing, or just code it. It includes full flowing pages, dynamic template binding on your object model and referenced external files, images, css and fonts. Easily create documents from your Apps, MVC sites, or Javascipt ajax calls. This framework is built entirely in .NET5 and is released under the LGPL licence so you can use to it in commercial applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
5.0.7-alpha 35 4/29/2021
5.0.6.3 135 4/9/2021
5.0.6.2-beta 32 4/7/2021
5.0.6.1-beta 45 4/6/2021
5.0.6 70 3/30/2021
5.0.5.4 80 3/30/2021
5.0.5.3-beta 131 3/13/2021
5.0.5.2-beta 67 3/12/2021
5.0.5.1 201 3/5/2021
5.0.5 101 2/26/2021
5.0.5-beta 47 2/21/2021
5.0.4 319 1/30/2021
5.0.3 127 1/18/2021
5.0.3-beta 71 1/12/2021
5.0.3-alpha 137 1/4/2021
5.0.1-alpha 111 12/30/2020
1.0.2-alpha 106 12/15/2020
1.0.1-alpha 157 9/14/2020
1.0.0.25 235 9/1/2020
1.0.0.24 352 8/18/2020
1.0.0.23 261 8/16/2020
1.0.0.5 210 6/19/2020
1.0.0.3 188 6/10/2020
1.0.0.1 211 5/23/2020
0.9.0 221 5/23/2020
Show less