itextsharp

Where did iTextSharp's Rtf support go

心已入冬 提交于 2019-12-12 21:17:08
问题 with version 5, iText has been split into two branches - iText PDF & iText RTF. iTextSharp, which I use, seem to be iText PDF now. Is there a iText RTF port for .NET yet? I would think that iTextSharp homepage would mention this, but there is nearly no useful information, only file download, I don't even find a way to contact iTextSharp supporters or any forum for this. 回答1: The developer of the RTF code in iText has Gone Away (I don't know the reason). That RTF code was split into its own

Add Page bookmarks to an existing PDF using iTextSharp using C# code

随声附和 提交于 2019-12-12 20:27:47
问题 My requirement is same as described in this question: Bookmark to specific page using iTextSharp 4.1.6 I tried the answer, but the last line gives my the following error: Can not implicitly convert ArrayList to IList<Dictionar(strin,object)> I am not sure how to correct it. The line that gave error is, in the Answer 1 of above link wri.Outlines = bookmarks I modified the example like this: List<Dictionary<string, object>> testData = new List<Dictionary<string, object>>(100); // Just Sample

How to implement getDirectContent() itextsharp

橙三吉。 提交于 2019-12-12 18:27:07
问题 Currently I am working Generating Pdf file. My problem is that I want to print my addressTable into absolute position PdfWriter writer = PdfWriter.GetInstance(doc,stream) PdfContentByte cb = writer.getDirectContent(); ColumnText ct = new ColumnText(cb); Phrase myText = new Phrase("TEST paragraph\nNewline"); ct.SetSimpleColumn(myText, 34, 750, 580, 317, 15, Element.ALIGN_LEFT); ct.Go(); This is my code but getDirectContent() give me error. So please any body help me that how to print my

Set cell height in PDF table created with itextsharp

眉间皱痕 提交于 2019-12-12 18:27:04
问题 I used a following code to create a table in my itextsharp PDF document: foreach (var subComp in competency.SubCompetensies) { cell = new PdfPCell(new Phrase(0, subComp.DescriptionMin, _nfDescr)); cell.Padding = 5; cell.Rowspan = 2; table.AddCell(cell); cell = new PdfPCell(new Phrase(0, subComp.Name, _nfSubComp)); cell.Colspan = 10; cell.Padding = 5; table.AddCell(cell); cell = new PdfPCell(new Phrase(subComp.DescriptionMax, _nfDescr)); cell.Padding = 5; cell.Rowspan = 2; table.AddCell(cell);

Is it possible to “shrink” a PdfPtable?

戏子无情 提交于 2019-12-12 17:22:36
问题 I am currently working with Itextsharp and I have some trouble with PDfPtables. Sometimes they get too big for a page and, when added to a document, are broken up on multiple pages. Sadly ths rational behviour is not acceptable for some of my superiors - they keep insisting that the table shall be "shrunk" to a page. Is there a way to achieve this? There are some tantalizing hints that i could be possible - but hints are all that i have. What is the alternative? Perhaps I could delete the fat

itextsharp generating PDF into client browser: (Vb.net)

人盡茶涼 提交于 2019-12-12 16:15:00
问题 I'm currently trying to make itextsharp generating PDF file into the browser using .NET framework.. and yes, I'm using VB.net instead of C# here... I already compiled everything and it's no error. What makes the browser didn't send me the pdf result? I wonder if i forgotten something? Source Code: Private Sub createPDF() Using ms As New MemoryStream() Dim document As New Document(PageSize.A4, 25, 25, 30, 30) Dim writer As PdfWriter = PdfWriter.GetInstance(document, ms) document.Open()

iTextSharp - Header and Footer for all pages

夙愿已清 提交于 2019-12-12 16:10:01
问题 I'm generating PDF by adding single PdfPTable which accommodates multiple pages. Now I want to add header and footer to all these pages but it is only displaying on first page. Also margins are not working correctly. I am overriding OnStartPage/OnEndPage events of class PdfPageEventHelper. Kindly suggest best way to incorporate header and footers. Thanks 回答1: Rule #1: don't use OnStartPage() to add a header or a footer. Use the OnEndPage() method only to add both the header and the footer.

Calculate height of iTextSharp PDF document?

♀尐吖头ヾ 提交于 2019-12-12 15:24:22
问题 How can I calculate the height of the PDF document when using iTextSharp? I'm using iTextSharp to position various images on a PDF document using Absolute Position. However I've noticed SetAbsolutePosition() positions the Y parameter from the bottom, so I need to calculate the height to be able to do something like: Y = PdfHeight - i 回答1: You should be able to do that by using the PageSize, like this... int yPos = pdfDocument.PageSize.Height - i - elementHeight; i = the position you would set

How to copy form fields with PdfWriter not PdfCopy in iTextSharp

白昼怎懂夜的黑 提交于 2019-12-12 15:22:52
问题 I would like to merge two PDF files (only selected pages) and add custom headers and footers to them. Therefore I do not use PdfCopy that simply copies the page without altering it. I use the PdfWriter . The problem is I do not know how to copy AcroFields, Acroforms, Annotations and everything else except content with the PdfWriter . Do you know how to do this? 回答1: You want to use the GetImportedPage method of the PdfWriter class. This copies everything into a PdfImportedPage that you can

When I extract text from a PDF file using iText I am getting values from previous pages

孤人 提交于 2019-12-12 14:42:47
问题 I am trying to extract a block of text from a specific location from each page in a multiple page PDF file. I have the location of the text, and I am able to extract it correctly on the first page. However on the pages after the first page, the text extracted seems to be accumulating. For example if the text value on page 1 is "A", page 2 is "B" and Page 3 is "C" then I am receiving the following values in my output string for each iteration through my FOR loop: Loop1 : output = A Loop2 :