In this topic we present the 3 sub assets of AltSDK that allows you to easy create professional Views/Reports and export these content to PDF or RTF files (to memory streams or dirrectly to file system). Also you can operate with PDF files in different ways: create, modify, concat, divide, etc. All these features available both for new Unity UI (uGUI) and NGUI developers. Just use it as any other visual controls. Also these features can be used without any GUI.
These 3 solutions are:
- HTML Renderer
- MigraDoc [Coming Soon]
Let's view some dipper on these fine tools that was ported and adapted to AltSDK.
HTML Renderer is a multipurpose and high performance HTML interactive solution that provides text selection, link clicked events, scrolling, auto layout, PDF export, etc.
Features and Benefits
- Extensive HTML 4.01 and CSS level 2 specifications support
- Support separating CSS from HTML by loading stylesheet code separately
- Support text selection, copy-paste and context menu
- AltGUI controls: HtmlPanel, HtmlLabel and HtmlToolTip
- Create images/PDFs from HTML snippets
- Handles "real world" malformed HTML, it doesn't have to be XHTML
- 100% managed code and no external dependencies
- High performance and low memory footprint
- Extendable and configurable
- HtmlPanel - The full power of HTML control build to replace WebBrowser control, accepts HTML, text selection, scrollbars, link click intercept, image load intercept and much more
- HtmlLabel - As AltGUI label but accepts HTML, text selection, auto-size capabilities, transparent background and more
- HtmlToolTip - As AltGUI ToolTip control but accepts HTML and ability to handle links
- Render HTML content generated by rich web editors like forums, blogs, etc.
- Render Office documents converted to HTML
- Create UI that requires text selection with clipboard support
- Create images from HTML code snippets (Image generation)
- Create PDF document from HTML code snippets
You can play with HTML Renderer on AltSoftLab with Web Demo
PDFsharp is a widely used.NET library for processing PDF file. You create PDF pages using drawing routines known from AltSketch. Almost anything that can be done with AltSketch will also work with PDFsharp. Only basic text layout is supported by PDFsharp, and page breaks are not created automatically. The same drawing routines can be used for screen or PDF.
The same drawing routines can be used to create PDF documents or draw on the screen. It includes support for Unicode in PDF files.
- Creates PDF documents on the fly from any .NET language
- Easy to understand object model to compose documents
- Modify, merge, and split existing PDF files
- Images with transparency (color mask, monochrome mask, alpha mask)
- Newly designed from scratch and written entirely in C#
- The graphical classes go well with .NET
MigraDoc is a document generator. It supports almost anything you find in any good word processor. You just add paragraphs, tables, charts, arrange all this in sections, use bookmarks to create links, tables of contents, indexes, etc. MigraDoc will do the layout creating page breaks as needed. MigraDoc will create PDF, XPS, or RTF documents.
- Create perfect documents “on the fly”
- Import data from various sources via XML files or direct interfaces (any data source that can be used with .NET)
- Supports different output formats (PDF, Word, HTML, any printer supported by Windows)
- Integrates easily with existing applications and systems
- Various options for page layout, text formatting, and document design
- Dynamic tables and business charts
- Re-usable building blocks consisting of text and / or code
- Documents with navigation (hyperlinks and / or bookmarks)
Use PDFsharp or MigraDoc?
- Use PDFsharp if you want to create PDF files only, but be able to control every pixel and every line that is drawn
- Use MigraDoc if you need documents as PDF and RTF files and if you want to enjoy the comfort of a word processor
Mixing PDFsharp and MigraDoc
If MigraDoc does almost anything you need, then you can use MigraDoc to create PDF files and post-process them with PDFsharp to add some extra features.
Or use PDFsharp to create the document but use MigraDoc to create individual pages. This could be the best choice if your application uses lots of graphics, but also needs some layouted text.
AltSDK Social Links:
AltSDK Unity UI Integration - HTML Panel
AltSketch NeoAxis HTML Renderer
HTML Renderer - Text
HTML Renderer - Using the Code
HTML Renderer - Tables
HTML Renderer - Non Standart Features
MigraDoc - Paragraph Layout
MigraDoc - Borders and Shading
MigraDoc - Tables
MigraDoc - Combining Paragraphs
MigraDoc - Chart
AltSketch Unity PDFsharp