itext

Remove unused image objects

旧城冷巷雨未停 提交于 2019-12-23 05:06:04
问题 I have PDF files that are being created with a composition tool to produce financial statements. The PDF files are around the 5000 - 10000 pages per file using global image resources to maximise space efficiences. These statements include marketing images. Many of them (about 3mb worth), not every particular statements uses all the images. When I extract the PDF file using a tool that has been developed for this purpose (or if I use adobe acrobat just for testing purposes) - to extract a

PDF Itextsharp printing is adding margins on right and bottom of page on print output

十年热恋 提交于 2019-12-23 04:45:06
问题 I have a PDF export function(ality) where I have the following output when the result is rendered on the page/view As you can see, the contents of the table are center aligned on the page and all seems perfect. But upon printing the contents (table) are shrinked slightly and output is pushed slightly left and slightly up, meaning there's extra space on the right and bottom of the page. This distorted output appears like this on both paper printer and document writer printing outputs. I cannot

iTextSharp acroFields.SetField method and multiple form fields with same name

落爺英雄遲暮 提交于 2019-12-23 04:43:09
问题 In case of multiple fields with same name iTextSharp acroFields.SetField(Name, Value) sets value for first field only. How to set the value for the rest of the fields? When looping thru the acroFields.Fields the field names are reported as form1[0].#subform[0].TextField1[0] - TextField form1[0].#subform[0].TextField2[0] - TextField form1[0].#subform[0].TextField2[1] - TextField form1[0].#subform[0].TextField2[2] - TextField When using acroFields.SetField("TextField1", Value); the value of

Creating Tagged PDF Document in Seam iText

我怕爱的太早我们不能终老 提交于 2019-12-23 04:26:08
问题 I am trying to create an accessible PDF using Seam and their iText implementation. I cannot find any references to whether or not this is possible. It seems that iText itself can handle it; the PDF on this example is tagged. But all of the PDFs that we create aren't and I can't seem to figure out how to add it. Here's some sample code from one of our documents: <?xml version="1.0" encoding="UTF-8"?> <p:document xmlns:p="http://jboss.com/products/seam/pdf" xmlns:ui="http://java.sun.com/jsf

How to digitally sign PDF files with XFA forms using iText

独自空忆成欢 提交于 2019-12-23 04:08:09
问题 iText release notes mention that signing of PDFs with XFA forms is supported from iText versions 5.4.2 and 5.4.3: http://itextpdf.com/history/?branch=54&node=542 http://itextpdf.com/history/?branch=54&node=543 Is there a documentation somewhere how to do the signing in Java? I am specifically interested in signing PDFs with XFA where there is a prepared field for signature. 回答1: This is a small example showing how to sign using XmlDSig: PdfReader reader =new PdfReader(src); FileOutputStream

Difference between com.lowagie.text and iText 2.1.7 JAR?

我与影子孤独终老i 提交于 2019-12-23 03:47:45
问题 First of all, this is NOT a duplicate of this question: What is the difference between lowagie and iText?  In this question, I'm only referring to the version used by both Jasper and BIRT, that is the 2.1.7. What is the difference between BIRT's com.lowagie.text-2.1.7.jar and Jasper Reports' iText-2.1.7.jar? I have been trying to integrate BIRT and Jasper Reports in my application and decide later which should I use. BIRT 4.6 uses com.lowagie.text-2.1.7.jar, while Jasper Reports 6.3 requires

iText-PdfReader: Rebuild failed: Dictionary key endstream is not a name

穿精又带淫゛_ 提交于 2019-12-23 03:28:44
问题 I am using version 5.4.4 and I have a problem with the com.itextpdf.text.pdf.PdfReader. When I read a PDF with PdfReader reader = new PdfReader(„Test.pdf"); its’s a scanned sheet and I can open it with Adobe Reader - following error occures: com.lowagie.text.exceptions.InvalidPdfException: Rebuild failed: Dictionary key endstream is not a name. at file pointer 3913220; Original message: Dictionary key endstream is not a name. at file pointer 3913220 at com.lowagie.text.pdf.PdfReader.readPdf

Combining pdfs with itext - landscape pages rendered as portrait

佐手、 提交于 2019-12-23 03:23:06
问题 I'm maintaining a legacy application that uses itext to combine multiple landscape and portrait pdfs. This process is working fine when combining pdfs produced by the same application, with other pdfs it renders landscape as portait and cuts off content. Question: Are there properties in the structure of the pdf that can cause such difference in rendering? Thanks! 回答1: The behavior you're describing only occurs if you follow bad examples. It doesn't occur when you follow the official

Faster PDF page dimensions using PDFBox?

那年仲夏 提交于 2019-12-23 03:22:52
问题 I am comparing Apache PDFBox (2.0.8) and ITextPDF (5.1.3) on Java. My use case is to find the dimensions of every page in a PDF. PDFBox is a lot slower than iText when it comes to this. While iTextPDF seems to have methods to get page's size exclusively, I was not able to find any method which would let PDFBox do the same without reading the page's content. iText : reader = new PdfReader(filepath); Rectangle psize = reader.getPageSize(pageNumber); float width = psize.getWidth(); float height

Add rectangle as inline-element with iText

泄露秘密 提交于 2019-12-23 03:22:35
问题 How do I add a rectangle (or other graphical elements) as inline-elements to an iText PDF? Example code of what I'm trying to achieve: foreach (Row r in entrylist) { p = new Paragraph(); p.IndentationLeft = 10; p.SpacingBefore = 10; p.SpacingAfter = 10; p.Add(new Rectangle(0, 0, 10, 10)); <<<<<<<<< THAT ONE FAILS p.Add(new Paragraph(r.GetString("caption"), tahoma12b)); p.Add(new Paragraph(r.GetString("description"), tahoma12)); ((Paragraph)p[1]).IndentationLeft = 10; doc.Add(p); } It's