itext

Not able to run simple program of iText library in android

孤人 提交于 2019-12-20 04:16:45
问题 I want to run a simple iText program, here is my code: http://pastebin.com/C6YMkYNk It is working fine with Java but not in Android. I am using iText version 5.1.3. My code doesn't show any errors but also doesn't show a PDF file. Can anyone suggest what I need to do to solve my problem? 回答1: Try this: FileOutputStream fOut = openFileOutput("a.pdf", MODE_WORLD_READABLE); PdfWriter.getInstance(document, fOut); You cant just start writing to the working directory. You have to store it on the

How to rotate around the image center by itext?

落花浮王杯 提交于 2019-12-20 04:11:44
问题 double degPi = degrees * Math.PI / 180; double a = Math.cos(degPi)*tImgCover.getScaledHeight(); double b = Math.sin(degPi)*tImgCover.getScaledWidth(); double c = -Math.sin(degPi) * tImgCover.getScaledHeight(); double d = Math.cos(degPi)* tImgCover.getScaledWidth(); double e = absX; double f = absY; contentByte.addImage(imgae, a, b, c, d, e, f);/*add image*/ How to rotate around the image center by itext? 回答1: If we have an Image image and coordinates x, y , we can draw the image without

Question on Java Servlet to open a PDF file using iText

时光毁灭记忆、已成空白 提交于 2019-12-20 03:50:47
问题 The code below grabs a PDF file and displays it in the browser. import java.io.ByteArrayOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet

Exception when converting tiff file to pdf file with iText

泪湿孤枕 提交于 2019-12-20 02:47:06
问题 When I try to convert a tiff file to pdf file by using itextpdf 5.5.5 , the following exception occurs: java.lang.RuntimeException: Scanline must begin with EOL code word. at com.itextpdf.text.pdf.codec.TIFFFaxDecoder.readEOL(TIFFFaxDecoder.java:1303) at com.itextpdf.text.pdf.codec.TIFFFaxDecoder.decode2D(TIFFFaxDecoder.java:811) at com.itextpdf.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:223) at com.itextpdf.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:315) at com.itextpdf

iText: List of images in a cell

送分小仙女□ 提交于 2019-12-20 02:46:49
问题 I would like to create a table that has a list of dots. I don't know ahead of time how many dots I have, but if they overflow the cell, I want them to wrap, just like text would. My code is something like this: PdfPTable table = new PdfPTable(1); table.setTotalWidth(new float[]{80}); table.setLockedWidth(true); Phrase listOfDots = new Phrase(); for (int i = 0; i < 40; i++) { listOfDots.add(new Chunk(pdf.correct, 0, 0)); listOfDots.add(new Chunk(" ")); } table.addCell(listOfDots); outerCell

How to add blank pages in exist PDF in java? [closed]

▼魔方 西西 提交于 2019-12-20 02:43:20
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I have normal PDF file, i want to insert blank pages at the end of PDF using itext LIBRARY , without disturbing the PDF contents. 回答1: The answer by Dinup Kandel is wrong because it's about creating a document

Can I use iText to render PDF in my Swing application?

早过忘川 提交于 2019-12-20 01:16:08
问题 Can iText render PDF documents in Swing application ? Or do I have to use another library/framework for that? 回答1: iText is for producing PDF files programmatically (e.g. converting from HTML to PDF, or producing PDF reports.) To view PDF you could use a library like ICEpdf 回答2: There is also an open source/commercial versions of JPedal and Suns PDFRenderer. 来源: https://stackoverflow.com/questions/2717522/can-i-use-itext-to-render-pdf-in-my-swing-application

iTextSharp RenameField bug?

落爺英雄遲暮 提交于 2019-12-20 01:06:56
问题 I am attempting to rename a checkbox that is subclassed. Let's say the checkbox's name is MyForm.Check1.page0. When I run: reader.AcroField.RenameField("MyForm.Check1.page0", "MyForm.Check1.newName"); The checkbox is renamed just "newName". The subclass information is dropped. I get from the documentation that the subclass cannot be changed, but this was unexpected. According to the documentation: "Renames a field. Only the last part of the name can be renamed. For example, if the original

How to retrieve digital signature information (name, date, …) with ItextSharp

旧时模样 提交于 2019-12-19 19:47:33
问题 I have a PDF which has been signed by 2 people (by Eid). I'm trying to retrieve this information but I'm unable so far. This is what I have so far: namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string workingFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string inputFile = Path.Combine(workingFolder, "Tax Return.pdf"); PdfReader reader = new PdfReader(inputFile); Console.ReadLine(); } } } If I inspect 'reader' during runtime I can

How to make PdfPTable calculate column-width dynamically

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 16:35:34
问题 I want to create a PdfPTable with columns containing Strings of different lengths. I learned that the width of each cell/column are the same for each column (default) or one can set the fraction of space every column shall occupy. However, I want the columns to be as wide as required, but not any wider, depending on the data inserted. Assume that the table fits easily on the page (no breaks!). Of course, I can manually step through all my data and calculate the maximum-String-length of each