Background Color:
 
Background Pattern:
Reset
Search
Home Recent Changes Show All Pages

Scryber How To Wiki

5

Looking for help on Scryber? You  have come to the right place.
This Wiki is where we add all our code samples and help on using the Scryber PDF Generator.

 

Documentation contents

 

First steps

If you are new to Scryber then you can watch the Hello World video, as a 5 minute quick start to installing and generating PDF documents, then read the CodeProject Rss feed page to begin creating your first data bound PDF documents

 

For users of .NET 4.0+, the easiest way is to search for 'Scryber' from Extensions and Updates and install directly within Visual Studio.
More details on the package and deployment is available here..VSIX Deployment and Nuget Package

 

For users of .NET 3.5, visual studio 2010, you can download the installer from http://scryber.codeplex.com. We are no longer supporting the use of the installer or .NET 3.5, but it is retained for reference.

 

Learning Scryber

Once you are all installed and running, there are lots of things you can do.

We are slowly building up a library of documentation. And the first few pages are here to help

The Document and its Pages
The top level document options, and how they affect the output
Pages and Sections
All the visible content in a pdf document sits on pages - but what are the differences with pages and sections, and what about headers and footers?
Component Basics
What is a component in relation to the scryber library, and how are they organised in code
Positioning and Flow
When content is added to a document, how can we know where it will appear, and how is that controlled
Column Layout
Columns can be used at a page level, but also within a block component such as a panel or div to allow content to flow in 1,2,3 or more columns
References and Component Re-use
Using references to other content such as stylesheets and pages for reuse and consistency
Document Processing
Once the content is in the template what happens to generate the complete final pdf document
Generation Options
How to output a document to different places, including the file system; a web response, or a binary stream.

 

Available Components

These are in-depth articles on individual components (or related groups of components), that will give you a greater understanding of the capabilities of each.

Panel, Div, Para, Pre, Span
These are all containers of other components. They each have specific characteristics, driven from their base styles
Labels and inline text
The standard textual content of a document is contained within labels and inline text. This is rendered flowing along lines within the boundaries of its container
Table, Row, Cell
A structured and formal grid layout.
Ordered and Unordered Lists
A structured layout with sequential numbering or bullets.
Headings, H1 - H6
All the headings and the styles they use when rendering textual content
Numbers and Dates
A way to generate numeric and date values in a pdf file with support for cultural and expicit formatting
Link
A multi-faceted link to internal components or external documents
Image
An explicit image within the document flow (as opposed to a background image applied via styles). Also covers positioning and flow of images, along with dynamic assignment.
PageNumber and PageOf
Display of the current page number, or the page of a specific component

Styling components

Styling content in a PDF document is a core capability of Scryber

Understanding Styles
How styles can be applied to components, and how are they built to a complete description of the component
Units and measurement
The position and size of a component on a page is specified in units, and these units allow both a number value and a scale
Repeating Background and Fill images
Using images in documents is not limited to the Image component. The Background and fill styles allow for fine grained inclusion of (repeating) images as part of components fills and backgrounds
Fonts and font file embedding
scryber makes working with fonts and their files easy. Understand how these are embedded within a final document and how the characters are referenced

 

Out of the box Style Items

Background Style Item
Defines the background colors and images along with repeating options for a block component. If the component is inline this has no effect.
Border Style Item
Defines the border around a block component. The class inherits from PDFStrokeStyle but defines 2 new properties for the corner radius and sides enumeration.
Columns Style Item
Defines the columnar layout of a block. Has no impact on inline elements or non container elements.
Fill Style Item
Defines all the color and image fill options for a shape, text or other component.
Font Style Item
Defines the characteristics of the current font used for rendering and measuring text. As this style item is inherited all inner text components will use the font and style specified unless they have their own values.
List Style Item
Lists are sequential groups of items arranged vertically on the page. The styling options define the characteristics, appearance and numbering of lists and items in the list. 
Margins Style Item
Specifies the margins around a block components. If there is an explicit size to the block, then the margins increase the overall size.
Outline Style Item
Defines all the style options for the document outline tree. Not all PDF Readers support the color and font options, but they are there for completeness.
Overflow Style Item
Defines the options for how a page or component overflows. By default components do not overflow. The overflow style allows the adjustment of how content is handled when the boundaries of its container are hit
Overlay-Grid Style Item
The overlay grid is a useful positioning and layout aid, but is generally not required for final presentation.
Padding Style Item
Specifies the padding within a block components. If there is an explicit size to the block, then the padding will reduce the available content size.
Page Style Item
The page style defines the options for the layout and numbering of a document page. This also applies to section pages, and all pages within a section must have the same layout.
Position Style Item
The position style item defines how components should be laid-out on pages. Most components support all the attributes within this item.
Scryber Badge Style Item
The badge style allows unregistered users to adjust the appearance of the badge that is generated on a page.
Stroke Style Item
The stroke defines the path appearance around both textual and graphic components.
Table Style Item
The style options for the layout of a table and it cells
Text Style Item
The text style defines how text characters should be positioned. The values are specific to text.

 

Data binding

Static content is all very well, but it is just that - static. A key architectural feature of scryber is its support for data binding. Every attribute and component is bindable, and the use of templates, transformations and choices extends this to runtime decision making.

Part 1. Data binding and XPath selectors
Covers the basic data binding process, binding to a simple xml file with a single namespace and generating a table of results
Part 2. Multiple Namespaces and Transformations
Extends the example to apply a transformation on the data in another new namespace
Part 3. Choices and Conditions
Uses conditional formatting to alter the output based on simple xpath decision components
Part 4. Transform Parameters
Applies arguments to the Transformations to alter the output both declarative and dynamic.
Part 5. Assigning Dynamic Data
Assigning the data dynamically to an XMLDataSource
Item and Query String Binding
Scryber supports not just the XPath bindings but also 2 special bindings for the document Items collection, and query string parameters

 

Extending Scryber

Scryber is extremely extensible and these guides will take you through how the parser works, and then how to write your own components to generate output.

Scryber Configuration

An Introduction to the XML Parser

Writing your own components

Custom Complex Binding Component

 

More....?

For the moment you will have to bear with us whilst we document the rest, and rely on your own exploration techniques.

Most of the capabilities are driven from the XML files, and are hopefull quite simple to follow.

If you do have specific questions, then please ask in the forum and responses will be forthcoming.

And do remember that it's currently Beta.

Happy coding. We hope you enjoy it.



  Rating
Rate This Page: Poor Great   |  Rate Content |
Average rating:  5   
00005
12345
Number of Ratings : 5
  Comments
Add Comment
No Comments Yet