itextsharp

Sign multiple pdf with itextsharp and token prompts for pin every time

吃可爱长大的小学妹 提交于 2020-01-12 10:55:10
问题 Hi I am trying to prevent multiple pin prompts for every pdf that needs to be signed. I am using code from this example : Pin is required when this part of code get process : MakeSignature.SignDetached(appearance, pks, chain, crlList, ocspClient, tsaClient, estimatedSize, subfilter); Is there any way to memorize token pin and sing rest of pdfs without prompting for pin? 回答1: Finally I found solution, this code does the trick : ... RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)pk

Sign multiple pdf with itextsharp and token prompts for pin every time

故事扮演 提交于 2020-01-12 10:51:53
问题 Hi I am trying to prevent multiple pin prompts for every pdf that needs to be signed. I am using code from this example : Pin is required when this part of code get process : MakeSignature.SignDetached(appearance, pks, chain, crlList, ocspClient, tsaClient, estimatedSize, subfilter); Is there any way to memorize token pin and sing rest of pdfs without prompting for pin? 回答1: Finally I found solution, this code does the trick : ... RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)pk

Can iTextSharp convert PDF document to PDF/A

一个人想着一个人 提交于 2020-01-11 17:09:31
问题 I cannot locate within the FAQ whether this functionality exists in the API although its mentioned in a book as something that is potentially available. Has anyone had any experience implementing this feature? 回答1: On This thread (dated June 2007) Paulo Soares provides code that shows support for PDF/A. Here's the C# code (he also has a Java sample): private void PdfATest() { Document doc = new Document(PageSize.A4); PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream("C:\\hello_A1-b

split huge 40000 page pdf into single pages, itextsharp, outofmemoryexception

怎甘沉沦 提交于 2020-01-11 15:59:32
问题 I am getting huge PDF files with lots of data. The current PDF is 350 MB and has about 40000 pages. It would of course have been nice to get smaller PDFs, but this is what I have to work with now :-( I can open it in acrobat reader with some delay when loading but after that acrobat reader is quick. Now I need to split the huge file into single pages, then try to read some recipient data from the pdf pages, and then send the one or two pages that each recipient should get to each particular

save Pdf File in the particular folder instead of downloading

别等时光非礼了梦想. 提交于 2020-01-11 13:22:12
问题 I am doing html to pdf file . Its Downloading instantly . I dont want download instantly. i want to save the file in my project folder once converted. My C# Code string html ="<table><tr><td>some contents</td></tr></table>"; Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=WelcomeLetter.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw);

iText(Sharp): tables with headers and subheaders

强颜欢笑 提交于 2020-01-11 12:58:10
问题 I'm using iText (iTextSharp version 5.5.7) and I am creating a PdfPTable where the data in the rows is sorted. To give a specific example, say my data looks like this (including my headers - h1, h2, and h3): +---+---+---+ |h1 |h2 |h3 | +---+---+---+ | A | B | C | +---+---+---+ | A | B | D | +---+---+---+ | A | E | F | +---+---+---+ | K | G | H | +---+---+---+ | K | G | I | +---+---+---+ | K | G | J | +---+---+---+ I've got that working, and then I started setting the Rowspan property of

how to save pdf on server map path using iTextsharp

蓝咒 提交于 2020-01-11 06:17:07
问题 i am using following code for generate pdf and it is work perfect: string strQuery = "select * from userdata"; SqlCommand cmd = new SqlCommand(strQuery); DataTable dt = GetData(cmd); //Create a dummy GridView GridView GridView1 = new GridView(); GridView1.AllowPaging = false; GridView1.DataSource = dt; GridView1.DataBind(); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.pdf"); Response.Cache.SetCacheability

Separating redundant code from pdf generator function

谁说胖子不能爱 提交于 2020-01-10 05:29:50
问题 This is a vb.net app that uses the itextsharp library. What I am running in to is the following code is becoming awfully redundant which in my opinion is not a clean way to do things. But I can not seem to figure out how to separate it in to a separate function that in which I would simply pass in the string, x_Cord, y_Cord, tilt and have it either a) when passing it in it goes in as an array or b) does it for each line that needs it... The function would then return the necessary information

How to create pdfformfields using iTextSharp?

喜欢而已 提交于 2020-01-10 05:29:25
问题 I am using iTextSharp and CSharp for creating the pdf. I need to add formfields like checkbox, radiobutton and dropdown which can not be edited. I used this.. FileStream pdffile = new FileStream(path + "/Pdf/tes.pdf",FileMode.Create); PdfWriter writer = PdfWriter.GetInstance(doc, pdffile); doc.Open(); Rectangle rect = new Rectangle(100, 100, 100, 100); RadioCheckField checkbox = new RadioCheckField(writer, rect, "bhjabsdf", "on"); checkbox.CheckType = RadioCheckField.TYPE_CHECK; PdfFormField

pdfpCell.Rowspan in itextsharp not work properly

故事扮演 提交于 2020-01-07 07:37:08
问题 I need to crate a PDF with following structure! http://www.freeimagehosting.net/6auu8 (link of my image) my snippet was... //Create new Pdfptable PdfPTable table = new PdfPTable(4); // create new cell PdfPCell LEFT= new PdfPCell(new Phrase("Left")); LEFT.Colspan = 1; LEFT.Rowspan = 2; table.AddCell(LEFT); // create another cell PdfPCell RIGHT= new PdfPCell(new Phrase("Right")); RIGHT.Colspan = 3; RIGHT.Rowspan = 2; table.AddCell(RIGHT); but, it not working..... 回答1: Try this: Document