Knowledgebase (2345)
Children categories
PowerPoint documents signed with digital signatures can help recipients check if they have been altered since they were signed. If any changes are made, the signatures will become invalid immediately. Therefore, before you edit a PowerPoint document, you should check if it has been digitally signed or not. In this article, you will learn how to achieve this task programmatically in Java using Spire.Presentation for Java.
Install Spire.Presentation for Java
First of all, you're required to add the Spire.Presentation.jar file as a dependency in your Java program. The JAR file can be downloaded from this link. If you use Maven, you can easily import the JAR file in your application by adding the following code to your project's pom.xml file.
<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.presentation</artifactId>
<version>11.5.1</version>
</dependency>
</dependencies>
Verify if a PowerPoint Document is Digitally Signed
Spire.Presentation for Java provides the Presentation.isDigitallySigned() method to detect if a PowerPoint document is digitally signed or not. If the method returns true, then it means the document is digitally signed.
The following are the detailed steps to implement this function:
- Create a Presentation instance.
- Load a PowerPoint document using Presentation.loadFromFile() method.
- Detect if the document is digitally signed or not using Presentation.isDigitallySigned() method.
- Java
import com.spire.presentation.Presentation;
public class VerifyIfPPTisDigitallySigned {
public static void main(String []args) throws Exception {
//Create a Presentation instance
Presentation ppt = new Presentation();
//Load a PowerPoint document
ppt.loadFromFile("Sample.pptx");
//Verify if the document is digitally signed or not
if (ppt.isDigitallySigned()) {
System.out.println("This document is digitally signed");
} else {
System.out.println("This document is not digitally signed");
}
}
}

Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
When an image appears over the text, the text will be covered by the image and will be unable to be displayed. At this point, you can set the transparency of the picture in order to show the text above the image. This article is to demonstrate how to insert an image into a specific slide position in PowerPoint and set its transparency using Spire.Presentation for Java.
Install Spire.Presentation for Java
First of all, you're required to add the Spire.Presentation.jar file as a dependency in your Java program. The JAR file can be downloaded from this link. If you use Maven, you can easily import the JAR file in your application by adding the following code to your project's pom.xml file.
- Package Manager
<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.presentation</artifactId>
<version>11.5.1</version>
</dependency>
</dependencies>
Set Transparency for Images in PowerPoint
A number of classes and methods are involved in this code example, so a table shown as below is provided to make it easier for you to learn about them.
| Name | Description |
| IAutoShape Interface | Represents a shape. |
| ShapeList Class | Represents a collection of shapes. |
| PictureFillFormat Class | Represents a picture fill style. |
| ShapeList.appendShape(ShapeType.shapeType, Rectangle2D.Double) Method | Adds a new shape to list. |
| IAutoShape.getLine().setFillType(FillFormatType.value) Method | Sets the fill format type of the line. |
| IAutoShape.getFill().setFillType(FillFormatType.value) Method | Sets the fill format type of a shape. |
| IAutoShape.getFill().getPictureFill() Method | Gets the picture fill format. |
| PictureFillFormat.setFillType(PictureFillType.value) Method | Sets the picture fill mode. |
| PictureFillFormat.getPicture().setUrl(java.lang.String value) Method | Sets the image's URL for a picture fill. |
| PictureFillFormat.getPicture().setTransparency() Method | Sets the transparency of a picture fill. |
The following are some steps to set transparency for images in PowerPoint:
- Create a Presentation instance and load a PowerPoint sample document using Presentation.loadFromFile() method.
- Get a specified slide using Presentation.getSlides().get() method, and insert a shape to the specified position of the slide using ShapeList.appendShape(ShapeType.shapeType, Rectangle2D.Double) method.
- Fill the shape with an image and set the fill format type using IAutoShape.getFill().setFillType(FillFormatType.value) method.
- Get the picture fill format using IAutoShape.getFill().getPictureFill() method.
- Set the picture fill mode using PictureFillFormat.setFillType(PictureFillType.value) method, set the image’s URL using PictureFillFormat.getPicture().setUrl(java.lang.String value) method, and set the transparency of the image using PictureFillFormat.getPicture().setTransparency() method.
- Save the document using Presentation.saveToFile() method.
- Java
import com.spire.presentation.*;
import com.spire.presentation.drawing.*;
import java.awt.geom.Rectangle2D;
public class SetImageTransparency {
public static void main(String[] args) throws Exception {
//Create a Presentation instance
Presentation presentation = new Presentation();
//Load a PowerPoint sample document
presentation.loadFromFile("C:\\Users\\Test1\\Desktop\\sample.pptx");
//Insert a shape to the specified position of the first slide
Rectangle2D.Double rect1 = new Rectangle2D.Double(50, 130, 275, 150);
IAutoShape shape = presentation.getSlides().get(1).getShapes().appendShape(ShapeType.RECTANGLE, rect1);
//Fill the shape with an image
shape.getLine().setFillType(FillFormatType.NONE);//Sets the fill format type
shape.getFill().setFillType(FillFormatType.PICTURE);//Sets the type of filling
shape.getFill().getPictureFill().getPicture().setUrl("https://cdn.e-iceblue.com/C:\\Users\\Test1\\Desktop\\Picture.png");//Sets the linked image's URL
shape.getFill().getPictureFill().setFillType(PictureFillType.STRETCH);//Sets the picture fill mode
//Set transparency of the image
shape.getFill().getPictureFill().getPicture().setTransparency(50);
//Save the document to file
presentation.saveToFile("output/SetImageTransparency_result.pptx", FileFormat.PPTX_2010);
}
}

Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
The OpenDocument Presentation Document Format, commonly referred to as ODP, is one of the file extensions of an Open Document Format file and is designed to serve as an open-source display format for slideshow presentations. Sometimes you may need to convert an ODP file to PDF to ensure the document's formatting remains intact. In this article, you will learn how to achieve this function using Spire.Presentation for Java.
Install Spire.Presentation for Java
First of all, you're required to add the Spire.Presentation.jar file as a dependency in your Java program. The JAR file can be downloaded from this link. If you use Maven, you can easily import the JAR file in your application by adding the following code to your project's pom.xml file.
<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.presentation</artifactId>
<version>11.5.1</version>
</dependency>
</dependencies>
Convert ODP to PDF
You can convert ODP to PDF using Spire.Presentation for Java in an easy and quick manner by following the steps listed below.
- Create a Presentation object.
- Load a sample ODP document using Presentation.loadFromFile() method.
- Save the document as PDF using Presentation.saveToFile() method.
- Java
import com.spire.presentation.*;
public class ODPtoPDF {
public static void main(String[] args) throws Exception {
//Create a Presentation instance
Presentation presentation = new Presentation();
//Load a sample ODP file
presentation.loadFromFile("toPDF.odp",FileFormat.ODP);
//Save it as PDF
presentation.saveToFile("output/Result.pdf", FileFormat.PDF);
}
}
The original file:

The generated file:

Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.