Skip to content

Commit 0393d91

Browse files
committed
Updated sources
1 parent 77bee0a commit 0393d91

File tree

7 files changed

+193
-19
lines changed

7 files changed

+193
-19
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Add following repository and dependency to your project's POM
2424
<dependency>
2525
<groupId>com.groupdocs</groupId>
2626
<artifactId>groupdocs-conversion-cloud</artifactId>
27-
<version>24.1</version>
27+
<version>24.2</version>
2828
<scope>compile</scope>
2929
</dependency>
3030
```
@@ -43,7 +43,7 @@ repositories {
4343
...
4444
dependencies {
4545
...
46-
implementation 'com.groupdocs:groupdocs-conversion-cloud:24.1'
46+
implementation 'com.groupdocs:groupdocs-conversion-cloud:24.2'
4747
}
4848
```
4949

@@ -100,7 +100,7 @@ mvn package -D maven.test.skip=true
100100

101101
Then manually install the following JARs:
102102

103-
* target/groupdocs-conversion-cloud-24.1.jar
103+
* target/groupdocs-conversion-cloud-24.2.jar
104104
* target/lib/*.jar
105105

106106
## Licensing

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>groupdocs-conversion-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>groupdocs-conversion-cloud</name>
8-
<version>24.1</version>
8+
<version>24.2</version>
99
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java</url>
1010
<description>Java library for communicating with the GroupDocs.Conversion Cloud API</description>
1111
<scm>

simplified-pom.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.groupdocs</groupId>
77
<artifactId>groupdocs-conversion-cloud</artifactId>
8-
<version>24.1</version>
8+
<version>24.2</version>
99
<packaging>jar</packaging>
1010

1111
<name>groupdocs-conversion-cloud</name>

src/main/java/com/groupdocs/cloud/conversion/client/ApiClient.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@
6262

6363
import com.groupdocs.cloud.conversion.client.auth.Authentication;
6464
import com.groupdocs.cloud.conversion.client.auth.OAuth;
65-
import com.groupdocs.cloud.conversion.model.ApiError;
6665
import com.groupdocs.cloud.conversion.model.AuthError;
6766

68-
public class ApiClient {
69-
private Configuration configuration = null;
67+
public class ApiClient {
7068

7169
private String serverUrl = null;
7270
private boolean debugging = false;
@@ -90,14 +88,14 @@ public class ApiClient {
9088
* Constructor for ApiClient
9189
*/
9290
public ApiClient(Configuration configuration) {
93-
this.configuration = configuration;
91+
9492
this.serverUrl = configuration.getServerUrl();
9593
this.httpClient = new OkHttpClient();
9694
this.verifyingSsl = true;
9795
this.json = new JSON();
9896

9997
// Set default User-Agent.
100-
setUserAgent("java-sdk/24.1");
98+
setUserAgent("java-sdk/24.2");
10199

102100
// Set connection timeout
103101
setConnectTimeout(configuration.getTimeout());

src/main/java/com/groupdocs/cloud/conversion/model/PdfConvertOptions.java

Lines changed: 179 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class PdfConvertOptions extends ConvertOptions {
5252
private Integer height = null;
5353

5454
@SerializedName("dpi")
55-
private Double dpi = null;
55+
private Integer dpi = null;
5656

5757
@SerializedName("password")
5858
private String password = null;
@@ -475,6 +475,140 @@ public RotateEnum read(final JsonReader jsonReader) throws IOException {
475475
@SerializedName("rotate")
476476
private RotateEnum rotate = null;
477477

478+
/**
479+
* Specifies page size
480+
*/
481+
@JsonAdapter(PageSizeEnum.Adapter.class)
482+
public enum PageSizeEnum {
483+
DEFAULT("Default"),
484+
485+
A3("A3"),
486+
487+
STATEMENT("Statement"),
488+
489+
QUARTO("Quarto"),
490+
491+
PAPER11X17("Paper11x17"),
492+
493+
PAPER10X14("Paper10x14"),
494+
495+
LETTER("Letter"),
496+
497+
LEGAL("Legal"),
498+
499+
LEDGER("Ledger"),
500+
501+
FOLIO("Folio"),
502+
503+
EXECUTIVE("Executive"),
504+
505+
ENVELOPEDL("EnvelopeDL"),
506+
507+
CUSTOM("Custom"),
508+
509+
B5("B5"),
510+
511+
B4("B4"),
512+
513+
A5("A5"),
514+
515+
A4("A4"),
516+
517+
TABLOID("Tabloid");
518+
519+
private String value;
520+
521+
PageSizeEnum(String value) {
522+
this.value = value;
523+
}
524+
525+
public String getValue() {
526+
return value;
527+
}
528+
529+
@Override
530+
public String toString() {
531+
return String.valueOf(value);
532+
}
533+
534+
public static PageSizeEnum fromValue(String text) {
535+
for (PageSizeEnum b : PageSizeEnum.values()) {
536+
if (String.valueOf(b.value).equals(text)) {
537+
return b;
538+
}
539+
}
540+
return null;
541+
}
542+
543+
public static class Adapter extends TypeAdapter<PageSizeEnum> {
544+
@Override
545+
public void write(final JsonWriter jsonWriter, final PageSizeEnum enumeration) throws IOException {
546+
jsonWriter.value(enumeration.getValue());
547+
}
548+
549+
@Override
550+
public PageSizeEnum read(final JsonReader jsonReader) throws IOException {
551+
String value = jsonReader.nextString();
552+
return PageSizeEnum.fromValue(String.valueOf(value));
553+
}
554+
}
555+
}
556+
557+
@SerializedName("pageSize")
558+
private PageSizeEnum pageSize = null;
559+
560+
/**
561+
* Specifies page orientation
562+
*/
563+
@JsonAdapter(PageOrientationEnum.Adapter.class)
564+
public enum PageOrientationEnum {
565+
DEFAULT("Default"),
566+
567+
LANDSCAPE("Landscape"),
568+
569+
PORTRAIT("Portrait");
570+
571+
private String value;
572+
573+
PageOrientationEnum(String value) {
574+
this.value = value;
575+
}
576+
577+
public String getValue() {
578+
return value;
579+
}
580+
581+
@Override
582+
public String toString() {
583+
return String.valueOf(value);
584+
}
585+
586+
public static PageOrientationEnum fromValue(String text) {
587+
for (PageOrientationEnum b : PageOrientationEnum.values()) {
588+
if (String.valueOf(b.value).equals(text)) {
589+
return b;
590+
}
591+
}
592+
return null;
593+
}
594+
595+
public static class Adapter extends TypeAdapter<PageOrientationEnum> {
596+
@Override
597+
public void write(final JsonWriter jsonWriter, final PageOrientationEnum enumeration) throws IOException {
598+
jsonWriter.value(enumeration.getValue());
599+
}
600+
601+
@Override
602+
public PageOrientationEnum read(final JsonReader jsonReader) throws IOException {
603+
String value = jsonReader.nextString();
604+
return PageOrientationEnum.fromValue(String.valueOf(value));
605+
}
606+
}
607+
}
608+
609+
@SerializedName("pageOrientation")
610+
private PageOrientationEnum pageOrientation = null;
611+
478612
public PdfConvertOptions width(Integer width) {
479613
this.width = width;
480614
return this;
@@ -511,7 +645,7 @@ public void setHeight(Integer height) {
511645
this.height = height;
512646
}
513647

514-
public PdfConvertOptions dpi(Double dpi) {
648+
public PdfConvertOptions dpi(Integer dpi) {
515649
this.dpi = dpi;
516650
return this;
517651
}
@@ -521,11 +655,11 @@ public PdfConvertOptions dpi(Double dpi) {
521655
* @return dpi
522656
**/
523657
@ApiModelProperty(required = true, value = "Desired page DPI after conversion. The default resolution is: 96dpi")
524-
public Double getDpi() {
658+
public Integer getDpi() {
525659
return dpi;
526660
}
527661

528-
public void setDpi(Double dpi) {
662+
public void setDpi(Integer dpi) {
529663
this.dpi = dpi;
530664
}
531665

@@ -1015,6 +1149,42 @@ public void setRotate(RotateEnum rotate) {
10151149
this.rotate = rotate;
10161150
}
10171151

1152+
public PdfConvertOptions pageSize(PageSizeEnum pageSize) {
1153+
this.pageSize = pageSize;
1154+
return this;
1155+
}
1156+
1157+
/**
1158+
* Specifies page size
1159+
* @return pageSize
1160+
**/
1161+
@ApiModelProperty(required = true, value = "Specifies page size")
1162+
public PageSizeEnum getPageSize() {
1163+
return pageSize;
1164+
}
1165+
1166+
public void setPageSize(PageSizeEnum pageSize) {
1167+
this.pageSize = pageSize;
1168+
}
1169+
1170+
public PdfConvertOptions pageOrientation(PageOrientationEnum pageOrientation) {
1171+
this.pageOrientation = pageOrientation;
1172+
return this;
1173+
}
1174+
1175+
/**
1176+
* Specifies page orientation
1177+
* @return pageOrientation
1178+
**/
1179+
@ApiModelProperty(required = true, value = "Specifies page orientation")
1180+
public PageOrientationEnum getPageOrientation() {
1181+
return pageOrientation;
1182+
}
1183+
1184+
public void setPageOrientation(PageOrientationEnum pageOrientation) {
1185+
this.pageOrientation = pageOrientation;
1186+
}
1187+
10181188

10191189
@Override
10201190
public boolean equals(java.lang.Object o) {
@@ -1055,12 +1225,14 @@ public boolean equals(java.lang.Object o) {
10551225
Objects.equals(this.pageLayout, pdfConvertOptions.pageLayout) &&
10561226
Objects.equals(this.pageMode, pdfConvertOptions.pageMode) &&
10571227
Objects.equals(this.rotate, pdfConvertOptions.rotate) &&
1228+
Objects.equals(this.pageSize, pdfConvertOptions.pageSize) &&
1229+
Objects.equals(this.pageOrientation, pdfConvertOptions.pageOrientation) &&
10581230
super.equals(o);
10591231
}
10601232

10611233
@Override
10621234
public int hashCode() {
1063-
return Objects.hash(width, height, dpi, password, marginTop, marginBottom, marginLeft, marginRight, pdfFormat, removePdfaCompliance, zoom, linearize, linkDuplicateStreams, removeUnusedObjects, removeUnusedStreams, compressImages, imageQuality, unembedFonts, grayscale, centerWindow, direction, displayDocTitle, fitWindow, hideMenuBar, hideToolBar, hideWindowUI, nonFullScreenPageMode, pageLayout, pageMode, rotate, super.hashCode());
1235+
return Objects.hash(width, height, dpi, password, marginTop, marginBottom, marginLeft, marginRight, pdfFormat, removePdfaCompliance, zoom, linearize, linkDuplicateStreams, removeUnusedObjects, removeUnusedStreams, compressImages, imageQuality, unembedFonts, grayscale, centerWindow, direction, displayDocTitle, fitWindow, hideMenuBar, hideToolBar, hideWindowUI, nonFullScreenPageMode, pageLayout, pageMode, rotate, pageSize, pageOrientation, super.hashCode());
10641236
}
10651237

10661238

@@ -1099,6 +1271,8 @@ public String toString() {
10991271
sb.append(" pageLayout: ").append(toIndentedString(pageLayout)).append("\n");
11001272
sb.append(" pageMode: ").append(toIndentedString(pageMode)).append("\n");
11011273
sb.append(" rotate: ").append(toIndentedString(rotate)).append("\n");
1274+
sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n");
1275+
sb.append(" pageOrientation: ").append(toIndentedString(pageOrientation)).append("\n");
11021276
sb.append("}");
11031277
return sb.toString();
11041278
}

src/main/java/com/groupdocs/cloud/conversion/model/WordProcessingConvertOptions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class WordProcessingConvertOptions extends ConvertOptions {
5252
private Integer height = null;
5353

5454
@SerializedName("dpi")
55-
private Double dpi = null;
55+
private Integer dpi = null;
5656

5757
@SerializedName("password")
5858
private String password = null;
@@ -280,7 +280,7 @@ public void setHeight(Integer height) {
280280
this.height = height;
281281
}
282282

283-
public WordProcessingConvertOptions dpi(Double dpi) {
283+
public WordProcessingConvertOptions dpi(Integer dpi) {
284284
this.dpi = dpi;
285285
return this;
286286
}
@@ -290,11 +290,11 @@ public WordProcessingConvertOptions dpi(Double dpi) {
290290
* @return dpi
291291
**/
292292
@ApiModelProperty(required = true, value = "Desired page DPI after conversion. The default resolution is: 96dpi")
293-
public Double getDpi() {
293+
public Integer getDpi() {
294294
return dpi;
295295
}
296296

297-
public void setDpi(Double dpi) {
297+
public void setDpi(Integer dpi) {
298298
this.dpi = dpi;
299299
}
300300

src/test/java/com/groupdocs/cloud/conversion/api/ConvertApiTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
import com.groupdocs.cloud.conversion.client.ApiException;
3838
import com.groupdocs.cloud.conversion.model.*;
39+
import com.groupdocs.cloud.conversion.model.PdfConvertOptions.PageSizeEnum;
3940
import com.groupdocs.cloud.conversion.model.requests.*;
4041

4142
import org.junit.Test;
@@ -125,6 +126,7 @@ public void convertDocumentDirectWithOptionsTest() throws ApiException, FileNotF
125126
loadOptions.setFormat("docx");
126127
loadOptions.setPassword(testFile.getPassword());
127128
PdfConvertOptions convertOptions = new PdfConvertOptions();
129+
convertOptions.setPageSize(PageSizeEnum.A4);
128130
convertOptions.setMarginTop(5);
129131

130132
ConvertDocumentDirectRequest request = new ConvertDocumentDirectRequest(format, fileObj, 1, 0, loadOptions, convertOptions);

0 commit comments

Comments
 (0)