PJX

com.etymon.pjx.util
Class PdfRenumberOffset

java.lang.Object
  extended bycom.etymon.pjx.util.PdfRenumberOffset
All Implemented Interfaces:
PdfObjectFilter

public class PdfRenumberOffset
extends java.lang.Object
implements PdfObjectFilter

Modifies indirect references within a PDF object, adding a specified offset to each object number in a reference. PdfObjectFilter is used to filter the indirect references. This class is synchronized.


Constructor Summary
PdfRenumberOffset()
          Constructs a PdfRenumberOffset instance.
 
Method Summary
 PdfObject postFilter(PdfObject obj)
          This method is used by renumber(PdfObject) to filter indirect references and should not be called externally.
 PdfObject preFilter(PdfObject obj)
          This method is used by renumber(PdfObject) to filter indirect references and should not be called externally.
 PdfObject renumber(PdfObject obj)
          Adds an offset to the object number in each PdfReference within the specified object.
 void resetGeneration(boolean reset)
          Controls whether generation numbers will be set to 0 during the renumbering process.
 void setOffset(int offset)
          Sets the offset value to add to each object number during renumbering.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfRenumberOffset

public PdfRenumberOffset()
Constructs a PdfRenumberOffset instance. By default, generation numbers will not be modified (see resetGeneration(boolean)). The offset value defaults to 0 (see setOffset(int)).

Method Detail

setOffset

public void setOffset(int offset)
Sets the offset value to add to each object number during renumbering.

Parameters:
offset - the offset to use.

resetGeneration

public void resetGeneration(boolean reset)
Controls whether generation numbers will be set to 0 during the renumbering process.

Parameters:
reset - if true, generation numbers will be set to 0; otherwise they are not modified.

renumber

public PdfObject renumber(PdfObject obj)
                   throws PdfFormatException
Adds an offset to the object number in each PdfReference within the specified object. The generation number may optionally be reset to 0 (see resetGeneration(boolean)). The offset is specified with setOffset(int).

Parameters:
obj - the object to renumber.
Returns:
the renumbered object.
Throws:
PdfFormatException

preFilter

public PdfObject preFilter(PdfObject obj)
                    throws PdfFormatException
This method is used by renumber(PdfObject) to filter indirect references and should not be called externally. (It is not synchronized.)

Specified by:
preFilter in interface PdfObjectFilter
Parameters:
obj - the object to filter.
Returns:
the filtered object.
Throws:
PdfFormatException

postFilter

public PdfObject postFilter(PdfObject obj)
                     throws PdfFormatException
This method is used by renumber(PdfObject) to filter indirect references and should not be called externally. (It is not synchronized.)

Specified by:
postFilter in interface PdfObjectFilter
Parameters:
obj - the object to filter.
Returns:
the filtered object.
Throws:
PdfFormatException

Copyright © 1998-2004 Etymon Systems, Inc.

The PDF data structures, operators, and specification are
Copyright © 1985-2004 Adobe Systems Incorporated.