itextsharp | [DEPRECATED] .NET port of the iText library, only security fixes will be added — please use iText 7 | Document Editor library

 by   itext C# Version: 5.5.13.3 License: Non-SPDX

kandi X-RAY | itextsharp Summary

kandi X-RAY | itextsharp Summary

itextsharp is a C# library typically used in Editor, Document Editor applications. itextsharp has no bugs, it has no vulnerabilities and it has medium support. However itextsharp has a Non-SPDX License. You can download it from GitHub.

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

            kandi-support Support

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

            kandi-Quality Quality

              itextsharp has 0 bugs and 0 code smells.

            kandi-Security Security

              itextsharp has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              itextsharp code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              itextsharp 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

              itextsharp releases are available to install and integrate.
              itextsharp saves you 309895 person hours of effort in developing the same functionality from scratch.
              It has 296447 lines of code, 0 functions and 2091 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of itextsharp
            Get all kandi verified functions for this library.

            itextsharp Key Features

            No Key Features are available at this moment for itextsharp.

            itextsharp Examples and Code Snippets

            No Code Snippets are available at this moment for itextsharp.

            Community Discussions

            QUESTION

            How to determine version of iTextSharp?
            Asked 2022-Apr-04 at 09:44

            I'm using VS2022, and I received an old project, where iTextSharp was used, but I can't determine a specific version of the mentioned.

            I've tried - Tools -> Nuget Package Manager -> Manage Nuget Packages for Solution...

            But was unable to find iTextSharp.

            Thanks in advance.

            ...

            ANSWER

            Answered 2022-Apr-04 at 09:44

            It sounds like the assembly has been included directly in the source control, as was common place before nuget. Take a look in your project's references and you should be able to locate the dll. Checking the file's properties in VS should show you the assembly's details in the properties panel and should also show you which version is being used, if not the path or filename may give you a clue as to the version being used.

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

            QUESTION

            Save PDF with memory stream in a list using iTextSharp
            Asked 2022-Apr-03 at 11:10

            I'd like to read an multipage pdf file from the file system and split it to separated pages. The splitted pages i like to save to an list object. The page in the list i want to save in a base64 encoded structure in a xml and send it over a rest api service.

            What i have already done:

            1. Read the pdf file
            2. Split the pdf file to pages
            3. Save the pages to a list

            What's not relevant and only for completeness of my problem:

            1. Send the pages with a rest api service waqsy( current no code implemented)
            2. Xml structure

            What's my problem? If i save the pages from the byte array list to the file system and open the pdf (with only one page of the original page) the the pdf file is defect and can't open.

            Which error had i made on this process?

            What version of iTextSharp i use? 5.4.2

            ...

            ANSWER

            Answered 2022-Apr-03 at 10:05

            The PDF in the MemoryStream is not finished before document is closed. Thus, you store incomplete PDFs.

            To fix this, move

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

            QUESTION

            C# Regex Parsing Or Names
            Asked 2022-Mar-22 at 19:15

            I am pulling data from a printable PDF using iTextSharp. This is the text that I have extracted:

            ...

            ANSWER

            Answered 2022-Mar-22 at 19:15

            You could match the last occurrence of Print Name: and then match as least as possible of the allowed chars until you encounter the same using a backreference until the end of the string.

            Note that \s can also match a newline.

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

            QUESTION

            QR Code with iTextSharp and IronBarcode / QRCoder / Spire Barcode
            Asked 2022-Mar-16 at 10:01

            IronBarcode (preferred)

            We want to print a QR Code in a Label with iTextSharp. We use IronBarcode to generate the Barcode. Also see: IronBarcode Tutorial

            ...

            ANSWER

            Answered 2022-Feb-21 at 08:58

            If you using iTextSharp Why don't do it all the way in iTextSharp?

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

            QUESTION

            Itext7 C# How do I get page number to add image to PDF?
            Asked 2022-Feb-18 at 13:47

            I've searched all over, but all of the documentation focuses on Java answers which don't have the same methods in the .NET version. I am trying to insert an image to specific positions on a PDF, but I am unable to insert them properly. I can get accurate X/Y coordinates but when it inserts into the PDF, it inserts all of them onto the first page only.

            I'm also finding that the height and width don't come out the same as the fields they're replacing. The variables in my watch window show the correct height and width, but it ends up compressed on the PDF. This wasn't a problem with itextSharp when I used to use that.

            ...

            ANSWER

            Answered 2022-Feb-18 at 13:47
            Determining the Page Number

            According to your code you already do have a page object, the PdfPage page, and are looking for its page number in the document. You can use the PdfDocument method

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

            QUESTION

            "At least one signature is invalid" After adding stamp in Signed PDF
            Asked 2022-Feb-07 at 10:03

            I need to add stamp or image annotation in a signed PDF but it gives me an "invalid signature" error and, after moving this annotation, it gives me an "at least one signature required validating" error. How can I solve this?

            I also found a solution but for text annotation in this question. It worked fine with text annotation but I cannot do the same for the stamp.

            ...

            ANSWER

            Answered 2022-Feb-07 at 10:03

            QUESTION

            Pdf signature invalidates existing signature in Acrobat Reader
            Asked 2022-Jan-28 at 18:26

            I'm using iText 7.1.15 and SignDeferred to apply signatures to pdf documents. SignDeferred is required since the signature is created PKCS11 hardware token (usb key).

            When i sign a "regular" pdf, e.g. created via word, i can apply multiple signatures and all signatures are shown as valid in the adobe acrobat reader.

            If the pdf was created by combining multiple pdf documents with adobe DC, the first signature is valid but becomes invalid as soon as the seconds signature is applied.

            Document in Adobe reader after the first signature is applied:

            Document in Adobe reader after the second signature is applied:

            The signatures of the same document are shown as valid in foxit reader.

            I've found a similar issue on stackoverflow (multiple signatures invalidate first signature in iTextSharp pdf signing), but it was using iText 5 and i'm not sure it is the same problem.

            Question: What can i do in order to keep both signatures valid in the Acrobat Reader?

            Unsigned Pdf document on which the first signature becomes invalid: https://github.com/suntsu42/iTextDemoInvalidSecondSignature/blob/master/test.pdf

            Twice signed document which is invalid: https://github.com/suntsu42/iTextDemoInvalidSecondSignature/blob/master/InvalidDocumentSignedTwice.pdf

            Code used for signing

            ...

            ANSWER

            Answered 2022-Jan-28 at 16:35

            As already mentioned in a comment, the example document "InvalidDocumentSignedTwice.pdf" has the signature not applied in an incremental update, so here it is obvious that former signatures will break. But this is not the issue of the OP's example project. Thus, the issue is processed with an eye on the actual outputs of the example project.

            Analyzing the Issue

            When validating signed PDFs Adobe Acrobat executes two types of checks:

            • It checks the signature itself and whether the revision of the PDF it covers is untouched.
            • (If there are additions to the PDF after the revision covered by the signature:) It checks whether changes applied in incremental updates only consist of allowed changes.

            The former check is pretty stable and standard but the second one is very whimsical and prone to incorrect negative validation results. Like in your case...

            In case of your example document one can simply determine that the first check must positively validate the first signature: The file with only one (valid!) signature constitutes a byte-wise starting piece of the file with two signatures, so nothing can have been broken here.

            Thus, the second type of check, the fickle type, must go wrong in the case at hand.

            To find out what change one has to analyze the changes done during signing. A helpful fact is that doing the same using iText 5 does not produce the issue; thus, the change that triggered the check must be in what iText 7 does differently than iText 5 here. And the main difference in this context is that iText 7 has a more thorough tagging support than iText 5 and, therefore, also adds a reference to the new signature field to the document structure tree.

            This by itself does not yet trigger the whimsical check, though, it only does so here because one outline element refers to the parent structure tree element of the change as its structure element (SE). Apparently Adobe Acrobat considers the change in the associated structure element as a change of the outline link and, therefore, as a (disallowed) change of the behavior of the document revision signed by the first signature.

            So is this an iText error (adding entries to the structure tree) or an Adobe Acrobat error (complaining about the additions)? Well, in a tagged PDF (and your PDF has the corresponding Marked entry set to true) the content including annotations and form fields is expected to be tagged. Thus, addition of structure tree entries for the newly added signature field and its appearance not only should be allowed but actually recommended or even required! So this appears to be an error of Adobe Acrobat.

            A Work-Around

            Knowing that this appears to be an Adobe Acrobat bug is all well and good, but at the end of the day one might need a way now to sign such documents multiple times without current Adobe Acrobat calling that invalid.

            It is possible to make iText believe there is no structure tree and no need to update a structure tree. This can be done by making the initialization of the document tag structure fail. For this we override the PdfDocument method TryInitTagStructure. As the iText PdfSigner creates its document object internally, we do this in an override of the PdfSigner method InitDocument.

            I.e. instead of PdfSigner we use the class MySigner defined like this:

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

            QUESTION

            How to interpret iTextSharp TJ/TF result
            Asked 2021-Dec-20 at 13:15

            I'm implementing an automation process with PowerShell using iTextSharp lib, to extract needed information about several PDF documents.

            Based on this PDF content portion:

            It returns this result:

            ...

            ANSWER

            Answered 2021-Dec-20 at 13:15

            When you are wondering about details of the PDF format, you should have a look into the PDF specification ISO 32000.

            Operands Operator Description array TJ Show one or more text strings, allowing individual glyph positioning. Each element of array shall be either a string or a number. If the element is a string, this operator shall show the string. If it is a number, the operator shall adjust the text position by that amount; that is, it shall translate the text matrix, Tm. The number shall be expressed in thousandths of a unit of text space (see 9.4.4, "Text Space Details"). This amount shall be subtracted from the current horizontal or vertical coordinate, depending on the writing mode. In the default coordinate system, a positive adjustment has the effect of moving the next glyph painted either to the left or down by the given amount. Figure 46 shows an example of the effect of passing offsets to TJ.

            (ISO 32000-1, Table 109 – Text-showing operators)

            Thus,

            I'm suspecting that the numbers between the literal characters (e.g -1688.21,-492.975,...), may be useful, but I didnt find explanation about such parameters.

            What they represent?

            For each such number, the operator adjusts the text position by that amount. The number is expressed in thousandths of a unit of text space. This amount is subtracted from the current horizontal or vertical coordinate, depending on the writing mode.

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

            QUESTION

            PDF signed by iTextSharp 5 or iText7-dotnet shows valid by iText and Adobe, but not by EU DSS Demo
            Asked 2021-Dec-01 at 13:49

            I PDF signing problems with the latest iTextSharp 5. I know that version is already deprecated, but I must use the older one, because I need to use it in an environment, where no newer than .NET Framework v3.5 is allowed.

            For singing documents, the clients may use software or hardware keys. We already used RSA signatures in our company, but now we have toimplement support for ECDsa keys too. That's why I tried to sign PDF files with iText's PrivateKeySignature class, and calling MakeSignature.SignDetached method.

            When I use RSA key for signing a PDF, and try to verify signature with European Commission's DSS Demonstration App (https://ec.europa.eu/cefdigital/DSS/webapp-demo/validation), it has no issue with the signature, only that it not accepts the certificate issuer as a trusted CA. That's fine, because I use a test key generated by an internal CA for developer use only.

            But if I use ECDSA key for signing a PDF, the DSS Demonstration App says "Signature is not intact.".

            The code I use for signing:

            ...

            ANSWER

            Answered 2021-Dec-01 at 13:49

            Just like @mval mentioned in a comment, iText uses the public key algorithm OID as signature algorithm OID.

            In case of RSA that is ok as here the same OID is specified for a RSA key and for RSASSA (with PKCS#1 v1.5 padding).

            This is not the case for ECDSA, so eSignature DSS complains. Adobe Acrobat (Reader) on the other hand is very lax. It actually ignores the signature algorithm OID field, you could even have an ECDSA signature with the RSA OID in that field and the current Acrobat wouldn't complain.

            To fix this use an IExternalSignatureContainer implementation instead of an IExternalSignature implementation and call MakeSignature.SignExternalContainer instead of MakeSignature.SignDetached. In your IExternalSignatureContainer implementation you can use BouncyCastle or Windows Crypto API classes to create a CMS signature container.

            Other questions related to incorrect signature algorithm OIDs in respect to iText:

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

            QUESTION

            Get PDF XMP Metadata without loading the complete document
            Asked 2021-Nov-09 at 10:07

            With libraries like iTextSharp or iText you can extract metadata from PDF documents via a PdfReader:

            ...

            ANSWER

            Answered 2021-Nov-09 at 10:07

            With PDF4NET you can extract the XMP metadata without loading the entire document in memory:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install itextsharp

            You can download it from GitHub.

            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

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link