itext

Sigining a PDF using USB driver in server client condition

孤街醉人 提交于 2019-12-31 07:16:42
问题 I am doing a project where i need to sign a pdf using a usb based digital signature. I have tried the following code locally and able to sign the pdf. my problem is weather the following code will work in a client server based senerio. My code is: import com.lowagie.text.DocumentException; import com.lowagie.text.pdf.PdfReader; import com.lowagie.text.pdf.PdfSignatureAppearance; import com.lowagie.text.pdf.PdfStamper; import java.io.FileInputStream; import java.io.FileNotFoundException;

add revocation detail in pdf while signing same

╄→尐↘猪︶ㄣ 提交于 2019-12-31 05:44:06
问题 I am have digitally signed a pdf using digital token attached in pc using libarary itext sharp to append same, when i open same in adobe reader it shows revocation can not be performed and when i see details then it shows that one of the issuers certificate's revocation is not checked with error : error encountered while BER decoding. path to my plain signed pdf: https://www.sendspace.com/file/vqgl53 As a solution i thought if i can add CRL information itself in document(my plain signed pdf)

Traverse whole PDF and change some attribute with some object in it using iText

百般思念 提交于 2019-12-31 05:39:05
问题 I'm working on a filter program which turns each black text block into gray ones in a PDF file. I have gone through com.itextpdf.text.pdf.parser and can't found something suitable for this function. PS: I'm using iTextSharp 5.5.10, for which I can't find an appropriate document. Documents for iText5 seems to work at most times, but there's still difference. Is there any document for iTextSharp? 回答1: The OP clarified his question in a comment: I'm wondering how to write a parser like

itextsharp: How to find the fill color of a rectangle

寵の児 提交于 2019-12-31 05:21:10
问题 I follow ItextSharp example for getting a graphical structure, to get the rectangle coordinates, using code: class VectorGraphicsListener : IExtRenderListener { public void ModifyPath(PathConstructionRenderInfo renderInfo) { if (renderInfo.Operation == PathConstructionRenderInfo.RECT) { float x = renderInfo.SegmentData[0]; float y = renderInfo.SegmentData[1]; float w = renderInfo.SegmentData[2]; float h = renderInfo.SegmentData[3]; ... I tried the renderInfo.GetFillColor(); but there is no

Need to add a new page to a pdf document that already has a digital signature

和自甴很熟 提交于 2019-12-31 05:09:33
问题 i need to add a new page when there is no more space on the last page of the document i have been seen the digital signare book of itext and it says the i can't be just using the insertPage() method and that's how i do now so the digital signatures get broken so the book says. NOTE: Be aware that ‘page adding actions are allowed’ doesn’t mean you can use the insertPage() method. This message refers to page template instantiation as described in the Adobe Acrobat JavaScript Reference Manual,

Document.NewPage() not adding new page

时光怂恿深爱的人放手 提交于 2019-12-31 04:28:26
问题 I am trying to add a new page to a pdf document, however for some reason this is not happening. Maybe my other question https://stackoverflow.com/questions/11428878/itextsharp-splitlate-not-working has something to do with this since the table in this question does not break and no new pages are created. This is the code I have for the adding of new pages: Document doc = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4.Rotate(),20,20,20,40); string rep1Name; // variable to hold the

PDF coordinate system in iTextSharp

橙三吉。 提交于 2019-12-31 03:58:09
问题 Now I'm working on extracting line and rectangle from PDF by using iTextSharp. The method I used is as below: PdfReader reader = new PdfReader(strPDFFileName); var pageSize = reader.GetPageSize(1); var cropBox = reader.GetCropBox(1); byte[] pageBytes = reader.GetPageContent(1); PRTokeniser tokeniser = new PRTokeniser(new(RandomAccessFileOrArray(pageBytes)); PRTokeniser.TokType tokenType; string tokenValue; CoordinateCollection cc = new CoordinateCollection(); while (tokeniser.NextToken()) {

iText 7 HTML to PDF conversion [duplicate]

寵の児 提交于 2019-12-31 03:57:06
问题 This question already has an answer here : iText 7 java.lang.NoSuchMethodError (1 answer) Closed 2 years ago . I am using iText 7 for PDF generation.I need to append Rich Text which having HTML document. In itext 5, i was using Chunk class for extracting data. But in itext 7 I don't see any API. And I tried with the code HtmlConverter.convertToPdf(is, os, properties); But it is giving below error. Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.layout.font.FontSet

iText PdfStamper increase size of a signed pdf

泪湿孤枕 提交于 2019-12-31 03:49:09
问题 Why PdfStamper increase the size of my signed pdfs every i use? That's my code: private static void test(String src, String pwd, String dest) throws Exception { byte[] pwdByte = pwd != null ? pwd.getBytes() : null; PdfReader r = null; PdfStamper stp = null; FileOutputStream fos = null; try { r = new PdfReader(src, pwdByte); fos = new FileOutputStream(dest); stp = new PdfStamper(r, fos, '\0', true); } finally { stp.close(); fos.close(); r.close(); } } If i call test, the resulting pdf

How to apply style while writing html to PDF

自作多情 提交于 2019-12-31 03:46:17
问题 I am Adding html to the pdf file. My html is in div form and that containing the style attribute which having the style like border:2px solid red; but this style is not applying to the html that i am writing to the pdf file. i am using the following code : Document document = new Document(PageSize.A4_LANDSCAPE, 0, 0, 30, 65); PdfWriter.GetInstance(document, new FileStream(Server.MapPath("/") + "Temp/" + "parsetest1.pdf", FileMode.Create)); document.Open(); String htmlText = "<div style=