ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/sfv.htm

151 lines
9.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="SpooledFileViewer class" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="sfv" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>SpooledFileViewer class</title>
</head>
<body id="sfv"><a name="sfv"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SpooledFileViewer class</h1>
<div><p></p>
<div class="section"><p>The <a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html"> SpooledFileViewer class</a> creates a window for viewing Advanced
Function Printing™ (AFP™) and Systems Network Architecture character string
(SCS) files that have been spooled for printing. The class essentially adds
a "print preview" function to your spooled files, common to most word processing
programs, as illustrated in <a href="#sfv__spoolfig">Figure 1</a>.</p>
</div>
<div class="section"><p>The spooled file viewer is especially helpful when viewing the
accuracy of the layout of the files is more important than printing the files,
or when viewing the data is more economical than printing, or when a printer
is not available.</p>
</div>
<div class="section"><div class="note"><span class="notetitle">Note:</span> SS1 Option 8 (AFP Compatibility Fonts) must be installed
on the host server.</div>
</div>
<div class="section"><p><strong>Using the SpooledFileViewer class</strong></p>
</div>
<div class="section"><p>Three constructor methods are available to create an instance
of the SpooledFileViewer class. The <a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#SPOOLEDFILEVIEWER()">SpooledFileViewer()</a> constructor can be used to create
a viewer without a spooled file associated with it. If this constructor is
used, a spooled file will need to be set later using <a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#SETSPOOLEDFILE(COM.IBM.AS400.ACCESS.SPOOLEDFILE)">setSpooledFile(SpooledFile)</a>. The <a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#SPOOLEDFILEVIEWER(COM.IBM.AS400.ACCESS.SPOOLEDFILE)"> SpooledFileViewer(SpooledFile)</a> constructor can be used
to create a viewer for the given spooled file, with page one as the initial
view. Finally, the <a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#SPOOLEDFILEVIEWER(COM.IBM.AS400.ACCESS.SPOOLEDFILE, INT)">SpooledFileViewer(spooledFile, int)</a> constructor can be
used to create a viewer for the given spooled file with the specified page
as the initial view. No matter which constructor is used, once a viewer is
created, a call to <a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#LOAD()">load()</a> must be performed in order to actually retrieve
the spooled file data.</p>
</div>
<div class="section"><p>Then, your program can traverse the individual pages of the spooled
file by using the following methods:</p>
</div>
<div class="section"><ul><li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#LOADFLASHPAGE()">load FlashPage()</a></li>
<li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#LOADPAGE()">load Page()</a></li>
<li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#PAGEBACK()">pageBack()</a></li>
<li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#PAGEFORWARD()">pageForward()</a></li>
</ul>
</div>
<div class="section"><p>If, however, you need to examine particular sections of the document
more closely, you can magnify or reduce the image of a page of the document
by altering the ratio proportions of each page with the following:</p>
</div>
<div class="section"><ul><li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#FITHEIGHT()">fitHeight()</a></li>
<li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#FITPAGE()">fitPage()</a></li>
<li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#FITWIDTH()">fitWidth()</a></li>
<li><a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#ACTUALSIZE()">actualSize()</a></li>
</ul>
</div>
<div class="section"><p>Your program concludes with calling the <a href="javadoc/com/ibm/as400/vaccess/SpooledFileViewer.html#CLOSE()">close()</a> method that closes the input stream and releases
any resource associations with the stream.</p>
</div>
<div class="section"><p><strong>Using the SpooledFileViewer</strong></p>
</div>
<div class="section"><p><span class="synph" id="sfv__panel"><a name="sfv__panel"><!-- --></a><span class="kwd"></span></span>An instance of the SpooledFileViewer
class is actually a graphical representation of a viewer capable of displaying
and navigating through an AFP or SCS spooled file. For example, the following code
creates the spooled file viewer in Figure 1 to display a spooled file previously
created on the server.</p>
</div>
<div class="section"><div class="note"><span class="notetitle">Note:</span> You can either select a button on the image in <a href="#sfv__spoolfig">Figure
1</a> for an explanation of its function, or (if your browser is not JavaScript™
enabled) <a href="#sfv__list">see the toolbar description</a>.</div>
</div>
<div class="section"><div class="p"><pre>// Assume splf is the spooled file.
// Create the spooled file viewer
SpooledFileViewer splfv = new SpooledFileViewer(splf, 1);
splfv.load();
// Add the spooled file viewer to a frame
JFrame frame = new JFrame("My Window");
frame.getContentPane().add(splfv);
frame.pack();
frame.show();</pre>
</div>
</div>
<div class="section"><p><strong><span class="synph" id="sfv__spoolfig"><a name="sfv__spoolfig"><!-- --></a><span class="kwd"></span></span>Figure 1: SpooledFileViewer</strong></p>
</div>
<div class="section"><p><img src="rzahh113.gif" alt="SpooledFile Viewer. For more information about the toolbar icons, see the descriptions that follow this image." /> </p>
</div>
<div class="section"><p><strong><span class="synph" id="sfv__list"><a name="sfv__list"><!-- --></a><span class="kwd"></span></span>SpooledFileViewer Toolbar
description</strong></p>
</div>
<div class="section"><p><img src="rzahh516.gif" alt="Actual Size tool icon" />The actual size button returns the spooled file page image to its
original size by using the actualSize() method.</p>
</div>
<div class="section"><p><img src="rzahh520.gif" alt="Fit Width tool icon" />The fit width button stretches the spooled file page image to the
left and right edges of the viewer's frame by using the fitWidth() method.</p>
</div>
<div class="section"><p><img src="rzahh521.gif" alt="Fit Page tool icon" /> The fit page button stretches the spooled file page image vertically
and horizontally to fit within the spooled file viewer's frame by using the
fitPage() method.</p>
</div>
<div class="section"><p><img src="rzahh522.gif" alt="Zoom tool icon" /> The zoom button allows you to increase or decrease the size of the
spooled file page image by selecting one of the preset percentages or entering
your own percent in a text field that appears in a dialog box after selecting
the zoom button.</p>
</div>
<div class="section"><p><img src="rzahh523.gif" alt="Go To Page tool icon" /> The go to page button allows you to go to a specific page within
the spooled file when selected.</p>
</div>
<div class="section"><p><img src="rzahh524.gif" alt="First Page tool icon" />The first page button takes you to the first page of the spooled file
when selected and indicates that you are on the first page when deactivated.</p>
</div>
<div class="section"><p><img src="rzahh525.gif" alt="Previous Page tool icon" /> The previous page button takes you to the page immediately before
the page you are viewing when selected.</p>
</div>
<div class="section"><p><img src="rzahh526.gif" alt="Next Page tool icon" /> The next page button advances you to the page immediately after the
page you are viewing when selected.</p>
</div>
<div class="section"><p><img src="rzahh527.gif" alt="Last Page tool icon" />The last page button advances you to the last page of the spooled
file when selected and indicates that you are on the last page when deactivated.</p>
</div>
<div class="section"><p><img src="rzahh517.gif" alt="Load Flash Page tool icon" /> The load flash page button loads the previously viewed page by using
the loadFlashPage() method when selected.</p>
</div>
<div class="section"><p><img src="rzahh518.gif" alt="Set Paper Size tool icon" />The set paper size button allows you to set the paper size when selected.</p>
</div>
<div class="section"><p><img src="rzahh519.gif" alt="Set Viewing Fidelity tool icon" /> The set viewing fidelity button allows you to
set the viewing fidelity when selected.</p>
</div>
</div>
</body>
</html>