Skip to content

Commit c23b797

Browse files
author
Muhammad Mateen Sajid
committed
Aspose.PDF JAVA SDK Examples
1 parent b8ec971 commit c23b797

File tree

215 files changed

+18480
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+18480
-0
lines changed

Examples/.classpath

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
</attributes>
29+
</classpathentry>
30+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
31+
<attributes>
32+
<attribute name="maven.pomderived" value="true"/>
33+
</attributes>
34+
</classpathentry>
35+
<classpathentry kind="output" path="target/classes"/>
36+
</classpath>

Examples/.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>examples</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.7
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
12+
org.eclipse.jdt.core.compiler.source=1.7
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

Examples/pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.aspose.asposecloudpdf.api</groupId>
6+
<artifactId>examples</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<repositories>
9+
<repository>
10+
<id>aspose</id>
11+
<url>https://artifact.aspose.cloud/repo/</url>
12+
</repository>
13+
</repositories>
14+
<dependencies>
15+
<!-- https://mvnrepository.com/artifact/com.aspose/aspose-cloud-pdf -->
16+
<dependency>
17+
<groupId>com.aspose</groupId>
18+
<artifactId>aspose-cloud-pdf</artifactId>
19+
<version>18.11.0</version>
20+
</dependency>
21+
22+
</dependencies>
23+
</project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.aspose.asposecloudpdf.examples;
2+
3+
import java.io.File;
4+
5+
import com.aspose.asposecloudpdf.ApiException;
6+
import com.aspose.asposecloudpdf.api.PdfApi;
7+
import com.aspose.asposecloudpdf.model.AsposeResponse;
8+
9+
public class Common {
10+
11+
public static void uploadFile(PdfApi pdfApi, String name) throws ApiException {
12+
File file = new File("testData" + "/" + name);
13+
pdfApi.putCreate(name, file, null, null);
14+
}
15+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.aspose.asposecloudpdf.examples.annotations;
2+
3+
import com.aspose.asposecloudpdf.ApiException;
4+
import com.aspose.asposecloudpdf.api.PdfApi;
5+
import com.aspose.asposecloudpdf.examples.Common;
6+
import com.aspose.asposecloudpdf.model.AnnotationsInfoResponse;
7+
import com.aspose.asposecloudpdf.model.AsposeResponse;
8+
9+
public class DeleteAnnotationExample {
10+
11+
public static void main(String[] args) throws ApiException {
12+
String name = "PdfWithAnnotations.pdf";
13+
PdfApi pdfApi = new PdfApi("XXXXXXXXXXX", "XXXXXXX");
14+
15+
Common.uploadFile(pdfApi, name);
16+
17+
AnnotationsInfoResponse responseAnnotations = pdfApi.getDocumentAnnotations(name, null, "");
18+
String annotationId = responseAnnotations.getAnnotations().getList().get(0).getId();
19+
AsposeResponse response = pdfApi.deleteAnnotation(name, annotationId, null, "");
20+
21+
System.out.println(response.getCode());
22+
23+
}
24+
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.aspose.asposecloudpdf.examples.annotations;
2+
3+
import com.aspose.asposecloudpdf.ApiException;
4+
import com.aspose.asposecloudpdf.api.PdfApi;
5+
import com.aspose.asposecloudpdf.examples.Common;
6+
import com.aspose.asposecloudpdf.model.AsposeResponse;
7+
8+
public class DeleteDocumentAnnotationsExample {
9+
10+
public static void main(String[] args) throws ApiException {
11+
String name = "PdfWithAnnotations.pdf";
12+
PdfApi pdfApi=new PdfApi("XXXXXXXXXXX", "XXXXXXX");
13+
Common.uploadFile(pdfApi,name);
14+
15+
AsposeResponse response = pdfApi.deleteDocumentAnnotations(name, null, "");
16+
System.out.println(response.getCode());
17+
18+
}
19+
20+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.aspose.asposecloudpdf.examples.annotations;
2+
3+
import com.aspose.asposecloudpdf.ApiException;
4+
import com.aspose.asposecloudpdf.api.PdfApi;
5+
import com.aspose.asposecloudpdf.examples.Common;
6+
import com.aspose.asposecloudpdf.model.AsposeResponse;
7+
8+
public class DeletePageAnnotationsExample {
9+
10+
public static void main(String[] args) throws ApiException {
11+
int pageNumber = 2;
12+
13+
String name = "PdfWithAnnotations.pdf";
14+
PdfApi pdfApi = new PdfApi("XXXXXXXXXXX", "XXXXXXX");
15+
16+
Common.uploadFile(pdfApi, name);
17+
AsposeResponse response = pdfApi.deletePageAnnotations(name, pageNumber, null, "");
18+
System.out.println(response.getCode());
19+
20+
}
21+
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.aspose.asposecloudpdf.examples.annotations;
2+
3+
import com.aspose.asposecloudpdf.ApiException;
4+
import com.aspose.asposecloudpdf.api.PdfApi;
5+
import com.aspose.asposecloudpdf.examples.Common;
6+
import com.aspose.asposecloudpdf.model.AnnotationsInfoResponse;
7+
8+
public class GetAnnotationsExample {
9+
10+
public static void main(String[] args) throws ApiException {
11+
12+
int pageNumber = 2;
13+
String name = "PdfWithAnnotations.pdf";
14+
PdfApi pdfApi = new PdfApi("XXXXXXXXXXX", "XXXXXXX");
15+
16+
Common.uploadFile(pdfApi, name);
17+
AnnotationsInfoResponse response = pdfApi.getPageAnnotations(name, pageNumber, null, "");
18+
System.out.println(response.getCode());
19+
20+
}
21+
22+
}

0 commit comments

Comments
 (0)