An Object-Oriented Approach to Copying and Reordering Pages in a Document
This Tech Tip first appeared in Imaging News March 2006.
If you have a requirement to reorder pages within a document, or to create a new document containing pages from multiple existing documents, here’s an easy approach.
The first step is to create a class that represents each source page. I’ve called it com.snowbound.sample.PageReference. It only needs to store the name of the source document, and the page Index of the desired page.
package com.snowbound.sample;
public PageReference (String file, int index)
/**
/**
}
The next class to create is an extension of java.util.Vector. I’ve named it com.snowbound.sample.DocumentModel, since it models the layout of the document that we are creating. This class only has one method, writeDocument, in addition to the inherited methods of Vector. It uses a RasterMaster for Java imaging SDK Snow.Snowbnd object to handle the image processing and output.
package com.snowbound.sample;
import java.util.Vector;
for
package com.snowbound.sample;

