Questions tagged [itextpdf]

itextpdf is part of the package name of iText, a PDF library available on itextpdf.com

Questions about the Java version of iText and the C# version of iText (aka iTextSharp) are usually posted using the tag.

227 questions
1
vote
1 answer

NullPointerException in itextpdf during Form flattening with Acrofields

I have a six page PDF with some acrofields on each page. I have deleted page 4 and 5 using following code : List pagesToKeep = Arrays.asList(new int[]{ 1, 2, 3 }); pdfReader.selectPages(pagesToKeep); But then on Form freezing using…
Narendra
  • 151
  • 1
  • 12
1
vote
0 answers

Android iTextPdf utf-8 not working

I am trying to get font with UTF-8, but no success. Currently i use: PdfPCell cell = new PdfPCell(new Paragraph(new String("čšđćž".getBytes("UTF-8")), new Font(Font.FontFamily.TIMES_ROMAN, 14))); I get only: šž, so it is font problem?
bostek
  • 59
  • 5
1
vote
0 answers

Filling up columns equally in iText(2) MultiColumnText

I'm using a MultiColumnText element to layout out elements in three columns. It now looks like this: some text on the first page... Element1 Element4 Element2 Element5 Element3 Element6 -pagebreak- Element7 …
trainrobbery
  • 500
  • 3
  • 14
1
vote
1 answer

ItextPdf : get Y position

I'm using itextpdf 5 in my project I want to draw a change bar for any element. My method drawBar take in input Y1 and Y2 positions like this : drawBar(float y1, float y2, PdfWriter writer){ // draw bar } But I dont know how to get Y position for…
Valeriane
  • 936
  • 3
  • 16
  • 37
1
vote
0 answers

Html to PDF , text inside
 not coming good in PDF

I am trying to convert html to pdf with iText API(itextpdf.5.5.7.jar, xmlworker 5.5.7.jar), everything is good except the text inside the pre tag. In html the text inside the pre is good but in PDF the formatting is totally gone and simply coming in…
1
vote
1 answer

How to insert bytes into a PDF then separate it without affecting the file?

I'm trying to make signatures for some PDF files, it should have been easy. But my country created a set of standards. Following these standards, I have to upload my files to a third-party API and get a signature file(SF) in return. If I want to…
Elderry
  • 1,902
  • 5
  • 31
  • 45
1
vote
1 answer

What is the purpose of using writeSelectedRows method in itextpdf?

I am using code like this: upperTable.writeSelectedRows(1, -1,40,734,cb); I am new in ItextPdf. What purpose of using writeSelectedRows method?
Nirmala Mary
  • 31
  • 2
  • 7
1
vote
2 answers

The document has been closed. You can't add any Elements

I am using the below code: protected void buildPdfDocument(Map model, Document document, PdfWriter writer, HttpServletRequest request,HttpServletResponse response) throws Exception { try { …
Nirmala Mary
  • 31
  • 2
  • 7
1
vote
1 answer

how should one embed Helvetica to make itext tutorial example work?

I am trying to make the code at PDFA tutorial work by adapting it to Groovy, and as soon as I add some content to my PDF I get a PdfAConformanceError All the fonts must be embedded. This one isn't. Helvetica Should the tutorial help me here or am I…
john renfrew
  • 393
  • 1
  • 9
  • 30
1
vote
1 answer

itextpdf : MarkedObject use

What is the interest of using MarkedObject in itext pdf ? Show a main use example please. There is only javadoc on the net related to this object.
Valeriane
  • 936
  • 3
  • 16
  • 37
1
vote
1 answer

Image in mode mosaic in PdfPCell

I am currently using itextPdf library to generate PDF file. For to set an image I used this solution of itextpdf.com Now I want to set a small size image as a background in PdfPCell in mode mosaic : if cell have 3 x ImageSize, in PDF I will have my…
Valeriane
  • 936
  • 3
  • 16
  • 37
1
vote
0 answers

iTextPDF - Unable to use getOverContent() as a paremeter for table.writeSelectedRows() when internal anchors have been added to the table

I've been trying to create a table of contents which dynamically links to other pages in the PDF using anchors. I've ran into an issue with using stamper.getOverContent() as the canvas parameter in the method…
Smittey
  • 2,475
  • 10
  • 28
  • 35
1
vote
1 answer

iTextPDF - Cannot use writeSelectedRows() on a table where an anchor has been inserted

I am in the process of converting the contents page of my PDF from using page numbers as a hyperlink, to anchors because of a few circumstantial limitations and the linking needs to be more dynamic. I have omitted outer-loop code, but I am…
Smittey
  • 2,475
  • 10
  • 28
  • 35
1
vote
1 answer

JSF cant render PDF from iTextPDF

I'm trying to send a PDF to browser throught a JSF response, a very simple document, see: public void gerarPDF() throws IOException{ try { HttpServletResponse response = (HttpServletResponse)…
Ronaldo Lanhellas
  • 2,975
  • 5
  • 46
  • 92
1
vote
1 answer

Showing image on a acro text field position

I had a PDF document which has acro text fields which is already shared to the client. Now the client wants to insert signature image in one of the text fields. My manager asked me to try a way to do the same.My idea is to replace an image on top of…