itext

Copying fields in iTextSharp 5.4.5.0

半世苍凉 提交于 2020-01-25 14:38:05
问题 I was under the impression that it is now possible to copy AcroFields using PdfCopy. In the release notes for iText 5.4.4.0 this is listed as possible now. However, when I try to do so it appears all the annotations (I think I am using that term correctly, still fairly new to iText...) for the fields are stripped out. It looks like the fields are there (meaning I can see the blue boxes that indicate an editable field), but they are not editable. If I try to bring the PDF up in Acrobat I get a

How to tile a pdf to multiple pages with a border

走远了吗. 提交于 2020-01-25 12:05:28
问题 Using itextsharp I am trying to tile a single (large) page pdf document (called import document) into a new document where this page is split into several DIN A4 pages (called output document). But I want to draw a border around the DIN A4 pages of the output and only add a smaller than A4 size part of the import document. For clarification please see the picture: On the left is the import doc in size A3 which is like two A4 pages side-by-side (black dotted line). This shall be split to A4

How can you eliminate white-space in multiple columns using iTextSharp?

╄→尐↘猪︶ㄣ 提交于 2020-01-25 11:51:26
问题 I'd like to add a Paragraph of text to pages in 2 columns. I understand that MultiColumnText has been eliminated. I know I can create column 1, write to it, and if there is more text create column 2 and write to it. If there is still more text, go to the next page and repeat. However I always end up with either: a long chunk of text orphaned in the left column. a full left column and partially used right column. How can I format my content in 2 columns while reducing white space, such as

Extract text of PDF without tool

你说的曾经没有我的故事 提交于 2020-01-25 10:18:06
问题 Currently I'm extracting the text of PDF's with the itextsharp tool (in VB.net). I'd like to be independent of other tools / libraries as I can't give them to others along my programm. Is there a solution (no .dll etc) in any programming language to quickly extract the text of a PDF? 回答1: Short answer: Of course there is a way of doing this. iText (alongside many other PDF libraries) are capable of doing it. So there is an algorithm for extracting text. Long answer: PDF is not a WYSIWYG

How to create Header in PDF generation using C# iText7

随声附和 提交于 2020-01-25 06:56:10
问题 I tried to add Header in all the pages of my PDF using iText package in .NET C#, but it's not working. Note: I'm using iText version 7 I tried the following Stack Overflow answers, they demonstrated only for Footer (i.e., END_PAGE ) not for START_PAGE Add Header and Footer for PDF using iTextsharp My Code : class Program { static void Main(string[] args) { var writer = new PdfWriter("E:/pdfSample/bala.pdf"); var pdf = new PdfDocument(writer); var document = new Document(pdf,PageSize.A4);

Why are more Pixel used in resulting PDF than in source html?

一笑奈何 提交于 2020-01-25 02:57:09
问题 I used this Code, to Download a Webpage with an Image in the css file, but it is scaled too big in the pdf File. The Picture has 120 Pixel width and is shown 185 Pixel width. For Camparison, I Build in a 10 Pixel Line, which is shown with 12 Pixel. But why? and how can I solve it? I can't post the Question without further Details, but I don't know anything, which is usefull for you to know, but Maybe it helps: I work in a archiving Department, with the Order to archive Informations which are

How to find images in a PDF and draw another on top of it

非 Y 不嫁゛ 提交于 2020-01-25 01:22:28
问题 I have a program that convert Word docs to PDFs. After conversion, I want to find all images in the new PDF. If the image is of a specific dimension (200x100), then I want to draw another image on top of it. Better yet, if I can create a signature field and draw on top of it. Any help please? 回答1: First try this example: ExtractImages I know this example doesn't do what you need, but take a look at the MyImageRenderListener class that is used. This is an implementation of the RenderListener

Table in iTextSharp is not page breaking as desired?

*爱你&永不变心* 提交于 2020-01-24 21:48:29
问题 Problem The header is on the first page by itself. If my body has too many people in it for photos, it will print on the second page. Please see below for a graphical description of my problem: Now, please read below for some code. Please consider the following as pseudo code (because the whole code is too long), but it is very close to the code I am trying to fix. Code Header System.IO.FileInfo tempFileInfo = new System.IO.FileInfo(System.IO.Path.GetTempFileName()); tempFileInfo.MoveTo

Is it possible to have space between cells in iTextPdf?

旧城冷巷雨未停 提交于 2020-01-24 17:27:29
问题 Does iTextPdf allow to set spacing between cells in table? I have a table with 2 columns and I am trying to draw a border-bottom on cell. I want space between each border same as cell padding. I am using below code: PdfPTable table = new PdfPTable(2); table.setTotalWidth(95f); table.setWidths(new float[]{0.5f,0.5f}); table.setHorizontalAlignment(Element.ALIGN_CENTER); Font fontNormal10 = new Font(FontFamily.TIMES_ROMAN, 10, Font.NORMAL); PdfPCell cell = new PdfPCell(new Phrase("Performance",

Error converting HTML text to a pdf file using itextsharp in asp.net

吃可爱长大的小学妹 提交于 2020-01-24 14:41:09
问题 I am using the following code to convert contents in Editor(Ajax control) to pdf, using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using iTextSharp.text.html.simpleparser; using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.html; /// <summary> /// Summary description for pdfgeneration /// </summary> public class pdfgeneration { public pdfgeneration() { // // TODO: Add constructor logic here // } public void pdfgenerator