1. What is Html and Css
Before we begin on learning what is pdfHtml
First we have to understand what html and css is.
Does anyone know what html and css actually is?
2. What Html and CSS is not!
HTML and CSS is not a programming language!
3. What HTML is
● HTML stands for Hyper Text Markup Language
● HTML is the standard markup language for creating Web pages
● HTML describes the structure of a Web page
● HTML consists of a series of elements
● HTML elements tell the browser how to display the content
● HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc.
5. What is CSS
● CSS stands for Cascading Style Sheets
● CSS describes how HTML elements are to be displayed on screen, paper, or
in other media
● CSS saves a lot of work.It can control the layout of multiple web pages all at
once
● External stylesheets are stored in CSS files
7. What is pdfHtml?
pdfHtml is an itext addon to allow users to convert
html and css files to pdfs. (This can also be used to
convert string format html and inline styling css)
8. Workflow of PdfHtml
Our add on allows users to input their html and css files alongside their resources
from there pdfHtml will then convert their project into a pdf file output.
Depending on the complexity of their project this process is done straight forward
with simply one API call
11. What happens in the background?
There is a three step process within our converter.
12. Phase One
During Phase one the HTML is parsed into an internal document format. In
addition to creating an hierarchical tree-structure, this step also takes care of
commonly found malformed HTML, adding missing closing tags and other
common mistakes. The css-sheets are parsed into an internal style-sheet as well.
Our addon has the ability to resolve malformed html tags.
13. Phase Two
Once phase one is complete pdfHtml will then resolve the css to the
DOM(The data representation of objects). Then it will translate the html objects
Into itext objects and then apply the css properties to each itext object accordingly.
14. Phase Three final step
The final step will be for pdfHtml to write the iText objects with its styling properties
onto layout objects to properly display the new formed iText objects in their
corresponding locations within the pdf file. The layout objects will then be written
onto the pdf file.
15. Custom use cases with pdfHtml
Let's imagine a client wants to create an html file with a custom tag named <QR>
And from that specified tag he wants a QR code to appear within his pdf file.
Since there is no QR tag within html the only thing will appear is the contents
within the tag on the browser.
16. How the Tag will Appear in a normal browser
Since there is no QR tag within html the only thing will appear is the contents
within the tag on the browser.
17. Using our pdfHtml to change this behavior within the pdf
But with the functionalities within pdfHtml we are allowed to map a specified tag to
a pdf object so that tag is rendered the way the client would like changing the
behavior of the content of the html that is rendered to the pdf file.
18. Other Custom use cases
Now let’s imagine a client wants to convert some html that contains a table with
rows filled with data. But let's say the client is converting the html to a pdf
containing the table to generate a report highlighting certain rows of the table.
With a functionality in pdfHtml called custom css applieries they would be able to
modify certain css attributes of the specified rows to change the rows colors.
This can be done with any css attributes.
19. Custom use case that need another iText addon
There are times that sales representatives should suggest not only our pdfHtml
addon but also offer our pdfCalligraph alongside our pdfHtml. Many clients often
think just because their html will render arabic, hebrew and other forgien
languages on the browser this isn’t the case for pdf files generated only using
pdfHtml. To get the correct results the client must also purchase our pdfCalligraph
addon.
20. Create custom pdf files
There is also cases where users want to create custom pdf files without having to
learn a new technology. Usually companies will have a UI/UX designer where they
would be able to style a pdf file simply using HTML and CSS.
With pdfHtml addon users can Convert HTML to PDF with pdfHTML and use the
structural and semantic information from HTML to create standards - compliant
PDF documents like PDF / A, PDF / UA or Tagged PDFs.
23. Hints on when you should offer PdfCalligraph alongside pdfHtml
Usual signs of when to offer pdfCalligraph is when the company is a large
international company.
If the company is working with clients from different countries.
If the company does translation of documents
If the company is in the banking industry
24. DynamicPdf
DynamicPdf also offers an html converter
One of the strongest advantage we have over them is
That they only offer a .net solution for html conversion as where we support
Both .net and java.
Does not offer css manipulation or custom tags
Flattens all forms when converted to pdf file.
25. BFO
bfo does not fully support html conversion to pdf
their product Report Generator uses its own xml similar to xHTML. It will not
convert straight out of the box
it will require transformation of html tags.
no solution for .net
also requires SAX paser installed and running on clients systms
26. IronPdf
iron pdf does not have a java solution
no support for manipulation of tags or css