0

I'm trying to convert a JTable on a PDF document using the iText library, looking for a solution I found this question which solves my problem: [1] Fitting a JTable in an iText PDF Document.

Although I have a problem in this line:

PdfPTable pdfTable = new PdfPTable(table.getColumnCount());

When I try to create my PdfTable it tells me that:

pdfTable cannot be applied to given tipes

and I dont know the reason why.

Frakcool
  • 10,915
  • 9
  • 50
  • 89
  • 2
    We don't know either... Since 1) You posted no code (a [mcve]), 2) You're not saying which version of `iText` you're using (5 or 7?) They differ from each other. And since we don't know any of them, we can't help you. Please [edit] your question to add those details into it. You may also want to [check my answer](https://stackoverflow.com/a/42538618/2180785) – Frakcool Sep 25 '17 at 14:22
  • 1
    The question is riddled with errors. `PdfPTable` is an iText 5 class, but it's very different from `PdfTable`. **You should never use `PdfTable` since that class is for internal use only.** Actually, the fact that `PdfTable` is mentioned tells me that you're using on old version of iText. You really should upgrade. Also, I can't imagine that iText would throw an error with the typo `tipes`. Finally, you say you found a question that *solves* your problem, but you immediately contradict yourself by saying that a problem occurs (telling us that your problem isn't solved). – Bruno Lowagie Sep 25 '17 at 14:37
  • `PdfPTable` excludes iText 7, so it must be iText 5. Maybe iText 2, but that should really be discouraged. – Amedee Van Gasse Sep 25 '17 at 14:37

0 Answers0