itext

How to underline text with a dotted line?

这一生的挚爱 提交于 2019-12-24 08:49:44
问题 I need to merge 2 paragraphs, the first is a sequence of dots, and the second is the text that I want write on dots: Paragraph pdots1 = new Paragraph("......................................................................................................................",font10); Paragraph pnote= new Paragraph("Some text on the dots", font10); I tried to play with: pnote.setExtraParagraphSpace(-15); But this mess up the next paragraphs. I tried too with this: itext positioning text absolutely

Offline PDF timestamping using iText

自作多情 提交于 2019-12-24 08:38:27
问题 is it possible to timestamp PDF document offline using iText or any other component? I've googled standard solution utilizing iText and TSAClient class but it requires TSA as online service. We have certificate from TSA (including private key) whose purpose is to create timestamp signatures but I can't find any technical way how to do it with iText. Thanks for any guidance. Richmond 回答1: I've googled standard solution utilizing iText and TSAClient class but it requires TSA as online service.

Merging N pdf files, created from html using ITextSharp, to another blank pdf file

混江龙づ霸主 提交于 2019-12-24 08:25:45
问题 I need to merge N PDF files into one. I create a blank file first byte[] pdfBytes = null; var ms = new MemoryStream(); var doc = new iTextSharp.text.Document(); var cWriter = new PdfCopy(doc, ms); Later I cycle through html strings array foreach (NBElement htmlString in someElement.Children()) { byte[] msTempDoc = getPdfDocFrom(htmlString.GetString(), cssString.GetString()); addPagesToPdf(cWriter, msTempDoc); } In getPdfDocFrom I create pdf file using XMLWorkerHelper and return it as byte

get hash from pdf with iText 2.1.7 or Digital Signature Service

♀尐吖头ヾ 提交于 2019-12-24 07:59:19
问题 I'm migrating a project from iText 5 to iText 2/or DSS (https://ec.europa.eu/cefdigital/wiki/display/CEFDIGITAL/eSignature.) Due to the difference between iText versions (DSS use iText 2.17) i can't get a proper signed hash. Here the code migrated from itex 5 : // We get the self-signed certificate from the client CertificateFactory factory = CertificateFactory.getInstance("X.509"); Certificate[] chain = new Certificate[1]; chain[0] = factory.generateCertificate(new ByteArrayInputStream

iText 7 column widths why do these not fit?

折月煮酒 提交于 2019-12-24 07:56:27
问题 I am brand new to iText and leaped straight into iText 7, but find setting column widths on my table to be ridiculously challenging. Clearly there is something basic I'm not getting. In combing the web for answers, I found some itext 5-based answers that don't seem to be relevant to itext 7 (hard-coding a fixed width). The iText 7 stuff seems to assume knowledge I don't have! "relative column widths" -- what does that mean? should the numbers add up to 100? Simple examples with 2 or 4 columns

Signed PDF showing message “The validity of the document is unknown”, iText

这一生的挚爱 提交于 2019-12-24 07:55:05
问题 I am using iText to apply digital signatures in PDF. The digitally signed PDF is showing message like "the validity of the document certification is unknown. The author could not be verified.At least one signature has problems." at the top. When I add the certificate to my trust identities which is used to create signed PDF, then the generated signed PDF shows "Signed and all signatures are valid". Is it possible to fix this by without adding certificate to trusted identities? Thanks in

iTextSharp 7 object reference not set to an instance of an object

被刻印的时光 ゝ 提交于 2019-12-24 07:51:12
问题 Is there some recommendation to build tables with cells having paragraphs in order to avoid an exception at adding of some cell to table or table to document? I get this and I can't figure out what happens: [NullReferenceException: Object reference not set to an instance of an object.] iText.Layout.Renderer.TableRenderer.DrawBorders(DrawContext drawContext) +2493 iText.Layout.Renderer.TableRenderer.DrawChildren(DrawContext drawContext) +1497 iText.Layout.Renderer.AbstractRenderer.Draw

Identify and extract table from pdf using java

依然范特西╮ 提交于 2019-12-24 07:49:37
问题 I have different types of pdf which contain multiple things like text, table etc. The table may exist any place of pdf(top, middle, bottom). I want to extract only table data(No. of the column, no. of rows & data in a table) from that pdf using java without passing location. What I have done till yet:- 1. I have used iText java API to read and extract. Following code used:- PdfTextExtractor.getTextFromPage but It is only returning data in form of text. Didn't get any clue to identify where

Missing images when converting HTML to PDF by iText ver 5 using XMLWorker

邮差的信 提交于 2019-12-24 07:47:44
问题 I am trying to convert HTML to PDF using itextpdf 5.5.6. And the images like next are not exported. <img alt="" src="http://localhost:8080/images/logo.jpg" style="height:53px; width:161px" /> Here is the source code I'm using. InputStream is = new ByteArrayInputStream(bytes); InputStream resourceInputStream = servletContext.getResourceAsStream("/css/doc_template.css"); if (resourceInputStream != null){ XMLWorkerHelper.getInstance().parseXHtml(writer, document, is, resourceInputStream, Charset

iText 5.5.0 with XDocReport 1.0.4

♀尐吖头ヾ 提交于 2019-12-24 07:29:29
问题 Can I use iText version 5.5.0 jar with XDocReort 1.0.4? Are they compatible? All the sample projects provided at https://code.google.com/p/xdocreport/downloads/list, seem to be using itext-2.1.7.jar. Is there any specific reason behind that? 回答1: XDocReport provides converters docx->pdf and odt->pdf based on iText 2.1.7 which is LGPL license although iText 5.5.0 provides a supported version under AGPL license. XDocReport is based on iText 2.1.7 for license reason . Perhaps it will be easy to