itextsharp

After filling PDF with iTextSharp, form is not savable/ usage rights removed

爱⌒轻易说出口 提交于 2019-12-13 05:38:02
问题 I am currently working on a process that will use iTextSharp to partially fill a PDF form. This form is then emailed to a user and the user will finish completing the form. Then the form is submitted by email back to our email account and then processed. My problem is that once the PDF is sent out to a user, when the user opens the form and the data can not be saved. The original PDF that is used as a template can be filled out an saved. Somehow, during the process of using iTextSharp, the

Read columns of PDF in C# using ItextSharp

北慕城南 提交于 2019-12-13 05:19:05
问题 In my progam I extracted text from a PDF file and it works well. ItextSharp extracts text from PDF line by line. However, when a PDF file contains 2 columns, the extracted text is not ok as in each line joins two columns. My problem is: How can I extract text column by column? Below is my code. PDF files are Arabic. I'm sorry my English is not so good. PdfReader reader = new PdfReader(@"D:\test pdf\Blood Journal.pdf"); int intPageNum = reader.NumberOfPages; string[] words; string line; for

iTextSharp - Reading PDF with 2 columns

試著忘記壹切 提交于 2019-12-13 05:03:46
问题 I'm having trouble reading a PDF with header and footer but with 2 columns in your body. I already have the column widths and height of the header but I need the code to read the pages with columns. Can anyone provide me a piece of code that reads PDF with columns? thank you 回答1: It's very hard to achieve what you want if you don't know the position of the columns, but I assume that you have its coordinates because you say "I already have the column widths and height". In that case, your

itextsharp error: “The document has no pages.”

笑着哭i 提交于 2019-12-13 04:59:29
问题 I set as references three dlls: itextsharp.dll: the core library itextsharp.xtra.dll: extra functionality (PDF 2!) itextsharp.pdfa.dll: PDF/A-related functionality This project is hosted on http://sourceforge.net/projects/itextsharp/ You can find the latest release here: http://sourceforge.net/projects/itextsharp/files/itextsharp/ I get an error when executing this code: On pdfDoc.Close(), "The document has no pages." Imports iTextSharp.text Imports iTextSharp.text.html.simpleparser Imports

How to shift a PDF content up down left or right using iTextSharp

混江龙づ霸主 提交于 2019-12-13 04:47:03
问题 I am wanting to find a way that I can use iText sharp to move or "shift" the content of a PDF in any direction. I am currently adding overlay art to PDF's using the Stamper and such, and have noticed there is a positional coordiate system in the method "AddTemplate() like so: AddTemplate(pageNumber, x, y) The problem is that I need to use measurements of inches. Like a 10TH OF A INCH, ect. How can I do this and how much is the x/y corrdinate move n it's position at the current moment if I do

Gridview Templatefield to PDF using iTextSharp

吃可爱长大的小学妹 提交于 2019-12-13 04:45:17
问题 I have a gridview which I'm converting to a PDF with iTextSharp. I've been following along with the method in this post. Since I'm using VB.net I've changed all the C# code over but I've been having problems with one line. if (gvReport.Columns[columnNo] is TemplateField) I don't know how to write this line in VB.net and as I have a few templatefields in my gridview (for formatting) they show up as blank in the PDF. If anyone has any ideas it would be greatly appreciated. 回答1: You can always

Create a table in a generated PDF

旧城冷巷雨未停 提交于 2019-12-13 04:35:24
问题 How to create a table in a generated PDF using iTextSharp ? I've have been trying to create a PDF document containing a table dynamically using iTextSharp . After search around, I found a few posts which helped me with a basic one. However, I wanted a table with the following structure and I am having a challenge creating it. Can someone help? 回答1: I've added a small Java example to the iText site showing how it's done: SimpleRowColspan As you can see, the result looks very much like the

iTextSharp filling forms and creating multiple pages

淺唱寂寞╮ 提交于 2019-12-13 03:55:14
问题 I have following written codes Dim template As String = Server.MapPath("files/") & "2_paged_form.pdf" Dim newFile As String = Server.MapPath("exports/") & "newFile.pdf" Dim reader = New PdfReader(template) Dim output = New FileStream(newFile, FileMode.Create, FileAccess.Write) Dim stamp = New PdfStamper(reader, output) stamp.AcroFields.SetField("client", "hello") stamp.AcroFields.SetField("name", "test test") stamp.AcroFields.SetField("address", "Hellocourt") stamp.AcroFields.SetField(

iTextSharp generates corrupted PDF file

主宰稳场 提交于 2019-12-13 03:55:04
问题 I am trying to generate a PDF file from and HTML string and external css files and save the PDF to disk. As you can see from this example, I am using very simple html. I know the css files are getting read into the ccsResolver by viewing intellisense. Here is the code I am using : internal string Create(PdfDocumentDefinition documentDefinition) { MemoryStream output = new MemoryStream(); MemoryStream input = new MemoryStream(Encoding.UTF8.GetBytes("<html><head></head><body>Hello, World!</body

Text Extraction Duplicate Bold Text

ぃ、小莉子 提交于 2019-12-13 03:35:14
问题 I am using iTextSharp Library in order to extract all the text from a PDF. It works fine but in few PDF files that I receive from a SAP all bold text is returned twice in the extracted Text. Has anyone faced something like this before? I am using PdfTextExtractor.GetTextFromPage(reader, p, new LocationTextExtractionStrategy()) and have implemented a custom TextExtractionStrategy . 来源: https://stackoverflow.com/questions/21405718/text-extraction-duplicate-bold-text