itextsharp

How to create and fill out a PDF form

谁说我不能喝 提交于 2019-12-22 17:32:03
问题 background of the issue: I may get different kind of templates which contains controls(Text Box, check box) some times in a paper/word document.pdf document templates. Now i have to assign values in that provided templates, and have to save it as pdf document. So i found some thing useful for templating called Openoffice,from there i am able to add controls and able to save as pdf template document. Now for that template need to assign values, for that found one dll called iTextSharp. based

How to create and fill out a PDF form

淺唱寂寞╮ 提交于 2019-12-22 17:31:58
问题 background of the issue: I may get different kind of templates which contains controls(Text Box, check box) some times in a paper/word document.pdf document templates. Now i have to assign values in that provided templates, and have to save it as pdf document. So i found some thing useful for templating called Openoffice,from there i am able to add controls and able to save as pdf template document. Now for that template need to assign values, for that found one dll called iTextSharp. based

Image not sequentialy added in pdf document itextsharp (wrong order of elements)

守給你的承諾、 提交于 2019-12-22 10:36:19
问题 i am working with iTextSharp (5.4.5) for a couple of weeks now. This week, i encountered something strangew hen it comes to the order of elements in the documents. I am working on a pdf report that contains topics and images (charts). The document is formatted this way: NR. TOPIC TITLE FOR TOPIC 1 CHART IMAGE for topic 1 (from bytearray) NR. TOPIC TITLE FOR TOPIC 2 CHART IMAGE for topic 2 ... below is a sample of code. I know code is not completely correct but it's just to point the issue.

Is it possible to load XMP file in PDF using iTextSharp?

陌路散爱 提交于 2019-12-22 09:20:02
问题 I am having PDF file and XMP file separately by using acrobat I am loading the XMP file in the PDF. But I want to do this process by automation, so is there is any way to load the XMP file data into PDF file using iTextSharp? Process I am using in Acrobat to load XMP file. 回答1: You can set XMP metadata in an existing PDF file using PdfStamper: PdfReader reader = new PdfReader("in.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileStream("out.pdf", FileMode.Create)); byte[] xmp; //

iTextSharp with a Windows 10 Universal App

霸气de小男生 提交于 2019-12-22 08:44:42
问题 Is there a way to get iTextSharp to work with a Windows 10 Universal app? When I try to add iTextSharp version 5.5.8 through the NuGet package manager I get the following errors: iTextSharp 5.5.8 is not compatible with UAP, Version=v10.0(win10-XXX) Some packages are not compatible ith UAP,Version=v10.0(win10-XXX) Where XXX is the platform like x64 or x86. We use iTextSharp in a Windows 8 Store app to take a PDF template and then populate the fields with data provided by the user. The user

Using different fonts in PDF using iTextSharp and PDFStamper

拥有回忆 提交于 2019-12-22 08:26:11
问题 I'm using iTextSharp to load an existing PDF and adding text using the PdfStamper. I want full control over the text, meaning I want to be able to control the font (only TrueType), font size and coordinates. Right now, I'm using ShowTextAligned to add text to certain coordinaties and setFontAndSize to set the font and font size. This is my code to add text: private void AddText(BaseFont font, string text, int x, int y, int size) { pdf.BeginText(); pdf.SetFontAndSize(font, size); pdf

itextsharp does not care my html styles

青春壹個敷衍的年華 提交于 2019-12-22 08:25:23
问题 I create a panel in my page and i create dynamically divs and tables in page. When I convert to pdf with itextsharp it does not care my div or table styles and it gives me nasty look. How can I fix this. Here is my code to convert html. String HTML = Session["xpdf"].ToString(); string filename = "\\xpdf\\xpdf____" + Request.QueryString["id"] + ".pdf"; string filepath = HttpContext.Current.Server.MapPath("\\xpdf\\xpdf____" + Request.QueryString["id"] + ".pdf"); Document document = new Document

How to make a particular sub-string Bold while printing a string in Pdf using iText in java eclipse?

瘦欲@ 提交于 2019-12-22 08:16:36
问题 I am using iText in Java to convert a HTML to PDF. I want a particular paragraph which has some words as Bold and some as Bold+Underlined to be passed as a string to the Java code and to be converted to PDF using the iText library. I am unable to find a suitable method for this. How should I do this? 回答1: If you want to convert XHTML to PDF, you need iText + XML Worker. You can find a number of examples here: http://itextpdf.com/sandbox/xmlworker The most simple examples looks like this:

How can I add two rows in a single pdf cell?

只愿长相守 提交于 2019-12-22 06:28:36
问题 I am generatng barcode. Now I want to insert the student code under the barcode label. How can I do this?My code is foreach (GridViewRow row in grdBarcode.Rows) { DataList dl = (DataList)row.FindControl("datalistBarcode"); PdfContentByte cb = new PdfContentByte(writer); PdfPTable BarCodeTable = new PdfPTable(6); BarCodeTable.SetTotalWidth(new float[] { 100,10,100,10,100,10 }); BarCodeTable.DefaultCell.Border = PdfPCell.NO_BORDER; Barcode128 code128 = new Barcode128(); code128.CodeType =

Unable to use iTextSharp with ASP.NET 5 Core

风格不统一 提交于 2019-12-22 05:58:39
问题 I'm trying to use iTextSharp with ASP.NET 5 Core. However I get these errors when I'm trying to build the ASP.NET application with iTextSharp 5.5.5 Code: using Microsoft.AspNet.Mvc; using System.IO; using System; using iTextSharp; using iTextSharp.text; using iTextSharp.text.pdf; // For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 namespace MyNamespace { public class GenerateFileController : Controller { // GET: /<controller>/ public