RasterMaster® Java samples
This section covers the Java samples included with RasterMaster Java. They are used to manipulate an image in many ways, such as altering its alter viewable size, changing its orientation, correcting its imperfections, modifying its size and resolution, converting it to another format, and adding text and graphic annotations.
If you do not find the kind of sample that you are looking for, please open a support ticket to request a specific sample. We are dedicated to helping our customers succeed and we are constantly enhancing our products based on feedback from customers like you.
You can find the samples in the [RM Java install dir]\sample-code\com\snowbound\samples\
.
Run RasterMaster samples in your IDE
To run one of the demos in your development environment, perform the following:
Note: These instructions are based on Eclipse.
- Extract all of the package files to the workspace.
- Be sure to download the license
.zip
and extract the license. Place the license in the[FilePath]\[MainRMFolder]\lib
directory. - Open Eclipse and open the prepared workspace.
- Go to File > New Project > Java Project.
- Name the project “sample-code” and click Finish.
- Next, right-click the project and select Build Path-> Configure Build Path… from the drop down menu.
- In the Libraries Tab click Add External JARs… and include all the files in the
[FilePath]\[MainRMFolder]\lib
directory. - Click Apply and Close.
- Select the sample (e.g.,
SingleConversion.Java
) in the convert package. - Adjust the
inputFile
variable to a full filepath for your test file. - Finally, run the project.
Run Samples from the Command Prompt
To run a sample from the command prompt:
-
Make sure that that OracleJDK or OpenJDK (Java Development Kit) is installed on your system. Make sure that you have added
SnowboundLicense.jar
to RasterMaster /lib folderIn the following example, the JDK is installed at this location (Windows):
C:\Program Files\Java\jdk-11.0.2\bin
-
Make sure that the code sample you want to run is in a directory name that matches the package name. In this example, RasterMaster Java was installed on
c:\me
. For example, the SingleConversion sample is in this directory:C:\me\com\snowbound\samples\convert
-
Follow the example below to change directory to be in the top-level directory, to the directory above com.
C:\> cd me C:\me>
-
Use the example below to compile the sample from the command line by running
javac
from the JDK.C:\me> "C:\Program Files\Java\jdk-11.0.2\bin\javac" -classpath ".;..\lib\*;.\com\snowbound\snowcommon.jar;C:\Program Files\Java\jdk- 11.0.2\bin” .\com\snowbound\samples\convert\SingleConversion.java
-
Finally, run the sample from the command line, again from the top-level directory:
C:\me> java -cp ".;..\lib\*;.\com\snowbound\snowcommon.jar" com.snowbound.samples.convert.SingleConversion
Java samples
- The SingleConversion sample
- The BatchConvert sample
- The HangDetector sample
- The saveSearchablePDF sample
- The Loadandsave sample
- The Print sample
- The SilentPrint sample
- The Thumbnails sample
- The Watermarks sample
- The Manipulation sample
- The Color Detection sample
- The Save Page to Memory sample
- The Viewing and Annotations Sample
- The Swing sample
- The VectorPDF sample
- The VectorPDFPageManipulation sample
- The Scanning sample
Have questions, corrections, or concerns about this topic? Please let us know!