itext

How to create certificate object from public key in PEM format?

假装没事ソ 提交于 2020-06-29 05:46:12
问题 I want to use iText to embed signed hash and public in PDF. As per arguments to sign method in iText 7 I need to pass certificate chain, How can I create this certificate object directly from public key string? Update 1 Below is small c# code. You can see I am trying to get x509 certificate from public key. This certificate will be used to verify the signed data from corresponding private key. Also it will be used to embed this public certificate and signed hash into PDF for digital signature

iTextsharp with signed file

自作多情 提交于 2020-06-29 05:14:08
问题 I have a problem with PDF signed. I received a PDF file, created with Life Cycle (Acrobat) that already contain two digital signing over some acroFields. I have to put a couple of data over other acrofields, and I´m using the follow code in C#: PdfReader pdfReader = null; PdfStamper stamper = null; string filePDF = @"C:\Visual Studio Solutions\Visual Windows\cpce Certificaciones\prueba_xfa.pdf"; string outPDF = @"C:\Visual Studio Solutions\Visual Windows\cpce Certificaciones\prueba_xfa_out

How to hide Validity unknown symbol after signing the PDF in iTextSharp

我的未来我决定 提交于 2020-06-29 04:13:08
问题 I have created a signed PDF using iTextSharp in C# .Net. In the signed PDF I want to have a validity symbol so that when a user opens it in Adobe Reader it shows a green tick mark along with its signature. But in my web application (a html page with canvas) I want to remove that question mark from the PDF so that it does not show like in this screen: So I want to keep the original bytes of the PDF in which signatureappearance.Acro6Layers = false; is added in code to get this symbol. But

Want to create a pdf with a form having rectangles as header and paragraph in footer and the sections in the body

Deadly 提交于 2020-06-27 08:18:45
问题 The code I have written till now is below: public class HeaderFooterEvent extends PdfPageEventHelper { @Override public void onStartPage(PdfWriter writer, Document document) { } @Override public void onEndPage(PdfWriter writer, Document document) { addHeader(writer, document); addHeader2(writer, document); addFooter(writer, document); } void addHeader(PdfWriter writer, Document document){ try { PdfContentByte cb = writer.getDirectContent(); // the initial rectangle defines the max size of the

iTextSharp - How to get PDF content for signing and then sign at a later time

你说的曾经没有我的故事 提交于 2020-06-25 05:03:29
问题 I'm developing a client-server application where clients have to sign PDF documents using their signatures and upload them to the server. The task is complicated by the fact that clients don't have the means to embed signatures into PDFs, they can only read raw bytes and produce the signature in the form of raw bytes. I'm trying to implement the following workflow: The client uploads the unsigned PDF to the server The server opens the PDF, extracts the bytes that the client needs to sign, and

Create IExternalSignature with x509Certificate2 in C# and iText 7

。_饼干妹妹 提交于 2020-06-22 01:43:05
问题 I am testing the iText 7.1.2.0 library to sign pdf files, using a digital certificate or smart card (X509Certificate2) in a C # project. But I'm getting this error when I try to create the IExternalSignature. According to the documentation found (here, here and here), the way to achieve this process is using the BouncyCastle library that allows extracting the primary keys from the digital certificate, however, it is giving me an error and I can not find another way to do it. In the

How to add a “Page X of Y” footer in iText 7

为君一笑 提交于 2020-06-21 09:45:07
问题 I'm trying to figure out how to add a "Page X of Y" footer to each page in a PDF document, which I'm generating using iText 7 . Using an IEventHandler to generate the "Page X" part seems fairly straightforward - it's the "of Y" bit that I'm struggling with. I want to avoid generating the whole document twice in order to find out how many pages it has, as this would be a significant performance hit! I've found a solution for this in iText 5 here: PDF Page Numbering in Java & iText, but iText 7

how to reduce the size of png image in pdf (compress png in pdf)

三世轮回 提交于 2020-06-17 13:19:20
问题 I want to reduce the size of pdf file by replacing the high-resolution image with a lower-resolution image. To complete the issue, I have to: extract the images(streams) from pdf compress the images replace the images(streams) in the pdf with compressed images When I extract png images and replace them, the transparent background changes to a black background. I extract the images from the pdf to figure out the reason. There is something very strange that pdf uses to stream to save a png. So

how to reduce the size of png image in pdf (compress png in pdf)

只愿长相守 提交于 2020-06-17 13:19:07
问题 I want to reduce the size of pdf file by replacing the high-resolution image with a lower-resolution image. To complete the issue, I have to: extract the images(streams) from pdf compress the images replace the images(streams) in the pdf with compressed images When I extract png images and replace them, the transparent background changes to a black background. I extract the images from the pdf to figure out the reason. There is something very strange that pdf uses to stream to save a png. So

iTextSharp vs iText

拜拜、爱过 提交于 2020-06-12 04:31:37
问题 I am re-engineering legacy ASP.Net Web Forms application that uses iText 1.4.6.2 New application will use ASP.Net MVC but I am not clear on newer version of iText component. In NuGet repository there is iTextSharp 5.5.10 (by Bruno Lowagie et al) and iText 7.0.1 (by iText software). What is the relationship/difference between these two packages (both have been updated recently)? ADDITIONAL QUESTIONS: What is recommended for new development? What version will require the least changes in legacy