Questions tagged [itext7]

Library to create and manipulate PDF documents in Java and C#. Use this tag for code using iText version 7 and higher. Use the "itext" tag for older versions up to 5.5.x. Remember to also add a tag for the language you're using.

For more on iText, see here.

For more on the differences between iText 5 and iText 7, see here.

2125 questions
5
votes
1 answer

Get the Creation Date of a PDF file using iText 7

I have to create a tool which adds to several .pdf file names their creation date. I'd like to use the creationdate stored internally in pdfs and for this I downloaded iText Community Edition. Now, my code starts like this (VB) Module Module1 …
4
votes
2 answers

iText7 AbstractITextEvent is only for internal usage

I am trying to create a new PDF file in the public Documents folder. iTex7 is launched directly from a Dialog created by an external library com.afollestad.materialdialogs.MaterialDialog. lateinit var writer : PdfWriter path =…
4
votes
1 answer

iText 7 (Java) When Large Table extend to next page it does not draw bottom border

In my report generation java application with iText 7, I need to get data from a large data tables which may extend to several pages. My code segments to generate the table. Table table = new Table(new float[] {0.4f, 1f, 1f, 1f, 1.3f, 1f, 1.3f,…
Vikum Dheemantha
  • 764
  • 8
  • 24
4
votes
0 answers

C# Itext7 Using Arabic text

I need to show some information in Arabic using Itext7 using C#.NET Framework. I used Itext7 to fill many pdf files in english with no problems,but when i used the same method with arabic text the pdf file shows up a blank page can any one please…
SAAD K
  • 51
  • 3
4
votes
0 answers

How to use @font-face in iText7 pdfHTML?

I have added a directory containing Roboto font to the FontProvider. The Pdf can find Roboto font, but it doesn't work as expected. It always uses Roboto-Black when I use font-weight: 900; font-style: Bold; and Roboto-Light instead of…
4
votes
1 answer

In iText 7 why checkbox is being checked if wrong value is set and CheckType changes from CHECK to CROSS

I am using iText 7 java library. Here are my gradle dependencies. compile group: 'com.itextpdf', name: 'kernel', version: '7.1.9' compile group: 'com.itextpdf', name: 'layout', version: '7.1.9' compile group: 'com.itextpdf', name: 'forms', version:…
Rakesh Prajapati
  • 1,078
  • 8
  • 17
4
votes
2 answers

How to get the total page number in iText7 when adding that info to the document footer?

In iTextSharp, we can override the OnCloseDocument() event and add the Page # of #total on the footer of the document. However, the PdfDocument does not have this document close event anymore. Since we cannot determine the total number of pages…
Baolin Li
  • 103
  • 1
  • 7
4
votes
1 answer

iText 7 Merge Documents from Byte Array

I used iTextSharp in order to merge two documents from byte arrays like this: using (MemoryStream ms = new MemoryStream()) using (Document doc = new Document()) using (PdfSmartCopy copy = new PdfSmartCopy(doc, ms)) { // Open document …
Tom el Safadi
  • 6,164
  • 5
  • 49
  • 102
4
votes
1 answer

iText 7 table's bottom border not being drawn

I am using iText 7 for creating a table inside the PDF file. I have successfully created the table but the table's bottom border is not being drawn. Screenshot of the Result: My Code: private void Convert() { String dest =…
4
votes
2 answers

iText 7 - HTML to PDF write to MemoryStream instead of file

I'm using iText 7, specifically the HtmlConverter.ConvertToDocument method, to convert HTML to PDF. The problem is, I would really rather not create a PDF file on my server, I'd rather do everything in memory and just send it to the users browser…
Phil
  • 4,029
  • 9
  • 62
  • 107
4
votes
1 answer

Adding page number text to pdf copy gets flipped/mirrored with itext 7

So... I've been trying to use the example provided in the documentation of itext for merging documents and creating a TOC for the merged result. But the part that adds page number text to every page isn't working as I would expect. What happens is…
aibanez
  • 43
  • 6
4
votes
2 answers

How to get vertical cursor position when writing document in iText 7?

In iText 5 there is a method named getVerticalPosition() which gives the position on the page for the next object written. As answers this question How to find out the current cursor position on a page? and which is documented here What is the…
Halcyon
  • 1,376
  • 1
  • 15
  • 22
4
votes
1 answer

itext 7.1.2 percent table width

There is a iText 7.0.7 method of table that works: Table table = new Table(new float [] {4,1,3,4,3,3,3,3,1}); table.setWidthPercent(100); But in iText 7.1.2 this method is not found: table.setWidthPercent(100); They know what the new method is or…
4
votes
2 answers

Adding Headers, Footers, and Page Numbers to HTML Page Converted to PDF iText 7

Hello everyone and thanks for your help in advance. I am learning iText 7 and am creating an application that pulls a webpage from a URL and converts it to PDF. I've got the very basic pieces working, i.e. grabbing the page, converting it to PDF,…
kmcnet
  • 115
  • 1
  • 2
  • 11
4
votes
0 answers

How does one prevent text from breaking across pages in a PDF created by itext7.pdfhtml?

I am using itext7 version 7.1.2 and itext7.pdfhtml version 2.0.2 to produce a PDF from some HTML containing elements which must not break across pages (e.g. graphs and their accompanying text). I have tried using explicit page breaks (as was used…
Matt Arnold
  • 668
  • 2
  • 8
  • 21