java.lang.Object
org.sejda.sambox.contentstream.PDFStreamEngine
org.sejda.impl.sambox.component.ContentStreamProcessor
org.sejda.impl.sambox.component.optimization.ResourcesHitter
All Implemented Interfaces:
Consumer<org.sejda.sambox.pdmodel.PDPage>

public class ResourcesHitter extends ContentStreamProcessor
Component that parses the page content steam and the page annotations appearance stream, wraps any image xobject (type xobject, subtype image) found in an instance of ReadOnlyFilteredCOSStream, every font and every extended graphic state in an instance of InUseDictionary and puts them back into the resource dictionary. It's later easy to identify xobjects, fonts and extgstate in use by the page/s and what can be discarded.
Author:
Andrea Vacondio
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Tf operator that wraps a font dictionary with an InUseDictionary and puts it back to the resource dictionary so that we can later identify fonts that are actually used
    static class 
     
    static class 
     
    static class 
     
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class org.sejda.impl.sambox.component.ContentStreamProcessor

    accept

    Methods inherited from class org.sejda.sambox.contentstream.PDFStreamEngine

    addOperator, addOperatorIfAbsent, applyTextAdjustment, beginMarkedContentSequence, beginText, decreaseLevel, endMarkedContentSequence, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, operatorException, processAnnotation, processChildStream, processOperator, processOperator, processPage, processSoftMask, processStream, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showForm, showGlyph, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Constructor Details

    • ResourcesHitter

      public ResourcesHitter()