Skip to content

Commit 176fcae

Browse files
Merge branch 'master' of github.com:aspose-html-cloud/aspose-html-cloud-java
2 parents a706619 + 8e5c764 commit 176fcae

23 files changed

+408
-0
lines changed

Examples/.classpath

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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/J2SE-1.5">
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="lib" path="jars/aspose-cloud-html-1.0.1.jar"/>
36+
<classpathentry kind="output" path="target/classes"/>
37+
</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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
3+
org.eclipse.jdt.core.compiler.compliance=1.5
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.source=1.5
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/all_document_images.zip

217 KB
Binary file not shown.

Examples/pom.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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.cloud.html</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+
15+
16+
<dependencies>
17+
<!-- https://mvnrepository.com/artifact/org.threeten/threetenbp -->
18+
<dependency>
19+
<groupId>org.threeten</groupId>
20+
<artifactId>threetenbp</artifactId>
21+
<version>1.3.5</version>
22+
</dependency>
23+
24+
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp -->
25+
<dependency>
26+
<groupId>com.squareup.okhttp</groupId>
27+
<artifactId>okhttp</artifactId>
28+
<version>2.7.5</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>com.squareup.okhttp</groupId>
32+
<artifactId>logging-interceptor</artifactId>
33+
<version>2.7.5</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>io.gsonfire</groupId>
37+
<artifactId>gson-fire</artifactId>
38+
<version>1.8.0</version>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>com.aspose</groupId>
43+
<artifactId>aspose-cloud-storage</artifactId>
44+
<version>1.0.1</version>
45+
46+
</dependency>
47+
</dependencies>
48+
</project>

Examples/setting/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"basePath":"https://api.aspose.cloud/v1.1",
3+
"authPath":"https://api.aspose.cloud/oauth2/token",
4+
"apiKey":"b125f13bf6b76ed81ee990142d841195",
5+
"appSID":"78946fb4-3bd4-4d3e-b309-f9e2ff9ac6f9",
6+
"storage":"\\data\\",
7+
"testdata":"\\testdata\\",
8+
"defaultUserAgent":"Webkit",
9+
"debug": true,
10+
"ISO_OFFSET_DATE_TIME" : "0"
11+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package convert;
2+
3+
import java.io.File;
4+
5+
import com.aspose.html.client.api.ConversionApi;
6+
7+
public class GetConvertDocumentToImage {
8+
//Aspose.HTML Cloud Example
9+
//Demonstrates how to convert a HTML Page to image by calling GetConvertDocumentToImage api
10+
public static void main(String[] args) throws com.aspose.html.client.invoker.ApiException {
11+
12+
String name = "index.html"; // String | Document name.
13+
String outFormat = "jpeg"; // String | Resulting image format.
14+
Integer width = 800; // Integer | Resulting image width.
15+
Integer height = 1000; // Integer | Resulting image height.
16+
Integer leftMargin = 10; // Integer | Left resulting image margin.
17+
Integer rightMargin = 10; // Integer | Right resulting image margin.
18+
Integer topMargin = 10; // Integer | Top resulting image margin.
19+
Integer bottomMargin = 10; // Integer | Bottom resulting image margin.
20+
Integer xResolution = 300; // Integer | Horizontal resolution of resulting image.
21+
Integer yResolution = 300; // Integer | Vertical resolution of resulting image.
22+
String folder = null; // String | The document folder.
23+
String storage = null; // String | The document storage.
24+
25+
ConversionApi apiInstance = new ConversionApi();
26+
27+
File result = apiInstance.GetConvertDocumentToImage(name, outFormat, width, height, leftMargin, rightMargin,
28+
topMargin, bottomMargin, xResolution, yResolution, folder, storage);
29+
30+
// Save to test directory
31+
File copyFile = new File("test.jpg");
32+
result.renameTo(copyFile);
33+
34+
}
35+
36+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package convert;
2+
3+
import java.io.File;
4+
5+
import com.aspose.html.client.api.ConversionApi;
6+
import com.aspose.html.client.invoker.ApiException;
7+
8+
public class GetConvertDocumentToPDF {
9+
//Aspose.HTML Cloud Example
10+
//Demonstrates how to convert a HTML Page to a PDF Page
11+
public static void main(String[] args) throws ApiException {
12+
String name = "index.html"; // String | Document name.
13+
Integer width = 800; // Integer | Resulting image width.
14+
Integer height = 1000; // Integer | Resulting image height.
15+
Integer leftMargin = 10; // Integer | Left resulting image margin.
16+
Integer rightMargin = 10; // Integer | Right resulting image margin.
17+
Integer topMargin = 10; // Integer | Top resulting image margin.
18+
Integer bottomMargin = 10; // Integer | Bottom resulting image margin.
19+
String folder = null; // String | The document folder.
20+
String storage = null; // String | The document storage.
21+
22+
ConversionApi apiInstance = new ConversionApi();
23+
24+
File result = apiInstance.GetConvertDocumentToPdf(name, width, height, leftMargin, rightMargin,
25+
topMargin, bottomMargin, folder, storage);
26+
27+
// Save to test directory
28+
File copyFile = new File("test.pdf");
29+
result.renameTo(copyFile);
30+
31+
}
32+
33+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package convert;
2+
3+
import java.io.File;
4+
5+
import com.aspose.html.client.api.ConversionApi;
6+
import com.aspose.html.client.invoker.ApiException;
7+
8+
public class GetConvertDocumentToPdfByUrl {
9+
//Aspose.HTML Cloud Example
10+
//Demonstrates how to convert a URL to a PDF Page
11+
public static void main(String[] args) throws ApiException {
12+
String outFormat="jpeg";
13+
Integer width = 800; // Integer | Resulting image width.
14+
Integer height = 1000; // Integer | Resulting image height.
15+
Integer leftMargin = 10; // Integer | Left resulting image margin.
16+
Integer rightMargin = 10; // Integer | Right resulting image margin.
17+
Integer topMargin = 10; // Integer | Top resulting image margin.
18+
Integer bottomMargin = 10; // Integer | Bottom resulting image margin.
19+
String folder = null; // String | The document folder.
20+
String storage = null; // String | The document storage.
21+
Integer xResolution=300;
22+
Integer yResolution=300;
23+
String sourceUrl="https://www.le.ac.uk/oerresources/bdra/html/page_01.htm";
24+
ConversionApi apiInstance = new ConversionApi();
25+
26+
File result = apiInstance.GetConvertDocumentToImageByUrl(sourceUrl, outFormat, width, height, leftMargin, rightMargin, topMargin, bottomMargin,
27+
xResolution, yResolution, folder, storage);
28+
// Save to test directory
29+
File copyFile = new File("url_image.jpeg");
30+
result.renameTo(copyFile);
31+
32+
}
33+
34+
}

0 commit comments

Comments
 (0)