itextsharp

pdf file not showing up in Internet explorer

守給你的承諾、 提交于 2019-12-11 00:34:48
问题 Language : ASP.NET/VB.NET I am creating pdf file using itextsharp library. On my development machine generated files are opening up without any problem. But when I upload the compiled program on production server, internet explorer just open and close the window but does not show the pdf file. Other browsers are showing up the pdf file. Here is the code I am using Dim LABNO As Integer = Request.QueryString("LABNO") Dim vDoc As New iTextSharp.text.Document(PageSize.A4, 20, 20, 50, 50) Dim

Itextsharp gradient background

不想你离开。 提交于 2019-12-11 00:34:14
问题 Is there way to set gradient background to pdfcell or paragraph? Or do I have to use image? 回答1: Yes, iText and iTextSharp support gradient colors. The PdfShading object has several static methods that create different types of PdfShading objects for you. The two that you are probably most interested in are SimpleAxial and SimpleRadial . There's three others named Type1 , Type2 and Type3 that I haven't explored yet. Once you have a PdfShading object you can create a PdfShadingPattern directly

Image resizes when inserted in PdfCell

淺唱寂寞╮ 提交于 2019-12-11 00:29:13
问题 I'm trying to create Pdf using itextsharp. I have added one table conataining two columns one containing text and other image. I want to have constant image size My Image automatically resizes if the text present in another cell increases and image present in other cell has different sizes for (int i = 0; i < visitInfo.VisitsiteComplience.Count; ++i) { cellprop.Colspan = 1; cellprop.Pharse = visitInfo.VisitsiteComplience[i].Compliencedescription; cellprop.BaseColor = null; table.AddCell

What is the size limit of pdf file when generated using c# code with images?

只谈情不闲聊 提交于 2019-12-10 21:33:49
问题 I am using web application to generate PDF file using C# code. PDF file contains .tiff images. If size of a folder containing images goes beyond 1GB then browser gets closed automatically. What is the size limit of images to generate PDF file using C# code? 回答1: The answer to your question depends on three parameters: The PDF version: before PDF 1.5 vs. PDF 1.5 and higher, the PDF style: plain text cross-reference table vs cross reference stream, and the iText(Sharp) version: before 5.3 vs 5

How to use non breaking space in iTextSharp

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 21:19:46
问题 How can the non breaking space can be used to have a multiline content in a PdfPTable cell. iTextSharp is breaking down the words with the space characters. The scenario is I want a multiline content in a table head, such as in first line it may display "Text1 &" and on second line it would display "Text", on rendering the PDF the Text1 is displayed in first line, then on second line & is displayed and on third it takes the length of the first line and truncates the remaining characters to

C# ItextSharp Fontawesome Icons ( currency ) - PDF

狂风中的少年 提交于 2019-12-10 21:08:37
问题 i have problem is importing the icons (fontawesome-webfont.ttf) and showing them on PDF -but i am unable to show them on the PDF especialy currency icon (fa-money) some of the icons i was able to get it from the CultureInfo class if any thing i missed apart from this chunkRows = new Chunk(val.ToString("C", new CultureInfo(strCulture)) + " ", rowFont); How can i solve this problem needed help Code--- var fontAwesomeIcon = BaseFont.CreateFont(fontpath + "fontawesome-webfont.ttf", BaseFont

Does MultiColumnText Work in iTextSharp v5.3.3?

不问归期 提交于 2019-12-10 20:18:02
问题 I can't find MultiColumnText anywhere in iTextSharp v5.3.3 (from NuGet). All I can find is ColumnText which certainly isn't as friendly to use and is more than I really need. Am I missing something? There are several links that say that MultiColumnText should exist. http://api.itextpdf.com/itext/com/itextpdf/text/pdf/MultiColumnText.html itextsharp nextcolumn not working http://www.mikesdotnetting.com/Article/89/iTextSharp-Page-Layout-with-Columns http://www.devshed.com/c/a/Java/Adding

Trying to insert an image into a pdf‏ in c#

眉间皱痕 提交于 2019-12-10 20:05:21
问题 I need to insert an image based on a generated barcode file. The problem I'm having is when using the iTextSharp library I can normally fill in text such as PdfReader pdfReader = new PdfReader(oldFile); PdfStamper pdfStamper = new PdfStamper(pdfReader, outFile); AcroFields fields = pdfStamper.AcroFields; fields.SetField("topmostSubform[0].Page1[0].BARCODE[0]", "X974005-1"); though there's one field where in pdf if I click onto it it prompts me for an image to insert into field, but I can't

MVCRazorToPdf (iTextSharp) using custom font

本秂侑毒 提交于 2019-12-10 19:37:20
问题 I am trying to add a custom font to my pdf output using the nuget package MVCRazorToPdf but I am having trouble with how to do this as the documentation for iTextSharp isn't great and all seems to be outdated. The current code I have for creating the pdf is: return new PdfActionResult( "test.cshtml", new TestModel(), (writer, document) => { FontFactory.Register(HostingEnvironment.MapPath("~/content/fonts/vegur-regular-webfont.ttf"), "VegurRegular"); }); Where writer is a PdfWriter and

itextsharp add 1 page template to all pages

萝らか妹 提交于 2019-12-10 19:33:08
问题 I'm creating a PDF file dynamically in an ASP.Net application. The data can vary from spanning 1 page to over 10 pages. I'm using PdpfTables and Cells to align the data which is working perfectly. IT's creating pages as it needs new pages. The only problem is I can't get it to add my template to all pages, only the first page. My Template is a 1 page PDF file. To add it to the first page I'm using the following code PdfContentByte cb = writer.DirectContent; cb.AddTemplate(page, 0, 0); As I