if (outputFrame_ != null &&
outputFrame_.getWindowObject() != null &&
newViewerType != outputFrame_.getViewerType())
{
// close the existing frame
RmdPreviewParams params = outputFrame_.getPreviewParams();
outputFrame_.closeOutputFrame(true);
// reset the scroll position (as it will vary with the document width,
// which will change)
params.setScrollPosition(0);
// open a new one with the same parameters
outputFrame_ = createOutputFrame(newViewerType);
outputFrame_.showRmdPreview(params);
}