Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Covert a PDF to PDF/A format using iText

 
Anup Bansal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to convert PDF files to conform to PDF/A format.
How can I achieve this? Can I use iText.jar for this?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think so; iText is for creating PDFs, not for making structural changes after the fact.
 
Anup Bansal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried iText by first reading a PDF and then re-creating the PDF with the PDF version set 10 1.4 and conformance set to PDF-1A.
I validated the generated PDF using an external tool but it gave some issues.

Following is the snippet of the code:


Could you please suggest me other ways of achieveing this?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting version and conformance levels in iText does not alter a document; it merely specifies what operations are allowed from that point on. So it doesn't have the desired effect in this case.
 
Anup Bansal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I achieve this format conversion? Is there any other jars available for the same?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not to my knowledge; certainly no freely available ones. PDF is not amenable to a lot of changes after its creation; while some modifications are possible, structural alterations within pages generally aren't.

It's possible that Adobe has a native library you could license for this purpose.
 
Rommel Vega
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi it is very helpfull your code example... over a many tests, finally i could transform an older version  Pdf from Version 1.1  to pdf A-1b format..
here is the lines
first create a simple proyect whit no interfaces and next, import the itext librarys in my case i use 5.5.9 then i create a class whit this code


}

 
Campbell Ritchie
Sheriff
Pie
Posts: 49734
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to your post. Always use the tags; you can see how much better it looks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic