itext

Failure to read JPEG file from byte[]

半腔热情 提交于 2019-12-29 09:15:07
问题 Has anyone ever had an issue with Loading JPEG files in java? One of our clients is sending files that cannot be resolved, but these same files can be opened in windows. (the other 99% of jpeg files we recieve, process without any problems) I have tried a couple of libraries to read these: itextpdf : com.itextpdf.text.Jpeg (getInstance(imageData) - gives "java.io.IOException: Premature EOF while reading JPG." sanselan : org.apache.sanselan.ImageInfo ( Sanselan.getImageInfo(imageData) gives

Add alternative text for an image in tagged pdf (PDF/UA) using iText

蹲街弑〆低调 提交于 2019-12-29 09:09:36
问题 I've looked up some documentations and examples under the http://developers.itextpdf.com/examples. I know iText is able to generate tagged pdf from scratch, but is it possible to insert alternative text to images in an existing tagged pdf (without changing anything else)? I need to implement this feature in a program without using GUI applications (such as Adobe Acrobat Pro). Thanks. 回答1: Please take a look at the AddAltTags example. In this example, we take a PDF with images of a fox and a

Getting line locations with iText

和自甴很熟 提交于 2019-12-29 08:59:28
问题 How can one find where are lines located in a document with iText? Suppose say I have a table in a PDF document, and want to read its contents; I would like to find where exactly the cells are located. In order to do that I thought I might find the intersections of lines. 回答1: I think your only option using iText will be to parse the PDF tokens manually. Before doing that I would have a copy of the PDF spec handy. (I'm a .Net guy so I use iTextSharp but other than some capitalization

Can I use iText to merge PDF's with Permissions

此生再无相见时 提交于 2019-12-29 08:39:27
问题 I want to merge several PDF documents into one. The source documents can consist of PDFs created by me and others created by other organisations. I have no control over the permissions attached to documents not created by me. Some of these documents (those not created by me) may have permissions set. If a document requires a password to open it I do not attempt to merge it. I am using iText 5.5.1 (I think that is the latest) to create a PDFCopy object to contain the resulting document and a

How to add a cover/PDF in a existing iText document [closed]

廉价感情. 提交于 2019-12-29 08:22:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I need some help with iText. I need to add an existing pdf cover in other existing iText document or PDF document. Anybody could help me? I've searched in some books (iText in action) but it's somewhat compicated. 回答1: Suppose that we have a document named pages.pdf and that we want to add the cover hero.pdf as

How to Export JPanel with scrollable into pdf file

瘦欲@ 提交于 2019-12-29 08:14:13
问题 i have design a jpanel with so many swing components with scrollable capability. i want to export whole Jpanle into pdf file.but i am not able to export whole Jpanle. I have use itext for pdf generation. My problem is that i am not able to export whole jpanel into pdf. When i export half of Jpanel components export.but half portion do not export. this is my code. public void PrintFrameToPDF(JPanel c, File file) { try { Document d = new Document(); PdfWriter writer = PdfWriter.getInstance(d,

iTextSharp GetFieldPositions to SetSimpleColumn

牧云@^-^@ 提交于 2019-12-29 08:13:00
问题 I'm using the latest version of iTextSharp found here: http://sourceforge.net/projects/itextsharp/ I am trying to use ColumnText.SetSimpleColumn after getting the position of some AcroFields using GetFieldPositions( fieldName ). All the examples I can find show GetFieldPositions returning a float[] however this doesn't appear to be the case anymore. It now appears to be returning IList which doesn't (according to Visual Studio) implicitly convert to a float[]. Inside the return value at the 0

How to Convert a ppt file into pdf file in Java?

霸气de小男生 提交于 2019-12-29 07:19:30
问题 I want to convert an MS powerpoint (ppt) document to PDF. I searched some jars like officetools.jar , but that requires purchase. Is there any way I can convert it through itext and apache POI like we do for doc to PDF? 回答1: I am using iText and apache poi: Following is the list of imports- import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io

How to export table displayed on jsp to pdf in java strust2

吃可爱长大的小学妹 提交于 2019-12-29 07:14:08
问题 This is my data display in table format. I want to show as it is in PDF without using display tag library of struts2. <table border="1" align="center" style="border-color: #CCCCCC; border-width: 1px; border-style: None; width: 1320px; border-collapse: collapse;" id="tablepaging"> <tbody> <tr> <td>Leave ID</td> <td>FROM DATE</td> <td>TO DATE</td> <td>DAYS REQUESTED</td> <td>APPROVER</td> <td>NOTES</td> <td>REMARK</td> <td>IS PLANNED</td> <td>REASON</td> </tr> <tr> <td>270</td> <td>12/27/12</td

Does iText (any version) work on Windows Azure websites?

余生长醉 提交于 2019-12-29 06:29:50
问题 There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked. Specifically, I will be converting HTML to PDF, including all manner of styles and images. Neither rotativa nor Pechkin work on Azure App Service due to its limitations. 回答1: There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked. Based on my test with following sample, I can