Learn more about saving the documents at the Saving documents page.
defsave(self,document):...
Parameter
Type
Description
document
io.RawIOBase
The stream to save the document data to.
Example
importioimportgroupdocs.watermarkasgwfromgroupdocs.watermark.contentsimportTextWatermarkfromgroupdocs.watermark.fontimportFontwithgw.Watermarker("input.pdf")aswatermarker:watermark=TextWatermark("top secret",Font("Arial",36))watermarker.add(watermark)stream=io.BytesIO()watermarker.save(stream)# stream now contains the saved document data
save
Saves the document data to the underlying stream using the specified save options.
Saves the document to the specified stream using save options.
Learn more about saving the documents at the GroupDocs documentation site.
defsave(self,document,options):...
Parameter
Type
Description
document
io.RawIOBase
The stream to save the document data to.
options
SaveOptions
Additional options to use when saving a document.
Example
importioimportgroupdocs.watermarkasgwfromgroupdocs.watermarkimportTextWatermark,SaveOptionsfromSystem.DrawingimportFontwithgw.Watermarker("input.pdf")aswatermarker:watermark=TextWatermark("top secret",Font("Arial",36))watermarker.add(watermark)withio.BytesIO()asstream:watermarker.save(stream,SaveOptions())# stream now contains the saved document bytes