Is it possible to write watermark in FileOutputStream in java using any Aspose API for Java

Hi
I have a requirement. where before i download a file from the application, have to watermark the file using Aspose API for java.

Is that possible to manipulate the FileOutputStream of the file to write the watermark.

Thanks in advance

@sabkan Regarding Aspose.Words. To add the watermark it is required to load the document into the DOM. You can load the document only from InputStream. Please see our documentation to lean how to load documents:
https://docs.aspose.com/words/java/create-or-load-a-document/
Then you can add a watermark:
https://docs.aspose.com/words/java/working-with-watermark/
And then you can save the output into OutputStream:
https://docs.aspose.com/words/java/save-a-document/

@sabkan,

For Aspose.Cells, you will also need to load the Excel spreadsheet into Aspose.Cells’ object model. For Excel files, you can read/load the file from an InputStream, add a watermark to it, and finally save the output file into an output stream. See the documents for your reference.
https://docs.aspose.com/cells/java/opening-files-with-different-formats/#opening-through-stream
https://docs.aspose.com/cells/java/add-wordart-watermark-to-worksheet/
https://docs.aspose.com/cells/java/saving-excel-files-to-csv-pdf-and-other-formats/#saving-file-to-a-stream

Furthermore, you can perform the same process for other Aspose for Java APIs. Please inform us with details and resource files if you encounter any issues or problems while working with other Aspose for Java APIs.

@alexey.noskov Thanks for the quick response.

@amjad.sahi Thanks for the quick response.

Hope in Powerpoint and PDF types also we can read from the InputStream to watermark?

@sabkan,

Yes, it may also work for Aspose.Slides and Aspose.PDF APIs.
Please let us know if you encounter any issues with any Aspose for Java API.

@sabkan,
With Aspose.Slides for Java, you can load PowerPoint presentations from any InputStream, add a watermark, and save the presentation to a file or a stream.