Create PDF from HTML with pdfHTML
This book is 100% complete
Completed on 2017-08-30
About the Book
IMPORTANT: vouchers to get a free copy of this book will be available on the iText web site soon!
This is a step by step guide on how to use the iText 7 add-on pdfHTML.
This tutorial consists of 7 chapters:
- Chapter 1: Hello HTML to PDF: consists of a series "Hello World" examples that explain the different approaches to convert HTML to PDF with the pdfHTML add-on,
- Chapter 2: Defining Styles with CSS: explains the different approaches to use CSS to define styles for HTML... and PDF,
- Chapter 3: Generating PDF based on Media Queries: demonstrates how a single HTML file can result in different PDF documents depending on Media Queries,
- Chapter 4: Creating reports using pdfHTML: shows how data can be rendered to PDF using HTML and CSS to define the layout, and shares some best practices for creation industry-grade, future-proof reports, invoices, catalogues,... involving standards such as PDF/A and PDF/UA.
- Chapter 5: Custom tag workers and CSS appliers: reveals how you can change the inner workings of pdfHTML and how to adapt the way HTML tags and CSS styles to your own needs,
- Chapter 6: Using fonts in pdfHTML: talks about fonts, fonts, and fonts, listing the different types of fonts that are supported, how to select fonts, how to use a different encoding, and how to create international documents (with content in Russian, Greek, Hebrew, Arabic, and many other languages),
- Chapter 7: Frequently Asked Questions about pdfHTML: reuses a dozen of questions that were posted in the past about XML Worker, for which we now provide an answer using iText 7 and pdfHTML.
Chapter 1: Hello HTML to PDF
- Structure of the examples
- Converting HTML to PDF
- Converting HTML to iText objects
Chapter 2: Defining styles with CSS
- Old-fashioned HTML
- Inline CSS
- Internal CSS
- External CSS
- Using absolute positioning
- Adding “Page X of Y” using an @page rule
- Adding page breaks
Chapter 3: Generating PDF based on Media Queries
- Examining the example HTML file
- Creating a PDF file for Print
- Responsiveness in HTML
- Creating a PDF for the desktop
- Creating a PDF for a tablet
- Creating a PDF for a smartphone
- The semantic structure of a document
Chapter 4: Creating reports using pdfHTML
- Description of a use case
- Converting XML to HTML using XSLT
- Adding a background and a custom header or footer
- Converting an HTML page to a single-page PDF
- Adding bookmarks to a report
- Creating PDF/A documents with pdfHTML
Chapter 5: Custom tag workers and CSS appliers
- Changing the behavior of a tag
- Introducing custom tags
- Creating your own ITagWorker implementation
- Creating custom CSS appliers
- Implementing your own custom CSS
Chapter 6: Using fonts in pdfHTML
- Standard Type 1 fonts
- Fonts shipped with iText
- System fonts
- Web Open Font Format fonts
- Adding selected fonts to the font provider
- Choosing the right order for your font selection
- Choosing the encoding that is right for you
Chapter 7: Frequently Asked Questions about pdfHTML
- How to convert an ASP or JSP page to PDF?
- How to parse multiple HTML files into one PDF?
- Can pdfHTML render Base64 images to PDF?
- Can I generate a PDF from a URL instead of from a file on disk?
- Do we need a browser engine to render HTML+CSS to PDF
- Does my HTML have to be valid XML?
- How to add metadata to a PDF using pdfHTML?
- How do the measurement systems in HTML relate to the measurement system in PDF?
- Can I convert an HTML form to a PDF?
- How to render certain HTML entities (such as arrows) to PDF?
- Why can’t I embed a font due to licensing restrictions?
- Which languages are supported in pdfHTML?
- How to convert HTML containing Arabic/Hebrew characters to PDF?
- Why is my PDF missing several characters?
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. Free App. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.