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
24
votes
2 answers

Adding a new page in PDF using itext 7

I'm trying to create a PDF Document using iText 7 with below code and my PDF documents contents are overlapping in same page when generated.(i.e in Page 1). I see the document.newPage(); method is missing in iText 7. How can i add pages to my PDF…
Karthick Radhakrishnan
  • 1,151
  • 3
  • 12
  • 32
18
votes
7 answers

Is it possible to merge several pdfs using iText7

I have several datasheets for products. Each is a separate file. What I want to do is to use iText to generate a summary / recommended set of actions, based on answers to a webform, and then append to that all the relevant datasheets. This way, I…
Matt
  • 1,596
  • 2
  • 18
  • 32
17
votes
3 answers

Itext7 generate pdf with Exception "Pdf indirect object belongs to other PDF document. Copy object to current pdf document."

i want to generate a pdf with itext 7,but some wrong happens to us: com.itextpdf.kernel.PdfException: Pdf indirect object belongs to other PDF document. Copy object to current pdf document. at…
Cheng.T
  • 337
  • 1
  • 2
  • 9
13
votes
5 answers

Import itext-7 in android gradle

I am trying to add itext-7 to android, after adding the following in gradle compile 'com.itextpdf:root:7.0.0' I am still not able to find the classes of itext e.g PDFWriter etc. Please let me know if there's separate version for itext-7 for…
Ajji
  • 3,068
  • 2
  • 30
  • 31
13
votes
1 answer

What replaces chunk in iText 7?

Attempting to use iText 7 in java. Want to have part of a paragraph be bold. Apparently in earlier releases this was done by formatting "chunks" separately then adding them to the paragraph. Apparently "chunks" don't exist in iText 7. What is…
OldAndTired
  • 155
  • 1
  • 7
11
votes
4 answers

Continuous text in text-area cuts the PDF overflowing the text when using Itext 7.1.7

I see there are lot many questions related to the same scenario this one is little different couldn't figure out the solution. I have a in a tabl in a cell. When I give the continous text like…
Juke
  • 1,306
  • 2
  • 11
  • 27
11
votes
2 answers

How to set orientation to Landscape in iText 7

I am converting html to pdf using iText7 with method convertToPdf(). PDF is getting generated properly but Landscape mode is not working. Can some one tell how to get Landscape mode? import com.itextpdf.html2pdf.ConverterProperties; import…
NeedToLearn
  • 147
  • 1
  • 2
  • 11
11
votes
2 answers

Stamp on certain location of pdf using iText

I was trying to get the location using javascript and passed the coordinates to apply stamp on the stamp but it does not work properly. Below is the function I used to capture the coordinates of the mouse pointer. function divMove(e){ var div =…
10
votes
3 answers

Is there any way to keep whitespaces before text in iText7?

I've added a Text object that start with whitespaces to the Paragraph object, but the whitespace of paragraph is removed in iText7(7.0.4). It looks like left trim. Is this a specification of Paragraph? Is there any way to keep whitespaces before…
Franken
  • 157
  • 2
  • 9
10
votes
1 answer

iText 7.0.4.0 - Converting PdfDocument to byte array

I'm attempting to split a PDF file page by page, and get each page file's byte array. However, I'm having trouble converting each page to byte array in iText version 7.0.4 for C#. Methods referenced in other solutions rely on PdfWriter.GetInstance…
James.K
  • 125
  • 1
  • 1
  • 7
10
votes
1 answer

What's itext 7 equivalent to pdfstamper class in itext 5

I trying to convert from iText5 to iText7. Got the package for iText7 from Nuget.
u-xas
  • 111
  • 1
  • 1
  • 3
10
votes
4 answers

how set custom color using itext 7

I cannot find a solution for a very simple question, how can I set a custom color for a text/line/etc. using iText7 in java code? I found this reply for iText5 but in version 7 there is no BaseColor class...
Balagex
  • 121
  • 1
  • 1
  • 5
10
votes
1 answer

How to add a "Page X of Y" footer in iText 7

I'm trying to figure out how to add a "Page X of Y" footer to each page in a PDF document, which I'm generating using iText 7. Using an IEventHandler to generate the "Page X" part seems fairly straightforward - it's the "of Y" bit that I'm…
Dan King
  • 3,412
  • 5
  • 24
  • 23
9
votes
2 answers

iText 7 borderless table (no border)

This code below does not work. Table table = new Table(2); table.setBorder(Border.NO_BORDER); I am new to iText 7 and all I wanted is to have my table borderless. Like how to do it?
The Newbie
  • 151
  • 1
  • 1
  • 12
8
votes
3 answers

iText7 convert HTML to PDF "System.NullReferenceException."

OLD TITLE: iTextSharp convert HTML to PDF "The document has no pages." I am using iTextSharp and xmlworker to convert html from a view to PDF in ASP.NET Core 2.1 I tried many code snippets I found online but all generate an exception: The…
Stefano Balzarotti
  • 1,760
  • 1
  • 18
  • 35
1
2 3
99 100