• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

iText optimize pdf

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

does new library supports some kind of optimization, which offers similar functionality to PDF reduce file size function in Adobe Acrobat Pro ?

edit: I use PDFSmartCopy to merge multiple PDFs, however I wonder if there is something which can compress the output file.


Many thanks
Jakub
 
author
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kuba Zygmunt wrote:edit: I use PDFSmartCopy to merge multiple PDFs, however I wonder if there is something which can compress the output file.



Optimization and compression are two different things.

With iText you can change the compression level, and for instance use setFullCompression() to compress objects that weren't compressed in PDFs prior to version PDF 1.5. You could also use iText to reduce the resolution of images as described in chapter 16.

Optimization is partly done with PdfSmartCopy in the sense that PdfSmartCopy will detect when a certain image (such as a logo) is added to the PDF file multiple times: PdfSmartCopy will make sure the bits and bytes of that image are present only once.

What iText can't do (yet) and what would be a huge optimization: merge different subsets of a same font into one subset. This is very difficult to achieve and can in some cases mean that the complete content stream needs to be rewritten...

Optimization for fast web access (not for file size) aka Linearization isn't supported in iText.
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic