public class PdfResourceCounter extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,PdfObject> |
resources
A map of the resources that are already taken into account
|
Constructor and Description |
---|
PdfResourceCounter(PdfObject object)
Creates a PdfResourceCounter instance to be used to count the resources needed for either a page (in this case pass a page dictionary) or the trailer (root and info dictionary) of a PDF file.
|
Modifier and Type | Method and Description |
---|---|
long |
getLength(Map<Integer,PdfObject> res)
Returns the resources needed for the object that was used to create this PdfResourceCounter.
|
Map<Integer,PdfObject> |
getResources()
Returns a map with the resources.
|
protected void |
loopOver(PdfObject object)
In case an object is an array, a dictionary or a stream, we need to loop over the entries and process them one by one.
|
protected void |
process(PdfObject object)
Processes an object.
|
public PdfResourceCounter(PdfObject object)
object
- the object we want to examine
protected final void process(PdfObject object)
object
- the object to process
protected final void loopOver(PdfObject object)
object
- the object to examine
public Map<Integer,PdfObject> getResources()
public long getLength(Map<Integer,PdfObject> res) throws IOException
res
- the resources that can be excluded when counting the bytes
IOException
Copyright © 1998–2019. All rights reserved.