itextsharp

How to display indian rupee symbol in iText PDF in MVC3

寵の児 提交于 2019-12-01 19:52:38
I want to display Special Character India Rupee Symbol in iTextPDf, My Code: Font fontRupee = FontFactory.GetFont("Arial", "₹", true, 12); Chunk chunkRupee = new Chunk(" ₹ 5410", font3); It's never a good idea to store a Unicode character such as ₹ in your source code. Plenty of things can go wrong if you do so: Somebody can save the file using an encoding different from Unicode, for instance, the double-byte rupee character can be interpreted as two separate bytes representing two different characters. Even if your file is stored correctly, maybe your compiler will read it using the wrong

iTextSharp RenameField bug?

半世苍凉 提交于 2019-12-01 19:52:28
I am attempting to rename a checkbox that is subclassed. Let's say the checkbox's name is MyForm.Check1.page0. When I run: reader.AcroField.RenameField("MyForm.Check1.page0", "MyForm.Check1.newName"); The checkbox is renamed just "newName". The subclass information is dropped. I get from the documentation that the subclass cannot be changed, but this was unexpected. According to the documentation: "Renames a field. Only the last part of the name can be renamed. For example, if the original field is "ab.cd.ef" only the "ef" part can be renamed." It has been a long day but I would read that to

Header and Footer in ITextSharp

好久不见. 提交于 2019-12-01 19:33:20
I know this question has been asked a thousand times, but I am yet to find a straight forward answer. I am relatively new to ITextSharp, so please explain as if you were talking to a toddler. How can I add a simple text only header and footer to the document I am creating? I am creating a simple pdf document with the following code: void Button1Click(object sender, EventArgs e) { Document doc = new Document(iTextSharp.text.PageSize.LEDGER, 10, 10, 42, 35); PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream(@"File Path", FileMode.Create)); doc.Open(); Paragraph par1 = new Paragraph(

Can I use iText to render PDF in my Swing application?

落花浮王杯 提交于 2019-12-01 18:42:18
Can iText render PDF documents in Swing application ? Or do I have to use another library/framework for that? iText is for producing PDF files programmatically (e.g. converting from HTML to PDF, or producing PDF reports.) To view PDF you could use a library like ICEpdf There is also an open source/commercial versions of JPedal and Suns PDFRenderer. 来源: https://stackoverflow.com/questions/2717522/can-i-use-itext-to-render-pdf-in-my-swing-application

Reversing Strings in Right To Left (BiDirectional) Languages in iTextSharp

假如想象 提交于 2019-12-01 18:20:30
I'm using iTextSharp( C# iText port) to create pdfs from text/html. Most of my text is in Hebrew, a Right-To-Left language. My problem is that PDFs show RTL langauge in reverse, so I need to reverse my strings in a way that would only reverse the RTL text without reversing any numbers or text in English. It is my understanding that fribidi allows doing that on linux, but I couldn't find any solutions for this problem for Windows. I would welcome any suggestions, including an alternative to iTextSharp that would do this automatically (if one exists). To show RTL texts by using iTextSharp

Unable to vertically align text in table cell with itextsharp

只愿长相守 提交于 2019-12-01 18:13:19
问题 I can not figure out how to vertically align text in table cell. horizontal alignment is ok. I use itextsharp to generate pdf. Alignment should be applied to cells in table kitosKalbosTable. Any help would be appreciated. here's my code: var table = new PdfPTable(new float[] { 36, 1, 63 }); table.WidthPercentage = 100.0f; table.HorizontalAlignment = Element.ALIGN_LEFT; table.DefaultCell.Border = Rectangle.NO_BORDER; table.SplitRows = false; ......... PdfPTable kitosKalbosTable = new PdfPTable

iTextSharp: which alignment properties are used in a PdfPCell?

爱⌒轻易说出口 提交于 2019-12-01 18:01:06
When I use the alignment of the cell so it works: PdfPCell cell1 = new PdfPCell(new Phrase("Text" , Font)); cell1.HorizontalAlignment = 2; But once the alignment does not work: PdfPCell cell1 = new PdfPCell(); cell1.AddElement(new Phrase("Text 1", Font)); cell1.AddElement(new Phrase("Text 2", Font)); cell1.HorizontalAlignment = 2; The reason? You are confusing text mode with composite mode . In the first code snippet, you work in text mode . This means that the content of the cell is considered to be text only and the properties of the cell are respected, whereas the properties of the elements

Reversing Strings in Right To Left (BiDirectional) Languages in iTextSharp

浪尽此生 提交于 2019-12-01 17:51:30
问题 I'm using iTextSharp( C# iText port) to create pdfs from text/html. Most of my text is in Hebrew, a Right-To-Left language. My problem is that PDFs show RTL langauge in reverse, so I need to reverse my strings in a way that would only reverse the RTL text without reversing any numbers or text in English. It is my understanding that fribidi allows doing that on linux, but I couldn't find any solutions for this problem for Windows. I would welcome any suggestions, including an alternative to

Unable to vertically align text in table cell with itextsharp

随声附和 提交于 2019-12-01 17:44:43
I can not figure out how to vertically align text in table cell. horizontal alignment is ok. I use itextsharp to generate pdf. Alignment should be applied to cells in table kitosKalbosTable. Any help would be appreciated. here's my code: var table = new PdfPTable(new float[] { 36, 1, 63 }); table.WidthPercentage = 100.0f; table.HorizontalAlignment = Element.ALIGN_LEFT; table.DefaultCell.Border = Rectangle.NO_BORDER; table.SplitRows = false; ......... PdfPTable kitosKalbosTable = new PdfPTable(new float[] {10, 30}); kitosKalbosTable.TotalWidth = 40f; kitosKalbosTable.SplitRows = false;

How can i set an image to a pdf field in existing pdf file?

早过忘川 提交于 2019-12-01 17:32:18
How can i set an image to a pdf field in existing pdf file? I'm using the iTextSharp object. Setting the text field is working fine. No problem in it. pdfFormFields.SetField("Firstname", "Mujeeb"); Please help. Remove the Text field and replace it with a Pushbutton field of the same size and position. If you set the Pushbutton to READ_ONLY then it can't be pressed and it will look like a static image. This keeps the image you're trying to add as a field annotation instead of adding it to the page content. void ConvertTextFieldToImage(string inputFile, string fieldName, string imageFile, string