Class FontDuplicationOptimizer
java.lang.Object
com.itextpdf.pdfoptimizer.AbstractOptimizationHandler
com.itextpdf.pdfoptimizer.handlers.FontDuplicationOptimizer
Looks for font dictionary duplications and merged them.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
optimizePdf
(com.itextpdf.kernel.pdf.PdfDocument document, OptimizationSession session) The method searches for font dictionaries in PdfDocuments and compare them.
-
Constructor Details
-
FontDuplicationOptimizer
public FontDuplicationOptimizer()
-
-
Method Details
-
optimizePdf
protected void optimizePdf(com.itextpdf.kernel.pdf.PdfDocument document, OptimizationSession session) The method searches for font dictionaries in PdfDocuments and compare them. If two dictionaries are similar and can be merged into one then optimizer does it and replace all old pdf dictionaries. Duplicated direct objects will be removed. Definitions of indirect objects will be left, however ifPdfDocument.isFlushUnusedObjects()
returnsfalse
then they will be ignored during flushing.- Specified by:
-
optimizePdf
in classAbstractOptimizationHandler
- Parameters:
-
document
- is the PDF document to optimize. Invocation of the method can change the state of the object -
session
- is an auxiliary object used to support share data between stages of optimization process
-