xmlworker

java generate pdf file from string with arabic character and html Content

馋奶兔 提交于 2019-12-25 03:29:15
问题 I want to generate pdf file from string with arabic character and html Content . I used itextpdf-5.5.6.jar and xmlworker-5.5.6.jar . I try with this code : import java.io.ByteArrayInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf

ASP.NET Compiler errors with iTextSharp xmlworkerhelper

一世执手 提交于 2019-12-25 01:43:46
问题 I'm trying to write an application that will fire off a series of web reports that I've built in ASP.NET. So I have a web application where the pages live, but I don't really want to use the website to see the pages, I want to create PDFs that I can deliver to my clients. The application I'm trying to write is a console app, written in Visual Studio 2010 in c# and using iTextSharp v5.5.2 and .NET 4.5. It's currently just a framework as I haven't got to the "firing off PDFs" part yet. I'm

c# iTextsharp generated PDF with xmlworker is breaking Lists

人盡茶涼 提交于 2019-12-24 19:06:38
问题 I am using iTextsharp library with XmlWorker version 5.5.12.0, and facing problems with list is enclosed with DIV. <body> <span> <ul> <ul> <li>Project Management <ul> <li> <a class="jwiki-small" data-containerid="2544" data-containertype="14" data-objectid="14695" data-objecttype="102" href="https://SampleUrl.com/DOC-146">Sample Text</a> </li> </ul> </li> </ul> </ul> </span> </body> and the pdf looks correct like the image below. But Formatting problems start once List is enclosed in a Div at

Why is my PDF being generated as blank?

吃可爱长大的小学妹 提交于 2019-12-23 20:12:38
问题 I am using ItextSharp and c#, asp.net MVC to generate a PDF report. However, when I generate the report the PDF comes back as blank (apart from a header which is working fine). I would love your input. The code that generates the report is as follows: using (var writer = PdfWriter.GetInstance(doc, ms)) { // This sorts out the Header and Footer parts. var headerFooter = new ReportHeaderFooter(reportsAccessor); writer.PageEvent = headerFooter; var rootPath = ConfigurationManager.AppSettings[

iTextSharp creates PDF with blank pages

我的梦境 提交于 2019-12-21 04:29:11
问题 I've just added the iTextSharp XMLWorker nuget package (and its dependencies) to my project and I'm trying to convert the HTML from a string into a PDF file, even though no exceptions are being thrown, the PDF file is being generated with two blank pages. Why? The previous version of the code was using just iTextSharp 5.5.8.0 with HTMLWorker and ParseList method, then I switched to Here is the code I'm using: public void ExportToPdf() { string htmlString = ""; Document document = new Document

how can I add cellspacing to pdftable when parsing html using XMLWorker and itext

不问归期 提交于 2019-12-20 07:16:52
问题 I am using XMLWorker and itext to convert html to pdf . my html have a table and I need to set it's cellspacing =0 cellpadding=0 . does anyone know how to do it ? in html I saw I can replace it by setting the style : border-collapse: collapse; border-spacing: 0px ; border : 0; padding : 0; thanks Tami 回答1: I've tried what you're doing using the CSS you propose and it works for me: You can find my test here: ParseHtmlTable5 This is my HTML (including the CSS): table3_css.html <html> <head>

place text next to image html to pdf using itextsharp

北慕城南 提交于 2019-12-18 07:03:40
问题 I am converting html to pdf using itextsharp. I have to place text next to the image not below the image. In html I am able to place text next to image but in pdf the text line starts after image Please help. 回答1: Since you mention HTML, you understand block and inline display, right? By analogy, iTextSharp's default Image display is block . To inline Image objects you need to: Add images to Chunk object(s) Add text in Phrase object(s) Then add those object to a Paragraph object Something

HTML String is not parsed with iText XML parser

人盡茶涼 提交于 2019-12-13 10:32:56
问题 I am unable to parse below HTML string using iText's xmlworker-5.5.9.jar String FOOTER = "<table width=\"100%\" border=\"0\"><tr><td><span class=\"bold\">Footer</span></td><td align=\"right\">Some title</td></tr></table>"; by below helper class: XMLWorkerHelper.parseToElementList(FOOTER, CSS); I am getting below error: Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.tool.xml.html.pdfelement.NoNewLineParagraph.setMultipliedLeading(F)V I saw iText's documentatin and answer

how to rotate pages into landscape and page content should be in portrait iTextpdf

北战南征 提交于 2019-12-12 14:36:47
问题 I'm trying to create a PDF document with more than 2 pages in portrait and others in landscape, I found that both page and text rotates to landscape I need to prevent page content rotation. am using following code Document document = new Document(PageSize.A4, 36, 36, 36, 72); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(outPutDirectory + indexID + ".pdf")); writer.setPageEvent(new Orientation(orientation)); document.open(); XMLWorkerHelper.getInstance().parseXHtml

How do I convert malformed HTML to PDF with iText and XMLWorker?

别等时光非礼了梦想. 提交于 2019-12-12 04:33:17
问题 I am trying to convert HTML(with external CSS) into PDF using Itext XMLWorkerHelper, am facing the run-time exception whenever XMLWorkerHelper parses a malformed HTML. For example: The html below has input tag not closed : and XMLWorkerHelper cannot parse and throws run-time exception. if i try with proper HTML input tag enclosed,it works fine. How can i convert malformed or complex HTML (along with css) to PDF using Itext. below is my code: var test_html = File.ReadAllText("C:/Desking _