iText 8.0.2 API
iText.Kernel.Utils.PdfResourceCounter Class Reference

This class can be used to count the number of bytes needed when copying pages from an existing PDF into a newly created PDF. More...

Public Member Functions

  PdfResourceCounter (PdfObject obj)
  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. More...
 
virtual IDictionary< int, PdfObject GetResources ()
  Returns a map with the resources. More...
 
virtual long  GetLength (IDictionary< int, PdfObject > res)
  Returns the resources needed for the object that was used to create this PdfResourceCounter. More...
 

Detailed Description

This class can be used to count the number of bytes needed when copying pages from an existing PDF into a newly created PDF.

Constructor & Destructor Documentation

◆ PdfResourceCounter()

iText.Kernel.Utils.PdfResourceCounter.PdfResourceCounter ( PdfObject  obj )
inline

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.

Parameters
obj the object we want to examine

Member Function Documentation

◆ GetLength()

virtual long iText.Kernel.Utils.PdfResourceCounter.GetLength ( IDictionary< int, PdfObject res )
inlinevirtual

Returns the resources needed for the object that was used to create this PdfResourceCounter.

Returns the resources needed for the object that was used to create this PdfResourceCounter. If you pass a Map with resources that were already used by other objects, these objects will not be taken into account.

Parameters
res The resources that can be excluded when counting the bytes.
Returns
The number of bytes needed for an object.

◆ GetResources()

virtual IDictionaryPdfObject> iText.Kernel.Utils.PdfResourceCounter.GetResources ( )
inlinevirtual

Returns a map with the resources.

Returns
the resources