Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The following example code illustrates how to write a Web API for importing Word

The web browsers do not support to display metafile images like EMF and WMF and also TIFF format images. As a fallback approach, you can convert the metafile/TIFF format image to raster image using any image converter in the `MetafileImageParsed` event and this fallback raster image will be displayed in the client-side Document editor component.

>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or Tiff format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.
>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or TIFF format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.

The following example code illustrates how to use `MetafileImageParsed` event for creating fallback raster image for metafile present in a Word document.

Expand Down Expand Up @@ -331,15 +331,16 @@ The following example code illustrates how to write a Web API for restrict editi
@CrossOrigin(origins = "*", allowedHeaders = "*")
@PostMapping("/api/wordeditor/RestrictEditing")
public String[] restrictEditing(@RequestBody CustomRestrictParameter param) throws Exception {
if (param.passwordBase64 == "" && param.passwordBase64 == null)
if (param.passwordBase64 == "" || param.passwordBase64 == null)
return null;
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount);
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount, param.algorithmSid);
}

public class CustomRestrictParameter {
public String passwordBase64;
public String saltBase64;
public int spinCount;
public String algorithmSid;
public String getPasswordBase64() {
return passwordBase64;
}
Expand All @@ -349,6 +350,9 @@ The following example code illustrates how to write a Web API for restrict editi
public int getSpinCount() {
return spinCount;
}
public String getAlgorithmSid() {
return algorithmSid;
}
public void setPasswordBase64(String value) {
passwordBase64= value;
}
Expand All @@ -358,6 +362,9 @@ The following example code illustrates how to write a Web API for restrict editi
public void setSpinCount(int value) {
spinCount= value;
}
public void setAlgorithmSid(String value) {
algorithmSid= value;
}
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The following example code illustrates how to write a Web API for importing Word

The web browsers do not support to display metafile images like EMF and WMF and also TIFF format images. As a fallback approach, you can convert the metafile/TIFF format image to raster image using any image converter in the `MetafileImageParsed` event and this fallback raster image will be displayed in the client-side Document editor component.

>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or Tiff format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.
>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or TIFF format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.

The following example code illustrates how to use `MetafileImageParsed` event for creating fallback raster image for metafile present in a Word document.

Expand Down Expand Up @@ -336,15 +336,16 @@ The following example code illustrates how to write a Web API for restrict editi
@CrossOrigin(origins = "*", allowedHeaders = "*")
@PostMapping("/api/wordeditor/RestrictEditing")
public String[] restrictEditing(@RequestBody CustomRestrictParameter param) throws Exception {
if (param.passwordBase64 == "" && param.passwordBase64 == null)
if (param.passwordBase64 == "" || param.passwordBase64 == null)
return null;
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount);
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount, param.algorithmSid);
}

public class CustomRestrictParameter {
public String passwordBase64;
public String saltBase64;
public int spinCount;
public String algorithmSid;
public String getPasswordBase64() {
return passwordBase64;
}
Expand All @@ -354,6 +355,9 @@ The following example code illustrates how to write a Web API for restrict editi
public int getSpinCount() {
return spinCount;
}
public String getAlgorithmSid() {
return algorithmSid;
}
public void setPasswordBase64(String value) {
passwordBase64= value;
}
Expand All @@ -363,6 +367,9 @@ The following example code illustrates how to write a Web API for restrict editi
public void setSpinCount(int value) {
spinCount= value;
}
public void setAlgorithmSid(String value) {
algorithmSid= value;
}
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The following example code illustrates how to write a Web API for importing Word

The web browsers do not support to display metafile images like EMF and WMF and also TIFF format images. As a fallback approach, you can convert the metafile/TIFF format image to raster image using any image converter in the `MetafileImageParsed` event and this fallback raster image will be displayed in the client-side Document editor component.

>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or Tiff format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.
>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or TIFF format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.

The following example code illustrates how to use `MetafileImageParsed` event for creating fallback raster image for metafile present in a Word document.

Expand Down Expand Up @@ -336,15 +336,16 @@ The following example code illustrates how to write a Web API for restrict editi
@CrossOrigin(origins = "*", allowedHeaders = "*")
@PostMapping("/api/wordeditor/RestrictEditing")
public String[] restrictEditing(@RequestBody CustomRestrictParameter param) throws Exception {
if (param.passwordBase64 == "" && param.passwordBase64 == null)
if (param.passwordBase64 == "" || param.passwordBase64 == null)
return null;
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount);
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount, param.algorithmSid);
}

