itext

Multiline markup annotations with iText

陌路散爱 提交于 2019-12-25 07:25:14
问题 I want to highlight a text passage in a PDF document using iText. This passage can also span across several lines, so the highlighted region is not necessarily one rectangle. But to the PdfAnnotation.createMarkup(...) methods I can only pass or describe one rectangle and also the PDF reference only allows for four QuadPoints to describe the region. I would be very happy if I could achieve this with one single annotation. I know that this is possible, because I have seen documents with multi

IText PDFImage seems to shrink or disappear during new pages after upgrade from 2.1.7 to 5.5.5 (Java .jars)

风流意气都作罢 提交于 2019-12-25 07:15:02
问题 I seem to have an issue after upgrading iText from 2.1.7 where the PDF seems to be missing or the image has shrunk between pages. I'm wondering if this is a known issue or if there is something that I need to set in order to fix it. Some context: no real calculations have been changed when switching libraries. the general structure is that we have a Document which has a pdfTable which holds a bunch of pdfImages. changing between landscape and portrait produces different results. the images

Using iTextPDF to trim a page's whitespace

本秂侑毒 提交于 2019-12-25 06:38:46
问题 I have a pdf which comprises of some data, followed by some whitespace. I don't know how large the data is, but I'd like to trim off the whitespace following the data PdfReader reader = new PdfReader(PDFLOCATION); Rectangle rect = new Rectangle(700, 2000); Document document = new Document(rect); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(SAVELCATION)); document.open(); int n = reader.getNumberOfPages(); PdfImportedPage page; for (int i = 1; i <= n; i++) { document

iText7 scaling rotated document with links

亡梦爱人 提交于 2019-12-25 06:35:26
问题 I am using iText7(java) and trying to scale a portrait document to landscape. The document contains links and has rotation set to 270. Setting mediabox and cropbox on document does not work due to rotation. The solution mentioned in iText Examples does not work properly and hyperlinks in document stop working. There might be loss of other metadata as well . Is there any way to scale the document without using copyAsFormXObject. Following method in itext7 to manipulate documents works very

iText7 scaling rotated document with links

喜夏-厌秋 提交于 2019-12-25 06:35:18
问题 I am using iText7(java) and trying to scale a portrait document to landscape. The document contains links and has rotation set to 270. Setting mediabox and cropbox on document does not work due to rotation. The solution mentioned in iText Examples does not work properly and hyperlinks in document stop working. There might be loss of other metadata as well . Is there any way to scale the document without using copyAsFormXObject. Following method in itext7 to manipulate documents works very

Browsing PDF page content. Problem with color space and DPI

荒凉一梦 提交于 2019-12-25 06:08:13
问题 I am writing a program that would validate PDF file. I am using iText java library to get content of a file, but I have some problems with parsing it. I need to get info about color space and DPI of each image. How can I get info about position and dimensions of image in PDF? I tried to browse each XObject of PDF but I stuck, I cannot find any information about width and height of file in PDF. Are there any other libraries which can help me? Thank You for all answers and tips. 回答1: The image

iTextSharp CreateInk method: curves and corners

拥有回忆 提交于 2019-12-25 05:54:27
问题 I'm using iTextSharp to draw markup graphics in PDF documents, using PdfAnnotation.CreateInk. I'm trying to draw rectangles, passing in an array of five co-ordinates. I know iTextSharp has a dedicated function for drawing rectangles, but I'm trying to use just one method to draw the various kinds of markup lines I need, and it seems that CeateInk should be able to do that. The problem is that CreateInk is drawing the rectangle with curves rather than corners. I haven't been able to figure out

Compressing images in existing pdfs makes the resulting PDF file bigger (Lowagies resizing method and real compression method)

别说谁变了你拦得住时间么 提交于 2019-12-25 05:29:32
问题 Im having a problem with image compression. I used the answer described in this question compress pdf with large images via java if i set the FACTOR variable to 0.9f or 1f (original size) the resulting pdf file starts to get bigger than the ORIGINAL. But that is not the case for all files. Some files created by myself are getting smaller like planned but some just get bigger like +1/3rd and i get black backgrounds on some images ontop of it. this is getting even worse when im using the normal

C# ASP.NET MVC Create PDF from view Rotativa or iTextSharp? [closed]

人盡茶涼 提交于 2019-12-25 05:13:18
问题 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 2 years ago . I am very unfamiliar with generating PDF from multiple forms. In fact, I've never generated a PDF using any kind of programming language. Now I have been trying 2 different methods for what I want to do. Unfortunately after a few days I still haven't found out how to do this. I have multiple forms with data pre

pdf not generated by itext library from java application

情到浓时终转凉″ 提交于 2019-12-25 05:13:12
问题 I am using i-text to generate a PDF file from a java program. As long as I run my program through NetBeans it works fine. The PDF gets generated and all the data is present in the file. But when I run it from the built JAR file, there is no PDF file generated. Do I need to change something in the manifest or give some special permissions? 来源: https://stackoverflow.com/questions/43164389/pdf-not-generated-by-itext-library-from-java-application