css,itextsharp,itext,xmlworker
You forgot to define the vertical alignment of the right cell. I have adapted your HTML (table4_css.html): <table> <tr> <td> <table border="1"> <tr><td>Blah</td></tr> <tr><td>Blah</td></tr> <tr><td>Blah</td></tr> </table> </td> <td valign="top"> <table border="1"> <tr><td>Blah</td></tr> <tr><td>Blah</td></tr> </table> </td> </tr> </table> You...
java,html,parsing,itext,xmlworker
Problem solved. It was caused by my itextpdf and xmlworker being slightly different versions. This and MANY other problems were solved by getting the exact same versions (5.5.5 in my case) of both dependencies. After 2 days of banging my head to the wall rigorously I cannot stress this enough:...
java,html,fonts,itext,xmlworker
I found at least one way to do it by getting the chunks out of each element and setting the font for that chunk. ie: Font f = new Font(); f.setSize(8); for (Element e : XMLWorkerHelper.parseToElementList(sisalto, null)) { for (Chunk c : e.getChunks()) { c.setFont(f); } cell.addElement(e); } table.addCell(cell); }...
Ok, I figured this out, first - I need to completely resigned from ParseXHtml function. I used standard XMLWorker with this pipeline: PdfWriterPipeline pdf = new ElementHandlerPipeline(handler, null) Instead of default one: PdfWriterPipeline pdf = new PdfWriterPipeline(document, writer); Then I was able to iterate through elements in handler foreach (var...
itextsharp,itext,xmlworker,mvcrazortopdf
XMLWorker does not support for shorthand CSS properties in case side specific border styles. The global property "border" should be supported. It looks like a typo in the conformance list. Please use the property full names instead: <td style="... border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: gray" ...>
java,javafx-2,pdf-generation,itext,xmlworker
Ah it seems that it has to do something with using an older iText version. I've updated to iText 5.5.0 and it seems to work now. I still had to remove any <br> and <hr> tags thou. //using iText 5.5.0 and XMLWorker 5.5.0 @FXML private HTMLEditor htmlEditor; @FXML private void...
As explained in the comment section, this isn't supported yet in XML Worker. We'll add it to the next release. If you can't wait until the next release, please apply this patch: diff --git a/src/main/java/com/itextpdf/tool/xml/html/table/Table.java b/src/main/java/com/itextpdf/tool/xml/html/table/Table.java index 541818bfc9..e262b4a406 100644 --- a/src/main/java/com/itextpdf/tool/xml/html/table/Table.java +++ b/src/main/java/com/itextpdf/tool/xml/html/table/Table.java @@ -165,6 +165,19 @@ public class Table...
java,itext,flying-saucer,xmlworker
You can first parse HTML file by jsoup and then convert content to a standard HTML file, finally you can use iText to generate PDF
java,itext,right-to-left,hebrew,xmlworker
Please take a look at the ParseHtml10 example. In this example, we have take the file hebrew.html: <html> <head> <title>Hebrew text</title> </head> <body style="font-size:12.0pt; font-family:Arial"> <div dir="rtl" style="font-family: Noto Sans Hebrew">שלום עולם</div> </body> </html> And we convert it to PDF using this code: public void createPdf(String file) throws IOException, DocumentException...
It seems versions of these jars are not compatible with each other. Try below versions and let us know xmlworker-5.4.5.jar, itextpdf-5.4.5.jar
I've seen this problem before in the following context. Suppose that you have an application A with a dependency on library B. You have two jars: A-1.0.jar and B-1.0.jar. A-1.0.jar is compiled using B-1.0.jar. In version 1.0 of library B, there is a method foo() that returns void: public void...
html,pdf,itext,screen-readers,xmlworker
Please take a look at the ParseHeaders example. It takes the headers.html page with headers from <h1> to <h2> and converts it to headers.pdf: In your question, you claim that everything is working perfectly except heading levels (h1-h6), but you don't explain what isn't working. Please elaborate. As shown in...
When I run your HTML through my code, I do get an exception, because there's one sneaky error in your HTML. The first table doesn't have a closing tag: it says <table> instead of </table>. That's easily overlooked. You can find the corrected HTML here: table10.html This is what the...
c#,asp.net,c#-4.0,itextsharp,xmlworker
try this way protected void pdfExport_Click(object sender, EventArgs e) { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=AgentReport.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); pnl_export.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc);...