itext

Why I can't obtain rounded table corners in this iText\iTextSharp footer table?

拟墨画扇 提交于 2019-12-24 14:13:11
问题 I have the following situation: I have to create a round corner table into the footer of my PDF using iTextSharp but I am finding some difficulties to do it. First of all I have create a class named PdfHeaderFooter that extends the PdfPageEventHelper iTextSharp interface. In this class I have implemented the OnEndPage() method that create the footer on the end of all pages, this is my code: // Write on end of each page public override void OnEndPage(PdfWriter writer, Document document) { base

Convert HTML to Excel document using iText C# [closed]

余生长醉 提交于 2019-12-24 13:58:02
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 10 months ago . Is there is a way to convert HTML file to Excel using iText 7? If the iText doesn't support, what is the the best way to convert HTML file to Excel? Thanks sample HTML code as below: <h1>Test</h1> <p>Hello World</p> 回答1: As far as I know iText makes PDF files. You won't be able

Why is my font not applied when I create a PDF document?

戏子无情 提交于 2019-12-24 13:52:38
问题 I am generating PDF documents with iText. When I try to include the "Agenda Tabular Light" font, iText ignores my choice of font. I confirmed that the font isn't set using Adobe Reader's File > Properties > Fonts . The PDF shows that Helvetica was used, but I didn't choose Helvetica. The colors are visible, but not the font. My code looks like this: public static final Font FONT_HEADER = FontFactory.getFont(AGENDA_TABULAR_LIGHT, 18, Font.NORMAL, TITLE_COLOR); I even I tried a sample program.

Adding itextg to gradle

只谈情不闲聊 提交于 2019-12-24 13:25:45
问题 I want to add itextg via gradle to avoid having to maintain a set of library jars. Maybe it's me but I can't find the correct gradle compile statement anywhere. dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:20.0.0' compile 'com.google.code.gson:gson:2.3.1' compile 'com.itextg:itextg:5.4.3' } Regular itext works just fine but I'm trying to do stuff with images. compile 'com.itextpdf:itextpdf-5.5.6' 回答1: I think that's because we

iText - read PDFs created with an unknown random owner password

坚强是说给别人听的谎言 提交于 2019-12-24 12:23:43
问题 I'm getting the following exception when excecuting this code: public byte[] watermarking(byte[] orig) throws IOException { PdfReader pdfReader = new PdfReader(orig); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfStamper pdfStamper = null; try { pdfStamper = new PdfStamper(pdfReader, baos); //exc here ... } ... } catch (DocumentException var8) { ... } } Exception: 11:43:11,094 ERROR [de.mlp.xbg.pa.rest.SessionRR] (http-/127.0.0.1:8081-6) PdfReader not opened with owner password

How to rename a PDF form field when the field name contains a period using iTextSharp

时光怂恿深爱的人放手 提交于 2019-12-24 12:08:21
问题 I use iTextSharp to rename PDF form field. The old field names and the new replacement names are entered in a text box (comma separated). My code then loops through each line, grabs the old field name, looks for the field in the PDF and renames it to the new field. Finally, a new PDF is created from the old PDF, and all of the fields in the new PDF will have the new names. My problem is that I can't seem to rename the PDF fields which contain a period in the field name (e.g. First.Name). Is

Changing signature appearance after signing pdf file with iTextSharp

こ雲淡風輕ζ 提交于 2019-12-24 11:52:06
问题 I'm writing a service where I pre-sign a pdf file with an empty container, take a hash of a byte range from the pdf file and send it to another service, that will allow a user to sign the hash using a mobile phone. I get back a certificate that I will inject into the signature container in the pre-signed pdf file. Everything works so far, except that I want to have visible signatures in the document. The visible signatures require the certificate to get information from it (like who signed it

Printing created iText pdf file by ByteArrayOutputStream

二次信任 提交于 2019-12-24 11:28:40
问题 I coded for creating iText PDF file in the memory by ByteArrayOutputStream by click of a button. Then coded to print that PDF file when click of that same button same time. Below is my code for the specific button; private void ok_btnActionPerformed(java.awt.event.ActionEvent evt) { try{ String saledate = ((JTextField)dayChooser.getDateEditor().getUiComponent()).getText(); String invoice = InvoiceNo_txt.getText(); String citems = countitems_txt.getText(); String tDis =totalDiscount_txt

Merge multiple images in a PDF file

扶醉桌前 提交于 2019-12-24 11:26:46
问题 I'm trying to merge multiple images in a directory in a single PDF file. I've built an example code from the itext site, however the problem is that images are not added correctly to the PDF, just the border of each image is visible on the right: private void generateMultiPageTiff(String path) throws Exception { Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream( "C:\\Users\\Desktop\\out.pdf")); document.open(); Paragraph p = new Paragraph(); File files[]

How to Add a link to a PDF with ColdFusion and iText

醉酒当歌 提交于 2019-12-24 11:25:12
问题 I used this technique to insert an image Adding a dynamic image to a PDF using ColdFusion and iText Now, I need to insert a link to a external URL at X/Y and text inside with itext and ColdFusion. Can someone help me do this? Thanks. 回答1: Here is rough example that works with CF9. There are probably more elegant methods, but this should give you the basic idea. Note - IIRC CF8 uses an earlier version of iText (1.4). CF9 uses 2.1.0. So I am relatively certain it will not run "as is" with CF8.