itextsharp

iTextSharp dll 4.1.2.0 issue causing blank pages in a merged pdf

喜夏-厌秋 提交于 2019-12-11 16:47:42
问题 I am using iTextSharp dll version 4.1.2.0 for pdf merging.But it is causing some pages blank in the final merged pdf. but this issue is not present in its latest dll. I am using .net framework 1.1 , so i can't use latest dll cause it doesn't support. So,Please give suggestion what should i do for this. Thanks 回答1: Yes, I have got the solutions like "if we will use latest dll then it is ok, no problem but what if we are using a dll that supports .net framework 1.1 that might be before the

Underline form field value using itextsharp

喜夏-厌秋 提交于 2019-12-11 16:27:52
问题 I have an application that uses itextsharp to fill PDF form fields. I got new requirement from the customer to allow underlining the fields values. I have read many posts including answers to questions in this site but I could't figure out a way to do it. Current my code does the following: Creates a PDFStamper instance Get the form fields using stamper.AcroFields property Set the field value using the AcroFields.SetFieldRichValue() method. But when I am opening the PDF the field is empty. I

Applying Styles in PDF GridView using itextsharp

假装没事ソ 提交于 2019-12-11 16:24:03
问题 I'm trying to print a panel which contains data like labels and GridView to a PDF using itextsharp in my webpage. But if i'm not able to apply the styles to the GridView. Can you help me?? I'm using both css and html styles to style my GridView. Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "inline;filename=" + filename + ".pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new

Creating PDFs in iTextSharp with Azure

雨燕双飞 提交于 2019-12-11 16:07:35
问题 I am looking to use itextSharp to create PDFs in my MVC 3 application, and I will be using Azure. What I would like to know is will this create a problem and does Azure support this function. 回答1: You can pretty much run anything you want in azure so it wont be a problem from that prospective. The biggest thing to remember is that you probably won't want to perform such a heavy operation in a web role. A worker role is much better suited for this type of task. You could setup a system where

Programmatically check if pdf is a Form with iTextSharp

余生长醉 提交于 2019-12-11 15:58:52
问题 I'm trying to collect some metadata about pdf files on our server. I'd like to know whether or not they are a form, and if so, if they can be saved or must be printed. Does something like iTextSharp expose that kind of information? Here's a code sample where I can Private Sub GetPDFInfo(ByVal path As String) If File.Exists(path) Then Dim reader As New PdfReader(path) 'sample metadata exposed Dim numberOfPages = reader.NumberOfPages 'what to call to get form info? End If End Sub UPDATE Here's

iTextSharp ListItem different font's issue

荒凉一梦 提交于 2019-12-11 15:35:55
问题 I need to display a text like this on my PDF using iTextSharp " Recommendation to enhance your ability to learn and remember • Concentrate : In order to remember something you need to learn it. Learning is possible only if you pay enough attention to it. You will retain information for a longer period of time only if you concentrate properly at the time of learning. • Involve as many senses as possible: The physical act of rewriting information can help imprint it onto your brain. Even if you

How can I join two PDF's using iTextSharp?

我们两清 提交于 2019-12-11 15:13:02
问题 I tried to do it using this tutorial as a base, but it's throwing a null reference exception at the line specified below. Should I be doing this a different way? If not, why would it throw an null reference exception (both page and cb are NOT null). Code: string filePath = @"c:\temp\test_new.pdf"; string attachPath = @"c:\temp\test.pdf"; Console.WriteLine("Begin!"); Document d = new Document(); if(File.Exists(filePath)){File.Delete(filePath);} FileStream fs = new FileStream(filePath, FileMode

Itextsharp Next line in paragraph coming right below serial number

蓝咒 提交于 2019-12-11 14:57:54
问题 I am working on generating PDF using iTextSharp. I have some notes to be written on the page after giving a serial number. I am using Paragraph . But next line in paragraph comes right under serial number. How can I define margins or padding to paragraph only if it goes to next line? My code for(int i=0;i<list.count;i++) { doc.Add(new Paragraph(String.Format("{0}) {1} ({2}).", (i + 1).ToString(), "Here Goes My String", "Date Time"), font)); } i is the serial number. 回答1: Rather adding your

how to convert html page to pdf with css using itextsharp?

孤街浪徒 提交于 2019-12-11 14:54:42
问题 This is my code : Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); this.Page.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter.GetInstance

iTextSharp: fields generated in a table not shown in adobe reader

南楼画角 提交于 2019-12-11 14:13:00
问题 I'm trying to generate a pdf and fill in some fields at the same time. I do this two ways. The first by creating a text field and setting the text. var _text = new TextField(writer, new Rectangle(sectionX + textLength + 2, fieldIncrementer - 3, sectionX + Convert.ToSingle(xElement.Parent.Attribute("width").Value), fieldIncrementer + fieldFontSize - 2), xElement.Attribute("name").Value.Trim()); if (xElement.Attribute("autoFill") != null) { _text.Text = FormAutoFill.Instance.GetValue(xElement