Skip to content

Commit af09119

Browse files
Merge pull request #59 from groupdocs-annotation/prepare-2304
prepare-2304
2 parents e6b791a + 170b188 commit af09119

Some content is hidden

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

41 files changed

+209
-173
lines changed

Demos/Dropwizard/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@angular/platform-browser": "^8.2.4",
3737
"@angular/platform-browser-dynamic": "^8.2.4",
3838
"@angular/router": "^8.2.4",
39-
"@groupdocs.examples.angular/annotation": "^0.8.54",
39+
"@groupdocs.examples.angular/annotation": "^0.8.98",
4040
"@nrwl/angular": "^8.12.11",
4141
"common-components": "^1.0.5",
4242
"core-js": "^2.6.11",

Demos/Dropwizard/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<dependency>
8282
<groupId>com.groupdocs</groupId>
8383
<artifactId>groupdocs-annotation</artifactId>
84-
<version>23.2</version>
84+
<version>23.4</version>
8585
</dependency>
8686
<dependency>
8787
<groupId>javax.xml.bind</groupId>

Demos/Spring/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@angular/platform-browser": "^8.2.4",
3737
"@angular/platform-browser-dynamic": "^8.2.4",
3838
"@angular/router": "^8.2.4",
39-
"@groupdocs.examples.angular/annotation": "^0.8.70",
39+
"@groupdocs.examples.angular/annotation": "^0.8.98",
4040
"@nrwl/angular": "^8.12.11",
4141
"common-components": "^1.0.5",
4242
"core-js": "^2.6.11",

Demos/Spring/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
<dependency>
132132
<groupId>com.groupdocs</groupId>
133133
<artifactId>groupdocs-annotation</artifactId>
134-
<version>23.2</version>
134+
<version>23.4</version>
135135
</dependency>
136136
<dependency>
137137
<groupId>com.google.guava</groupId>
26.3 KB
Binary file not shown.

Examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>com.groupdocs</groupId>
2525
<artifactId>groupdocs-annotation</artifactId>
26-
<version>23.2</version>
26+
<version>23.4</version>
2727
</dependency>
2828
</dependencies>
2929
<repositories>

Examples/src/main/java/com/groupdocs/annotation/examples/Constants.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package com.groupdocs.annotation.examples;
22

