-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify API for creating PDF #277
Conversation
…enerate PDF from HTML This commits adds 2 new apis: 1. class Html2Pdf (a single method for generating PDF from HTML) 2. renderer.createPDF(doc, os) (instead of old sequence `setDocument`, `layout`, `createPDF`)
This comment was marked as outdated.
This comment was marked as outdated.
@andreasrosdal Yes, generally we could add some validation/html cleanup. |
How about using Jsoup to fix invalid XHTML? In general I agree that regular expressions should not be used to fix bad HTML. However, we could use something, and at least regular expressions is one of the possible alternatives. Jsoup is probably better. |
@andreasrosdal Yes, JSoup sounds good. |
@andreasrosdal Thank you for the samples. Some of these could be really replaced automatically (e.g. |
I wish that FS would handle these cases, and not throw exception, in the same way that Firefox and Chrome is fault tolerant for invalid HTML in many cases. |
now user needs to write less code to generate PDF from HTML
This commits adds 2 new apis:
setDocument
,layout
,createPDF
)The work continues...