public class CustomRestrictParameter {
public String passwordBase64;
public String saltBase64;
public int spinCount;
public String algorithmSid;
public String getPasswordBase64() {
return passwordBase64;
}
Expand All @@ -354,6 +355,9 @@ The following example code illustrates how to write a Web API for restrict editi
public int getSpinCount() {
return spinCount;
}
public String getAlgorithmSid() {
return algorithmSid;
}
public void setPasswordBase64(String value) {
passwordBase64= value;
}
Expand All @@ -363,6 +367,9 @@ The following example code illustrates how to write a Web API for restrict editi
public void setSpinCount(int value) {
spinCount= value;
}
public void setAlgorithmSid(String value) {
algorithmSid= value;
}
}
```

Expand Down
13 changes: 10 additions & 3 deletions Document-Processing/Word/Word-Processor/react/web-services/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The following example code illustrates how to write a Web API for importing Word

The web browsers do not support to display metafile images like EMF and WMF and also TIFF format images. As a fallback approach, you can convert the metafile/TIFF format image to raster image using any image converter in the `MetafileImageParsed` event and this fallback raster image will be displayed in the client-side Document editor component.

>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or Tiff format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.
>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or TIFF format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.

The following example code illustrates how to use `MetafileImageParsed` event for creating fallback raster image for metafile present in a Word document.

Expand Down Expand Up @@ -333,15 +333,16 @@ The following example code illustrates how to write a Web API for restrict editi
@CrossOrigin(origins = "*", allowedHeaders = "*")
@PostMapping("/api/wordeditor/RestrictEditing")
public String[] restrictEditing(@RequestBody CustomRestrictParameter param) throws Exception {
if (param.passwordBase64 == "" && param.passwordBase64 == null)
if (param.passwordBase64 == "" || param.passwordBase64 == null)
return null;
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount);
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount, param.algorithmSid);
}

public class CustomRestrictParameter {
public String passwordBase64;
public String saltBase64;
public int spinCount;
public String algorithmSid;
public String getPasswordBase64() {
return passwordBase64;
}
Expand All @@ -351,6 +352,9 @@ The following example code illustrates how to write a Web API for restrict editi
public int getSpinCount() {
return spinCount;
}
public String getAlgorithmSid() {
return algorithmSid;
}
public void setPasswordBase64(String value) {
passwordBase64= value;
}
Expand All @@ -360,6 +364,9 @@ The following example code illustrates how to write a Web API for restrict editi
public void setSpinCount(int value) {
spinCount= value;
}
public void setAlgorithmSid(String value) {
algorithmSid= value;
}
}
```

Expand Down
13 changes: 10 additions & 3 deletions Document-Processing/Word/Word-Processor/vue/web-services/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The following example code illustrates how to write a Web API for importing Word

The web browsers do not support to display metafile images like EMF and WMF and also TIFF format images. As a fallback approach, you can convert the metafile/TIFF format image to raster image using any image converter in the `MetafileImageParsed` event and this fallback raster image will be displayed in the client-side Document editor component.

>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or Tiff format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.
>Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `getMetafileStream()` property and you can get the `getIsMetafile()` boolean value to determine whether the image is meta file images(WMF,EMF) or TIFF format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using TwelveMonkeys ImageIO TIFF library.

The following example code illustrates how to use `MetafileImageParsed` event for creating fallback raster image for metafile present in a Word document.

Expand Down Expand Up @@ -291,15 +291,16 @@ The following example code illustrates how to write a Web API for restrict editi
@CrossOrigin(origins = "*", allowedHeaders = "*")
@PostMapping("/api/wordeditor/RestrictEditing")
public String[] restrictEditing(@RequestBody CustomRestrictParameter param) throws Exception {
if (param.passwordBase64 == "" && param.passwordBase64 == null)
if (param.passwordBase64 == "" || param.passwordBase64 == null)
return null;
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount);
return WordProcessorHelper.computeHash(param.passwordBase64, param.saltBase64, param.spinCount, param.algorithmSid);
}

public class CustomRestrictParameter {
public String passwordBase64;
public String saltBase64;
public int spinCount;
public String algorithmSid;
public String getPasswordBase64() {
return passwordBase64;
}
Expand All @@ -309,6 +310,9 @@ The following example code illustrates how to write a Web API for restrict editi
public int getSpinCount() {
return spinCount;
}
public String getAlgorithmSid() {
return algorithmSid;
}
public void setPasswordBase64(String value) {
passwordBase64= value;
}
Expand All @@ -318,6 +322,9 @@ The following example code illustrates how to write a Web API for restrict editi
public void setSpinCount(int value) {
spinCount= value;
}
public void setAlgorithmSid(String value) {
algorithmSid= value;
}
}
```

Expand Down