itext

Is it possible to flush output with iText RTF (Java library) gradually? (outofmemory error)

筅森魡賤 提交于 2019-12-22 09:26:10
问题 I'm using iText to create an RTF document. It'll have a few hundred pages when completed. However, I keep getting an outofmemory error, when it's finished adding all the various paragraphs and tables to the document, and it's trying to actually create the RTF file (with document.close();) I've increased the Runtime memory with -Xmx350m, but it's not feasible to increase it anymore as the users computer won't have that much memory. Is there a way to gradually write to the RTF document, rather

Is it possible to load XMP file in PDF using iTextSharp?

陌路散爱 提交于 2019-12-22 09:20:02
问题 I am having PDF file and XMP file separately by using acrobat I am loading the XMP file in the PDF. But I want to do this process by automation, so is there is any way to load the XMP file data into PDF file using iTextSharp? Process I am using in Acrobat to load XMP file. 回答1: You can set XMP metadata in an existing PDF file using PdfStamper: PdfReader reader = new PdfReader("in.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileStream("out.pdf", FileMode.Create)); byte[] xmp; //

how to rotate pages but not the text in iText?

时间秒杀一切 提交于 2019-12-22 08:33:33
问题 I'm trying to create a PDF document with some pages in portrait and others in landscape, but seeing this example (iText7 - Page orientation and rotation) I found that the page rotates to landscape but the text also does it (PDF generated from iText7 samples), then, I need that the pages to rotate but the text continues from left to right, how in the next image. Note: I tried to use document.getPdfDocument().addNewPage(new PageSize(PageSize.A4.rotate())); but it works for one page, not for the

How to write content into pdf use iText?

与世无争的帅哥 提交于 2019-12-22 08:24:24
问题 Right now i use iText to generate a pdf automatically. And my problem is that when the content is really very large, i need to calculate the content's height and width, and then add new page... this is really very inconvinent. so I wonder whether or not there is a method like: Document.add("a very very large article"); and after this , it will auto generate a pdf file ???? Thanks in advance ! 回答1: The following creates a 9 page pdf without having to calculate height and width. import java.io

Verifying digital signatures in PDF documents

你离开我真会死。 提交于 2019-12-22 08:21:13
问题 I'm trying to verify PDF's digital signatures. I know that when a PDF is signed, a byterange is defined, the certificates get embedded, and from what i've read, the signed message digest and the timestamp are also stored in the PDF. I already can extract the certificates and validate them. Now I'm trying to validate the pdf's integrity and my problem is I don't know where the signed message digest is located. In this sample signed pdf from Adobe (http://blogs.adobe.com/security

How to make a particular sub-string Bold while printing a string in Pdf using iText in java eclipse?

瘦欲@ 提交于 2019-12-22 08:16:36
问题 I am using iText in Java to convert a HTML to PDF. I want a particular paragraph which has some words as Bold and some as Bold+Underlined to be passed as a string to the Java code and to be converted to PDF using the iText library. I am unable to find a suitable method for this. How should I do this? 回答1: If you want to convert XHTML to PDF, you need iText + XML Worker. You can find a number of examples here: http://itextpdf.com/sandbox/xmlworker The most simple examples looks like this:

ExceptionConverter: java.io.IOException: The document has no pages. am using iText

ε祈祈猫儿з 提交于 2019-12-22 05:55:21
问题 when i execute the below code File f = new File("c:/sample.pdf"); PdfWriter.getInstance(document, new FileOutputStream(f)); document.open(); System.out.println("opening the document.."); PdfPTable headerTable=new PdfPTable(9); PdfPCell cellValue = new PdfPCell(new Paragraph("Header 1")); cellValue.setColspan(1); headerTable.addCell(cellValue); cellValue = new PdfPCell(new Paragraph("Header 2")); headerTable.addCell(cellValue); cellValue = new PdfPCell(new Paragraph("Header 3")); headerTable

ExceptionConverter: java.io.IOException: The document has no pages. am using iText

孤街浪徒 提交于 2019-12-22 05:55:20
问题 when i execute the below code File f = new File("c:/sample.pdf"); PdfWriter.getInstance(document, new FileOutputStream(f)); document.open(); System.out.println("opening the document.."); PdfPTable headerTable=new PdfPTable(9); PdfPCell cellValue = new PdfPCell(new Paragraph("Header 1")); cellValue.setColspan(1); headerTable.addCell(cellValue); cellValue = new PdfPCell(new Paragraph("Header 2")); headerTable.addCell(cellValue); cellValue = new PdfPCell(new Paragraph("Header 3")); headerTable

How to add Content to a PDF using iText PdfStamper

天大地大妈咪最大 提交于 2019-12-22 04:48:07
问题 I'm developing a System in which I have to add some images to an existing PDF Document. This works great with iText 5.1.3, but for some reason in a PDF that contains a scanned image it won't add any of the images. Here's the link to the PDF Document that can't be modified with PdfStamper and here's the code PdfReader reader = new PdfReader("Registro celular_OR.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("DocStamped.pdf")); Image img = Image.getInstance("someImage

Attach hidden (biometric) data to a digital signature on a pdf

五迷三道 提交于 2019-12-22 04:29:20
问题 I'm wondering if it is possible, using iText (that I used for signing) or other tools in Java, to add biometric data on a pdf. I'll explain better: while signing on a sign tablet, I collect signature information like pen pressure, signing speed and so on. I'd like to store those informations (variables in java) togheter with the signature on the pdf. Obviously hidden and encrypted such as the signatures info. Is there some kind of hidden data field on a pdf or something that can contain this