Split Microsoft Word, Excel, Powerpoint and PDF documents using Java applications
View add-digital-signature-to-a-pdf-file.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Document document = new Document("unsignedFile.pdf"); | |
PdfFileSignature signature = new PdfFileSignature(document); | |
PKCS7 pkcs = new PKCS7("/home/aspose/pdf-examples/Samples/test.pfx", "Pa$$w0rd2020"); // Use PKCS7/PKCS7Detached | |
// TimestampSettings timestampSettings = new TimestampSettings("https://freetsa.org/tsr", ""); // User/Password can be omitted // be omitted | |
// pkcs.setTimestampSettings(timestampSettings); | |
signature.sign(1, true, new java.awt.Rectangle(300, 100, 400, 200), pkcs); | |
signature.save("SignedFile.pdf"); |
View crop-image.md
Learn how to crop image online or programmatically:
View convert-html-file-to-pdf.md
Learn how to Convert HTML File to PDF Online or Programmatically in C# and Java.
View crop-images-with-rectangle.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.pycore as aspycore | |
from aspose.imaging import RasterImage, Image, Rectangle | |
import os | |
if 'TEMPLATE_DIR' in os.environ: | |
templates_folder = os.environ['TEMPLATE_DIR'] | |
else: | |
templates_folder = r"C:\Users\USER\Downloads\templates" | |
delete_output = 'SAVE_OUTPUT' not in os.environ |
View graph-cut-feathering.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Imaging; | |
using Aspose.Imaging.FileFormats.Png; | |
using Aspose.Imaging.ImageOptions; | |
using Aspose.Imaging.Masking; | |
using Aspose.Imaging.Masking.Options; | |
using Aspose.Imaging.Masking.Result; | |
using Aspose.Imaging.Sources; | |
using System; | |
using System.IO; |
View magic-wand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.aspose.imaging.Image; | |
import com.aspose.imaging.RasterImage; | |
import com.aspose.imaging.magicwand.*; | |
import com.aspose.imaging.magicwand.imagemasks.*; | |
// get path of the input data | |
String templatesFolder = System.getenv("DATA_PATH"); | |
// get output path | |
String outputFolder = System.getenv("OUT_PATH"); |
View open-and-read-word-documents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Document wordDoc = new Document("wordFileToRead.docx"); | |
for (Object obj : wordDoc.getChildNodes(NodeType.PARAGRAPH, true)) { | |
Paragraph para = (Paragraph)obj; | |
System.out.println(para.toString(SaveFormat.TEXT)); | |
} | |
for (Object obj : wordDoc.getChildNodes(NodeType.RUN, true)){ | |
Run run = (Run)obj; | |
Font font = run.getFont(); |
View add-diagonal-watermark-to-images.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com.aspose.imaging.Image image = com.aspose.imaging.Image.load("sourceImage.png"); | |
Graphics graphics= new Graphics(image); | |
Font font = new Font("Times New Roman", 16, FontStyle.Bold); | |
SolidBrush brush = new SolidBrush(); | |
brush.setColor(Color.getBlack()); | |
brush.setOpacity(100); |
View merge-excel-files.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Workbook excelFileOne = new Workbook("charts.xlsx"); | |
Workbook excelFileTwo = new Workbook("Images.xlsx"); | |
excelFileOne.combine(excelFileTwo); | |
excelFileOne.save("combined.xlsx"); |
NewerOlder