itextpdf | [DEPRECATED] Core Java Library + PDF/A, xtra and XML Worker. Only security fixes will be added — ple | Document Editor library

 by   itext Java Version: 5.5.13.3 License: Non-SPDX

kandi X-RAY | itextpdf Summary

kandi X-RAY | itextpdf Summary

itextpdf is a Java library typically used in Editor, Document Editor applications. itextpdf has no bugs, it has no vulnerabilities, it has build file available and it has medium support. However itextpdf has a Non-SPDX License. You can download it from GitHub, Maven.

PLEASE NOTE: iText 5 is EOL, and has been replaced by iText 7. Only security fixes will be added.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              itextpdf has a medium active ecosystem.
              It has 1476 star(s) with 445 fork(s). There are 138 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              itextpdf has no issues reported. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of itextpdf is 5.5.13.3

            kandi-Quality Quality

              itextpdf has no bugs reported.

            kandi-Security Security

              itextpdf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              itextpdf has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              itextpdf releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.

            Top functions reviewed by kandi - BETA

            kandi has reviewed itextpdf and discovered the below as its top functions. This is intended to give you an instant insight into itextpdf implemented functionality, and help decide if they suit your requirements.
            • Recursively builds the outline tree .
            • Read all the properties
            • Create the composite columns .
            • Serializes a node value .
            • Create a new font prefix .
            • Reads a stream .
            • Sets a list option to a list .
            • Builds version list .
            • Reads the header .
            • Returns the bars code for the given text .
            Get all kandi verified functions for this library.

            itextpdf Key Features

            No Key Features are available at this moment for itextpdf.

            itextpdf Examples and Code Snippets

            No Code Snippets are available at this moment for itextpdf.

            Community Discussions

            QUESTION

            How to set page orientation in itextpdf HtmlConverter
            Asked 2022-Mar-21 at 11:18

            In database I store different html templates for pdf. Today client ask to add landscape oriented template. Well, now convertation works incorrect: template is landscape and part of text out of page, because page is vertical oriented.

            I used itextpdf and convertation from html to pdf looks like:

            ...

            ANSWER

            Answered 2022-Mar-21 at 11:18

            Can you please try the following code. baseUri is basically a path to the directory that contain resources files like images/CSS.

            Source https://stackoverflow.com/questions/71555699

            QUESTION

            IText 7 Unknown key algorithm: ECGOST3410
            Asked 2022-Mar-19 at 22:39

            I'm trying to digitally sign pdf document on android (api 26) using IText 7('com.itextpdf:itext7-core:7.1.17') with the GOST3410 algorithm. BouncyCastle libraries: 'org.bouncycastle:bcprov-jdk15on:1.54' and 'org.bouncycastle:bcpkix-jdk15on:1.54' Here's my function:

            ...

            ANSWER

            Answered 2022-Mar-19 at 22:39

            As mkl said custom signature container implementing IExternalSignatureContainer works well. Here's class example from PrivateKeySignatureContainerBC:

            Source https://stackoverflow.com/questions/69787567

            QUESTION

            iText - add image to an existing PDF
            Asked 2022-Mar-16 at 15:23

            I am doing the following using iText.

            1. I have a PDF
            2. I add an image to the PDF
            3. I save the modified PDF.

            To add image in PDF I am using this method itext-add. This worked fine until I got a certain PDF. In this PDF, the adding-image-to-the-pdf method doesn't work. Moreover, it corrupts the PDF.

            Points to note: I'm getting PDFs from a third party and these are contractual PDFs. So it is possible that they have added some restrictions.

            And one fun fact, when I add an annotation on the same page where I want to add that image, that image starts coming!

            I'm using iText 7.1.10

            ...

            ANSWER

            Answered 2022-Mar-16 at 08:55

            Well, something wrong with appendMode. Do you really need him? Try to add image via the next code:

            Source https://stackoverflow.com/questions/71488649

            QUESTION

            iText paragraph.setRotationAngle changes text orientation
            Asked 2022-Feb-24 at 05:14

            I'm trying to add some vertical texts to a PDF file, but when I rotate my paragraphs with setRotationAngle every space turn into a line break or the text orientation is changed, I'm not sure. The pictures show the result I expect and the result I'm getting. I'm using iText 7.1.0 at NetBeans 12.3.

            Result I want

            Result I get

            Here's my full code

            ...

            ANSWER

            Answered 2022-Feb-24 at 05:14

            Try Below code it will work as expected showTextAligned is a Convenience method to write a text aligned about the specified point

            Source https://stackoverflow.com/questions/71247006

            QUESTION

            Can't deploy Spring-Boot WAR file on External Tomcat 7
            Asked 2022-Feb-23 at 22:05

            The development team is using Tomcat 7 on Ubuntu server. I downloaded that Tomcat from the server and deployed locally and it works okay.

            Now, I developed a spring-boot module, wrapped it into WAR file and wanted to deploy it in the same Tomcat. However, catalina.bat run fails to start my spring-boot application. The original application (called ROOT) is working fine.

            My pom.xml:

            ...

            ANSWER

            Answered 2022-Feb-23 at 22:05
            Deploy to Tomcat 8 or later

            Your error says the interface HttpSessionIdListener cannot be found.

            Looking at the Javadoc for that interface tells us it was added in Servlet 3.1 specification.

            Now look at the Which version? page on the Tomcat site. There we see that Tomcat 7 supports Servlet 3.0. For Servlet 3.1, you need Tomcat 8 or later.

            Be aware that Tomcat 8.0.x has been superseded by Tomcat 8.5.x.

            Source https://stackoverflow.com/questions/71243978

            QUESTION

            ExceptionConverter: java.io.IOException: Stream Closed when trying to create a PDF using iText
            Asked 2022-Feb-17 at 14:29

            I'm working on PDF related project and I want to create a PDF from the existing PDF.

            all things are done but when I created a final PDF at that time this exception was thrown at the line of document.close(); at the method of savePDF which describe below.

            • Create new PDF from existing PDF adding PdfImportedPage.

            here is my code

            The app crashes only when we add a new page

            ...

            ANSWER

            Answered 2022-Feb-17 at 13:46

            In createAndAddPage you import the page into the wrong PdfWriter:

            Source https://stackoverflow.com/questions/71157587

            QUESTION

            Saving PDF for sharing using iText with backwards compatibility
            Asked 2022-Feb-10 at 10:29

            A problem with saving a PDF file on Android has been bugging me for weeks, making every Google search I do result in a list of purple links.

            I have attempted numerous approaches, but have only managed to save a PDF file using the built in PDF creator, which does not fulfill my purpose.

            I have a number of questions that I seek an answer to, and hope some of you can help.

            Question 1: Where should you save a PDF file you intend to share and then delete immediately after?

            Q1 a) Is a ContentResolver & ContentProvider required, or is this only when sharing a 'directory' between apps?

            Intuitively it makes most sense for me to save the PDF in the internal cache directory, share it from there and then delete it.

            Question 2: What is the approach for storing files with backwards compatibility?

            From what I have read, different SDK levels require different approaches for file storage, being:

            • <= SDK 28 uses traditional storage methods, which is (using File API)?
            • <= SDK 29 you should request permission for legacy storage, if using external storage
            • >= SDK 30 Android enforces scoped storage

            Using SAF (Storage Access Framework) seems to be the recommended way to store documents like PDFs. However, I don't intend to display a file picker to the user, when they are simply generating and sharing a PDF.

            I am encountering this very generic exception, which occurs when iText closes the output stream. Below are some code examples and their resulting errors.

            SDK 30 File API test

            ...

            ANSWER

            Answered 2022-Feb-10 at 10:29

            You brought up a number of issues. This answer focuses on the actual errors you show.

            The actual errors you show both cause a

            Source https://stackoverflow.com/questions/71058982

            QUESTION

            Jackson Deserialization: @JsonAlias doesn't work
            Asked 2022-Feb-09 at 09:49

            I try to fill up an Java Object with a Json String, which can come with different kinds of variable names for the same field. That's why I try to use @JsonAlias. Unfortunately, I couldn't make it work yet for unknown reasons..

            Here is my example:

            The Java Object:

            ...

            ANSWER

            Answered 2022-Feb-01 at 13:08

            Try to use @JsonPropery instead of @JsonAlias

            Source https://stackoverflow.com/questions/70929553

            QUESTION

            How to resize html content so it will fit in A4 pdf?
            Asked 2022-Jan-31 at 19:52

            Having issue with setting content to A4 pdf because of it size. Things i've tried : overflow-wrap,word-wrap ,custom customSplitCharacter class,setting max width of html,table,body. Are there any ideas how to set pdf size so table will automatically fit into it (without scrolling)? My itext dependencies: itext7-core(7.1.13), html2pdf (3.0.2),itextpdf(5.5.13.2)

            Pdfview: Htmlview:

            ...

            ANSWER

            Answered 2022-Jan-31 at 19:52

            There may be several ways of solving your issue:

            1. Try to set specified properties for in html file.
            2. Try to use the proposed code below to suit html table in pdf with A4 page size. Here the table is scaled and put as formXObject in Canvas and fitted into rectangle with set size. So if table width increase, it should be scaled and fit the pdf page size.

            Source https://stackoverflow.com/questions/70519237

            QUESTION

            How to interpret signatureCoversWholeDocument() == false?
            Asked 2022-Jan-30 at 22:09

            When trying to validate a certain pdf's signature, I used the following code.

            Validation results look good, apart from one thing: SignatureUtil#signatureCoversWholeDocument returns false.

            It's obvious what that means. But I'm not sure about how to interpret this.

            How can I determine which parts of the document aren't covered by the signature?

            Can some evil guy change the document's content (if it's uncovered) while still keeping a valid signature?

            In other words: how can I assure that this ain't nothing to be worried about?

            ...

            ANSWER

            Answered 2022-Jan-30 at 22:09

            You say that it's obvious what it means that SignatureUtil#signatureCoversWholeDocument returns false but just to be sure, first some backgrounds.

            What Does It Mean When a PDF Signature Does Not Cover the Whole Document

            At the moment they are applied, PDF signatures cover their respective whole document (except, of course, the embedded signature container itself, or more exactly a placeholder for it which might be a bit larger):

            The ranges of signed bytes (from the file start to the placeholder start and from after the placeholder end to the file end) are specified in the signed part of the PDF.

            Now the PDF format allows adding to a PDF document not only by re-building the whole document from scratch but alternatively also by adding changes after its end in so called incremental updates.

            As the byte ranges signed by a PDF signature are specified in the document, this mechanism can even be used to add changes to a signed PDF without cryptographically breaking the signature.

            This mechanism can be used for example to apply multiple PDF signatures to a document:

            But the mechanism can also be used for a myriad other kinds of changes.

            Allowed and Disallowed Changes

            If one can add arbitrary changes to a signed PDF without breaking the signature cryptographically, one may wonder what the value of the signature is to start with.

            Of course one can always extract and display/process the PDF revision a PDF signature covers (simply take the partial document from its start to the end of the second signed byte range). Thus, it is clear what the original PDF fully covered by the signature looked like. So a signed PDF can be considered a collection of logical documents, loosely based on one another: for each signature the document covered by it plus (if there are additional unsigned additions) the full document.

            There actually are use cases where this makes sense, for example a document being created by a number of authors each signing of their respectively edited document version.

            But the number of use cases in which that view is too diffuse is larger (or at least more important) still. In particular there are numerous use cases with multiple signatures in which one wants a PDF to represent a single logical document signed by multiple persons, at most with a few extra form fill-ins after the first signature.

            To support such use cases the PDF specification defines a number of sets of allowed changes. Such a set can be selected by the first signature of the document. For details on these sets of allowed changes see this answer. In particular such allowed changes may encompass

            • adding or editing annotations,
            • supplying form field values, or
            • digitally signing.
            Determining the Changes in a PDF and Checking Whether They Are Allowed in Practice

            In the light of the previous section the question of the OP burns down to how one can determine the nature of the changes in incremental updates and how one can determine whether they are allowed or disallowed.

            Determining which low-level objects in a PDF have changed actually is not that difficult to determine, see the PdfCompare and PdfRevisionCompare classes in this answer.

            The real problem is checking whether these changes in low-level objects can be considered to only serve an allowed change as specified (or do not change the document semantically at all)!

            Here even the "gold standard" (i.e. Adobe Acrobat) errs again and again, both in failing to recognize disallowed changes (see e.g. the "Attacks on PDF Certification" on pdf-insecurity.org for examples that meanwhile have been fixed) and in failing to recognize allowed changes (see e.g. here and here).

            Essentially this is a very difficult task. And it is very unlikely you will find a good implementation in some open source project.

            In particular iText 7 does not include such an analysis. If you want it, therefore, you'll have to implement it yourself.

            You can simplify the task a bit if you expect the changes to be applied by a specific software. In that case you can analyze how (in terms of low-level objects) that software applies allowed changes and only accept such low-level changes. For example Adobe Acrobat is really good at recognizing allowed changes applied by Adobe software to PDFs created by Adobe software.

            Source https://stackoverflow.com/questions/70914289

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install itextpdf

            You can download it from GitHub, Maven.
            You can use itextpdf like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the itextpdf component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/itext/itextpdf.git

          • CLI

            gh repo clone itext/itextpdf

          • sshUrl

            git@github.com:itext/itextpdf.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link