Image Deskew Licensing Plugin
Effortlessly correct skew in scanned documents or photos using the Image Deskew license plugin. You can apply the deskew operation to one of the supported image file formats. Before starting the process, make sure to obtain a Metered license by providing your public and private keys using the `setMeteredKey()` method. Then, load your file, such as a TIFF image format, using the `load()` method, and proceed to deskew using the `normalizeAngle()` method before saving it with the `save()` method.
import com.aspose.imaging.Image; | |
import com.aspose.imaging.Metered; | |
import com.aspose.imaging.RasterImage; | |
import com.aspose.imaging.imageoptions.JpegOptions; | |
import java.io.File; | |
//----------------------------------------------------------------- | |
// Deskew plug-in license use examples | |
//----------------------------------------------------------------- | |
// Valid deskew license use example | |
Metered license = new Metered(); | |
// Only metered plug-in license is supported | |
license.setMeteredKey("<your public key>", "<your private key>"); | |
// get path of the input data | |
String templatesFolder = System.getenv("DATA_PATH"); | |
if (templatesFolder == null) | |
{ | |
templatesFolder = "c:\\Users\\USER\\Downloads\\templates\\"; | |
} | |
// get output path | |
String outputFolder = System.getenv("OUT_PATH"); | |
if (outputFolder == null) | |
{ | |
outputFolder = templatesFolder; | |
} | |
try (RasterImage image = (RasterImage) Image.load(templatesFolder + "multipage.tif")) | |
{ | |
String filePath = outputFolder + "deskewed_multipage.jpg"; | |
image.normalizeAngle(); | |
image.save(filePath, new JpegOptions()); | |
// delete output | |
new File(filePath).delete(); | |
} |
Discover the features of our free online deskew application demo by visiting our Aspose.Imaging Deskew App website.