itextsharp

increase width of AcroFields(iTextSharp)

雨燕双飞 提交于 2019-12-31 02:45:07
问题 I'm using iTextSharp to populate the data to PDF Templates, which is created in OpenOffice. it populating fine, I'm getting proper PDF, but some where i want to increase the width of the AcroField. I did below code. it is increasing the width but text is not displaying. AcroFields.Item fldItem = fields.getFieldItem(fieldName); for (int i =0; i < fldItem.size(); ++i) { PdfDictionary widgetDict = fldItem.getWidget(0); PdfArray rectArr = widgetDict.getAsArray(PdfName.RECT); float origX = rectArr

iTextSharp - Text overlapping image

这一生的挚爱 提交于 2019-12-31 02:25:07
问题 I'm using iTextSharpText to build a PDF. I was asked to add some dynamic text over an image. I've already tried some examples that I found on this forum and other websites, but I can't seem to get this right, and it's really driving me nuts. I followed this thread (iTextSharp Adding Text plus Barcode in a single cell?), and tried both answers. First I tried: var img_operacao = Image.GetInstance(String.Format("{0}{1}", Settings.Default.SiteRootURL, "/PublishingImages/PDF_operacao.png")); img

How justify text using iTextSharp?

╄→尐↘猪︶ㄣ 提交于 2019-12-30 18:31:56
问题 Have piece of code like below: var workStream = new MemoryStream(); var doc = new Document(PageSize.LETTER, 10, 10, 42, 35); PdfWriter.GetInstance(doc, workStream).CloseStream = false; doc.Open(); var builder = new StringBuilder(); builder.Append("MY LONG HTML TEXT"); var parsedHtmlElements = HTMLWorker.ParseToList(new StringReader(builder.ToString()), null); foreach (var htmlElement in parsedHtmlElements) doc.Add(htmlElement); doc.Close(); byte[] byteInfo = workStream.ToArray(); workStream

Problem adding javascript into PDF using iTextSharp

馋奶兔 提交于 2019-12-30 17:37:08
问题 I am trying to embed JavaScript into pdf that is created using iTextSharp and it is working absolutely fine if it is a file as shown in the code. But when I try to embed the javascript part into a memory stream it is not working. Are there any limitations of iTextSharp?? Dim js As New StringBuilder Dim pdf As String = "c:\Print2Printer.pdf" Dim writer As PdfWriter = PdfWriter.GetInstance(doc, New FileStream(pdf, FileMode.Create)) doc.Open() js.Append("var pp = this.getPrintParams();") js

How to redact PDF using iTextSharp?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 15:03:23
问题 I want to programatically redact a PDF file using my C# code. I know that it is hard. Is it possible using itextsharp ? or what is the alternative. 回答1: As the OP clarified in comments to the Question: the marked/removed text should not appear in print / view of the pdf Thus, here a simple solution which is merely painting a black rectangle over the text. The text beneath won't appear in print and wont be immediately visible in a PDF viewer. But it will be there, still, and can be extracted e

Using iTextSharp to print a PDF with multiple tables

一笑奈何 提交于 2019-12-30 14:16:08
问题 I have a detailed bill to print that pulls up billing details from various departments. I need them to be printed on a PDF. But I use plenty of select procedures as I have to display a lot of tables so I need code that I can reuse. 回答1: The namespaces I used: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.IO; using

Adding a WMF to a PDF using iTextSharp

心不动则不痛 提交于 2019-12-30 14:10:13
问题 I am completely unable to get a WMF file onto a PDF using iTextSharp. I specifically want to use WMF because it is a vector based file. My WMF file is coming from a Chart control. The code to reproduce this is Very Easy. Create a new Windows Form project. Add a Chart control onto Form1. Then add the below code: Add this using directive using iTS = iTextSharp.text; And add the below code to your Form1.cs file: private void Form1_Load(object sender, EventArgs e) { Document pdfDoc = new Document

How to Insert HTML markup using iTextSharp for creating PDF using C#?

自作多情 提交于 2019-12-30 13:45:10
问题 I am new to iTextSharp API to create PDF . I want to Create the a PDF similar shown in following image: I have added Table( PdfPTable ) to Display the Left part (Text other than the Orange Bordered) protected void CreatePDF() { //Create PDF slip PdfPTable pdfTabdevices = new PdfPTable(2); DataTable dt = Session["MyList"] as DataTable; pdfTabdevices = GetDataFromSQLTable(dt);//Get the device lists Document doc = new Document(iTextSharp.text.PageSize.A4, 20, 20, 42,35);//iTextSharp.text

Bold some text in Pdf List

℡╲_俬逩灬. 提交于 2019-12-30 11:29:32
问题 I am displaying some content in a List to show it in a pdf file. Every thing is working fine , but Now I want some text in a List Item Should be Bold. For Example : This is ListItem Bold Text. How can I do this ? Here is my code : List lst_note = new List(List.ORDERED); lst_note.IndentationLeft = 10f; lst_note.Add(new iTextSharp.text.ListItem("This single **word** should be Bold", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 10))); disclaimer.Add(lst_note); EDIT I've tried this : Font bold =

Reading PDF Bookmarks in VB.NET using iTextSharp

大憨熊 提交于 2019-12-30 11:13:05
问题 I am making a tool that scans PDF files and searches for text in PDF bookmarks and body text. I am using Visual Studio 2008 with VB.NET with iTextSharp. How do I load bookmarks' list from an existing PDF file? 回答1: It depends on what you understand when you say "bookmarks". You want the outlines (the entries that are visible in the bookmarks panel): The CreateOnlineTree examples shows you how to use the SimpleBookmark class to create an XML file containing the complete outline tree (in PDF