Skip to content

Commit 50e347d

Browse files
committed
Added examples ver. 25.2
1 parent 9ee660b commit 50e347d

File tree

9 files changed

+141
-5
lines changed

9 files changed

+141
-5
lines changed

Examples/Data/Slides/Media/audio.m4a

45.2 KB
Binary file not shown.

Examples/Data/Text/TextLigatures.pptx

31.4 KB
Binary file not shown.

Examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This package contains Java Example Project for [Aspose.Slides for Java](https://products.aspose.com/slides/java).
44

55
<p align="center">
6-
<a title="Download complete Aspose.Slides for Java source code" href="https://github.com/asposeslides/Aspose_Slides_Java/archive/master.zip">
6+
<a title="Download complete Aspose.Slides for Java source code" href="https://github.com/aspose-slides/Aspose.Slides-for-Java/archive/refs/heads/master.zip">
77
<img src="https://raw.github.com/AsposeExamples/java-examples-dashboard/master/images/downloadZip-Button-Large.png" />
88
</a>
99
</p>

Examples/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525
<dependency>
2626
<groupId>com.aspose</groupId>
2727
<artifactId>aspose-cells</artifactId>
28-
<version>24.12</version>
28+
<version>25.1</version>
2929
<type>jar</type>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.aspose</groupId>
3333
<artifactId>aspose-slides</artifactId>
34-
<version>25.1</version>
34+
<version>25.2</version>
3535
<classifier>jdk16</classifier>
3636
</dependency>
3737
<dependency>
3838
<groupId>com.aspose</groupId>
3939
<artifactId>aspose-slides</artifactId>
40-
<version>25.1</version>
40+
<version>25.2</version>
4141
<classifier>javadoc</classifier>
4242
</dependency>
4343
</dependencies>

Examples/src/main/java/com/aspose/slides/examples/RunExamples.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ public static void main(String[] args) throws Exception
411411
//ExtractAudioFromTimeline.main(null);
412412
//ExtractAudioFromHyperLink.main(null);
413413
//StopPreviousSoundExample.main(null);
414-
414+
//FadeInOutDurationAudioExample.main(null);
415+
//VolumeAudioExample.main(null);
416+
//TrimmingTimeAudioExample.main(null);
415417

416418
//// =====================================================
417419
//// Rendering - Printing a Slide
@@ -543,6 +545,7 @@ public static void main(String[] args) throws Exception
543545
//FontBinaryDataExample..main(null);
544546
//FontEmbeddingLevelExample.main(null);
545547
//GetPresentationRowTextExample.main(null);
548+
//DisableFontLigaturesExample.main(null);
546549

547550
//// =====================================================
548551
//// VBA Macros
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.aspose.slides.examples.slides.media;
2+
3+
import com.aspose.slides.*;
4+
import com.aspose.slides.examples.RunExamples;
5+
import java.io.IOException;
6+
import java.nio.file.Files;
7+
import java.nio.file.Paths;
8+
9+
public class FadeInOutDurationAudioExample
10+
{
11+
public static void main(String[] args) throws IOException
12+
{
13+
String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "audio.m4a";
14+
String outPath = RunExamples.getOutPath() + "AudioFrameFade_out.pptx";
15+
16+
//ExStart:FadeInOutDurationAudioExample
17+
Presentation pres = new Presentation();
18+
try {
19+
// Add Audio Frame
20+
IAudio audio = pres.getAudios().addAudio(Files.readAllBytes(Paths.get(mediaFile)));
21+
IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio);
22+
// Set the duration of the starting fade for 200ms
23+
audioFrame.setFadeInDuration(200f);
24+
// Set the duration of the ending fade for 500ms
25+
audioFrame.setFadeOutDuration(500f);
26+
pres.save(outPath, SaveFormat.Pptx);
27+
} finally {
28+
if (pres != null) pres.dispose();
29+
}
30+
//ExEnd:FadeInOutDurationAudioExample
31+
}
32+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.aspose.slides.examples.slides.media;
2+
3+
import com.aspose.slides.IAudio;
4+
import com.aspose.slides.IAudioFrame;
5+
import com.aspose.slides.Presentation;
6+
import com.aspose.slides.SaveFormat;
7+
import com.aspose.slides.examples.RunExamples;
8+
import java.io.IOException;
9+
import java.nio.file.Files;
10+
import java.nio.file.Paths;
11+
12+
public class TrimmingTimeAudioExample
13+
{
14+
public static void main(String[] args) throws IOException
15+
{
16+
String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "audio.m4a";
17+
String outPath = RunExamples.getOutPath() + "AudioFrameTrim_out.pptx";
18+
19+
//ExStart:TrimmingTimeAudioExample
20+
Presentation pres = new Presentation();
21+
try {
22+
// Add Audio Frame
23+
IAudio audio = pres.getAudios().addAudio(Files.readAllBytes(Paths.get(mediaFile)));
24+
IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio);
25+
// Set the start trimming time 0.5 seconds
26+
audioFrame.setTrimFromStart(500f);
27+
// Set the end trimming time 1 seconds
28+
audioFrame.setTrimFromEnd(1000f);
29+
pres.save(outPath, SaveFormat.Pptx);
30+
} finally {
31+
if (pres != null) pres.dispose();
32+
}
33+
//ExEnd:TrimmingTimeAudioExample
34+
}
35+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.aspose.slides.examples.slides.media;
2+
3+
import com.aspose.slides.IAudio;
4+
import com.aspose.slides.IAudioFrame;
5+
import com.aspose.slides.Presentation;
6+
import com.aspose.slides.SaveFormat;
7+
import com.aspose.slides.examples.RunExamples;
8+
9+
import java.io.IOException;
10+
import java.nio.file.Files;
11+
import java.nio.file.Paths;
12+
13+
public class VolumeAudioExample
14+
{
15+
public static void main(String[] args) throws IOException
16+
{
17+
String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "audio.m4a";
18+
String outPath = RunExamples.getOutPath() + "AudioFrameValue_out.pptx";
19+
20+
//ExStart:VolumeAudioExample
21+
Presentation pres = new Presentation();
22+
try {
23+
// Add Audio Frame
24+
IAudio audio = pres.getAudios().addAudio(Files.readAllBytes(Paths.get(mediaFile)));
25+
IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio);
26+
// Set the audio volume for 85%
27+
audioFrame.setVolumeValue(85f);
28+
pres.save(outPath, SaveFormat.Pptx);
29+
} finally {
30+
if (pres != null) pres.dispose();
31+
}
32+
//ExEnd:VolumeAudioExample
33+
}
34+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.aspose.slides.examples.text;
2+
3+
import com.aspose.slides.*;
4+
import com.aspose.slides.examples.RunExamples;
5+
import java.io.IOException;
6+
7+
public class DisableFontLigaturesExample
8+
{
9+
public static void main(String[] args) throws IOException
10+
{
11+
String presentationName = RunExamples.getDataDir_Text() + "TextLigatures.pptx";
12+
String outPathEnabled = RunExamples.getOutPath() + "EnableLigatures-out.html";
13+
String outPathDisabled = RunExamples.getOutPath() + "DisableLigatures-out.html";
14+
15+
//ExStart:DisableFontLigaturesExample
16+
Presentation pres = new Presentation(presentationName);
17+
try {
18+
// Save with enabled ligatures
19+
pres.save(outPathEnabled, SaveFormat.Html);
20+
21+
// Configure export options
22+
HtmlOptions options = new HtmlOptions();
23+
options.setDisableFontLigatures(true); // Disable ligatures in rendered text
24+
25+
// Export presentation to HTML with disabled ligatures
26+
pres.save(outPathDisabled, SaveFormat.Html, options);
27+
} finally {
28+
if (pres != null) pres.dispose();
29+
}
30+
//ExEnd:DisableFontLigaturesExample
31+
}
32+
}

0 commit comments

Comments
 (0)