33
public class Constants {
4-
54
public static String PROJECT_PATH = System.getProperty("user.dir");
65

76
public static final String LicensePath = "C:\\Conholdate.Total.Product.Family.lic";//GroupDocs.Total.Java.lic";
87
public static final String SamplesPath = "\\Resources\\SampleFiles\\";
98
public static final String OutputPath = "\\Resources\\Output\\";
109

11-
public static String INPUT = getSampleFilePath("input.pdf");
10+
public static String INPUT_PDF = getSampleFilePath("input.pdf");
1211
public static String CLEAR = getSampleFilePath("clear.pdf");
1312
public static String ANNOTATED_BIG = getSampleFilePath("annotated_big.pdf");
1413
public static String ANNOTATED_WITH_REPLIES = getSampleFilePath("annotated_with_replies.pdf");
@@ -23,6 +22,8 @@ public class Constants {
2322
public static String INPUT_DOC = getSampleFilePath("sample.docx");
2423
public static String INPUT_NEW = getSampleFilePath("sampleNew.pdf");
2524

25+
public static String INPUT_CELL = getSampleFilePath("input.xlsx");
26+
2627
private static String getSampleFilePath(String fileName) {
2728
return PROJECT_PATH + SamplesPath + fileName;
2829
}

Examples/src/main/java/com/groupdocs/annotation/examples/RunExamples.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public class RunExamples {
1414

1515
public static void main(String[] args) throws IOException {
16-
System.out.println("Open RunExamples.cs. \nIn Main() method uncomment the example that you want to run.");
16+
System.out.println("Open RunExamples.java. \nIn Main() method uncomment the example that you want to run.");
1717
System.out.println("=====================================================");
1818

1919
//NOTE: Please uncomment the example you want to try out
@@ -26,25 +26,31 @@ public static void main(String[] args) throws IOException {
2626
GetSupportedFileFormats.run();
2727

2828
// Get file info
29-
GetFileInfo.run();
29+
GetFileInfo.run(Constants.INPUT_PDF);
30+
GetFileInfo.run(Constants.INPUT_DOC);
31+
GetFileInfo.run(Constants.INPUT_CELL);
3032

3133
// Extract annotations from document
32-
// ExtractAnnotationsFromDocument.run();
34+
ExtractAnnotationsFromDocument.run(Constants.INPUT_PDF);
35+
// ExtractAnnotationsFromDocument.run(Constants.INPUT_DOC);
36+
// ExtractAnnotationsFromDocument.run(Constants.INPUT_CELL);
3337

3438
// Remove annotation from document
3539
// RemoveAnnotationFromDocument.run();
3640

3741
// Generate document pages preview
38-
GenerateDocumentPagesPreview.run();
42+
GenerateDocumentPagesPreview.run(Constants.INPUT_PDF);
43+
// GenerateDocumentPagesPreview.run(Constants.INPUT_DOC);
44+
// GenerateDocumentPagesPreview.run(Constants.INPUT_CELL);
3945

4046
// Saving specific page range
41-
SavingSpecificPageRange.run();
47+
SavingSpecificPageRange.run(Constants.INPUT_PDF);
4248

4349
// Saving only pages with annotations
44-
SavingOnlyPagesWithAnnotations.run();
50+
SavingOnlyPagesWithAnnotations.run(Constants.INPUT_PDF);
4551

4652
// Filtering annotation types
47-
// FilteringAnnotationTypes.run();// - Unsupported exception
53+
FilteringAnnotationTypes.run(Constants.INPUT_PDF);
4854

4955
// Add area annotation
5056
AddAreaAnnotation.run();
@@ -128,6 +134,8 @@ public static void main(String[] args) throws IOException {
128134
// LoadDocumentFromAzure.run();
129135

130136
MinimalAnnotation.run();
137+
138+
AddUserRole.run();
131139

132140
System.out.println();
133141
System.out.println("All done.");

Examples/src/main/java/com/groupdocs/annotation/examples/advanced_usage/GenerateDocumentPagesPreview.java

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,27 @@
1717
*/
1818
public class GenerateDocumentPagesPreview {
1919

20-
public static void run() {
21-
final Annotator annotator = new Annotator(Constants.INPUT_NEW);
22-
23-
PreviewOptions previewOptions = new PreviewOptions(new CreatePageStream() {
24-
@Override
25-
public OutputStream invoke(int pageNumber) {
26-
try {
27-
//String OutputPath = "//Resources//Output/";
28-
String fileName = Constants.getOutputFilePath("GenerateDocumentPagesPreview_"+pageNumber, "png");//OutputPath + "GenerateDocumentPagesPreview_"+pageNumber+".png";
29-
OutputStream result = new FileOutputStream(fileName);
30-
return result;
31-
} catch (Exception ex) {
32-
throw new GroupDocsException(ex);
20+
public static void run(String inputFile) {
21+
try(final Annotator annotator = new Annotator(inputFile)) {
22+
PreviewOptions previewOptions = new PreviewOptions(new CreatePageStream() {
23+
@Override
24+
public OutputStream invoke(int pageNumber) {
25+
try {
26+
String fileName = Constants.getOutputFilePath("GenerateDocumentPagesPreview" + "_" + pageNumber, "png");
27+
OutputStream result = new FileOutputStream(fileName);
28+
return result;
29+
} catch (Exception ex) {
30+
throw new GroupDocsException(ex);
31+
}
3332
}
34-
}
35-
});
33+
});
3634

37-
previewOptions.setResolution(50);
35+
previewOptions.setResolution(85);
36+
previewOptions.setPreviewFormat(PreviewFormats.PNG);
37+
previewOptions.setPageNumbers(new int[]{1, 2});
38+
annotator.getDocument().generatePreview(previewOptions);
3839

39-
previewOptions.setPreviewFormat(PreviewFormats.PNG);
40-
41-
previewOptions.setPageNumbers(new int[]{1, 2});
42-
annotator.getDocument().generatePreview(previewOptions);
43-
44-
annotator.dispose();
45-
46-
System.out.println("\nDocument previews generated successfully.\nCheck output in " + Constants.OutputPath);
40+
System.out.println("\nDocument previews generated successfully.\nCheck output in " + Constants.OutputPath);
41+
}
4742
}
4843
}

Examples/src/main/java/com/groupdocs/annotation/examples/advanced_usage/loading/LoadPasswordProtectedDocuments.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class LoadPasswordProtectedDocuments {
1717

1818
public static void run() {
19-
String outputPath = Constants.getOutputFilePath("LoadPasswordProtectedDocuments", FilenameUtils.getExtension(Constants.INPUT));
19+
String outputPath = Constants.getOutputFilePath("LoadPasswordProtectedDocuments", FilenameUtils.getExtension(Constants.INPUT_PDF));
2020

2121
LoadOptions loadOptions = new LoadOptions();
2222
loadOptions.setPassword("1234");

0 commit comments

Comments
 (0)