DynamicPDF ToolkitOne™ RAD Edition Overview (Part 1)

Wed, June 20 2018, 10:34 AM (US Eastern Time)

DynamicPDF is excited to release the RAD Edition of ToolkitOne™. Unlike our PRO Edition of ToolkitOne™ that shares many of the features of our Core Suite in an updated, cross platform API, we focused this product enhancement on rapid application development (hence the name). We also refer to this as rapid PDF development since it is designed to get the PDFs your users need to them in a fast and efficient way. These include:

  • Rapid PDF development using DynamicPDF Designer (ToolkitOne™ Edition)
  • Rapid PDF development using HTML and CSS
  • Creating PDFs from multiple PDFs (merging)

Today, we'll take a look at (1) creating PDFs using HTML and CSS and (2) creating PDFs from multiple PDFs. Be sure to check back on this blog for our discussion (in Part 2) on creating PDFs using DLEX templates from Designer.

Creating PDFs from HTML and CSS

A powerful feature of the RAD edition is its ability to quickly create PDFs using HTML. If you are already delivering reports to your users in HTML, you can quickly and easily use the same processes to create PDFs utilizing the HtmlLayout class. This class takes your HTML, allows you to set headers and footers and returns a paginated Document class. Let's take a look at these elements separately.

The HtmlLayout constructor establishes the HTML to use along with the dimensions of the page through a PageInfo class. Using the PageInfo class you can specify a page size and orientation or use a page from an existing PDF as a background template. A base ref can also be set through the constructor when needed:

Uri htmlSource = new Uri(@"C:\MyHTMLReport.html");
HtmlLayout htmlLayout = new HtmlLayout(htmlSource, new PageInfo(PageSize.Letter, PageOrientation.Portrait));

You can then quickly set left, center, and/or right justify headers and footers on your layout using the header and footer properties. The headers and footers share the same style information as the HTML so they will have the identical appearance. A span tag can also be used to select a CSS class or change the style. Setting the HasPageNumbers property to true, will cause the header or footer element to be parsed for page numbering info (e.g. "Page 1 or 3"):

htmlLayout.Header.Left.Text = "My PDF Report";
htmlLayout.Header.Right.Text = "Report for my User";
htmlLayout.Footer.Center.Text = "Page %%CP%% of %%TP%%";
htmlLayout.Footer.Center.HasPageNumbers = true;

Once everything is all set, simply call the Layout method to return a Document object containing the HTML laid out over as many pages as needed. You can then save it or work with it as you would any other Document object:

Document document = htmlLayout.Layout();
Creating PDFs from Multiple PDFs (Merging)

Merging PDFs together is also a simplified process. If you'd like to simply merge two PDFs together, you can use the Document class's static Merge method:

Document document = Document.Merge(@"C:\MyFirstPDF.pdf", @"C:\MySecondPDF.pdf");

You can also append PDFs to an existing Document object, or take the Document object you created using HTML above and append PDFs to it:

Uri htmlSource = new Uri(@"C:\MyHTMLReport.html");
HtmlLayout htmlLayout = new HtmlLayout(htmlSource, new PageInfo(PageSize.Letter, PageOrientation.Portrait));
Document document = htmlLayout.Layout();
document.Append(@"C:\MySecondPDFToAppend.pdf", 1, 3);
Wrap Up

We've seen how easy it is to create PDFs using HTML and merge PDFs together using the DynamicPDF ToolkitOne™ RAD Edition. The object model is very flexible and there are of course many other more advanced features like creating PDFs in memory, using HTML from a URL, and disk buffering, all of which is covered in our help docs. Please check back for Part 2 of this post, where we'll explore rapid PDF development using Designer templates (DLEXs) and your business objects.

Tags: , , , , , , , , , ,

ToolkitOne™ 2018 Beta Release

Fri, April 20 2018, 12:29 PM (US Eastern Time)

Please join us in the BETA testing of our new product: ToolkitOne 2018

DynamicPDF ToolkitOne 2018 Beta

ToolkitOne combines lots of the PDF functionality that DynamicPDF has come to be known for including PDF merging, easy PDF creation, tons of page elements and features, super-efficient output in a well-designed simple API and it is built on .NET Standard 2.0 so there is seamless, cross-platform deployment to any .NET implementation including .NET Core, .NET Framework, Mono, UWP, Xamarin.iOS and Xamarin.Android.

We are available for any questions or issues related to the BETA via email support@cete.com or phone 410.772.8620.

Thanks for everyone’s involvement!

Tags: , , , , , , , , , ,

Month List