zoom_behavior property
PdfSaveOptions.zoom_behavior property
Gets or sets a value determining what type of zoom should be applied when a document is opened with a PDF viewer.
@property
def zoom_behavior(self) -> aspose.words.saving.PdfZoomBehavior:
...
@zoom_behavior.setter
def zoom_behavior(self, value: aspose.words.saving.PdfZoomBehavior):
...
Remarks
The default value is PdfZoomBehavior.NONE, i.e. no fit is applied.
Examples
Shows how to set the default zooming that a reader applies when opening a rendered PDF document.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
builder.writeln('Hello world!')
# Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
# to modify how that method converts the document to .PDF.
# Set the "ZoomBehavior" property to "PdfZoomBehavior.ZoomFactor" to get a PDF reader to
# apply a percentage-based zoom factor when we open the document with it.
# Set the "ZoomFactor" property to "25" to give the zoom factor a value of 25%.
options = aw.saving.PdfSaveOptions()
options.zoom_behavior = aw.saving.PdfZoomBehavior.ZOOM_FACTOR
options.zoom_factor = 25
# When we open this document using a reader such as Adobe Acrobat, we will see the document scaled at 1/4 of its actual size.
doc.save(file_name=ARTIFACTS_DIR + 'PdfSaveOptions.ZoomBehaviour.pdf', save_options=options)
See Also
- module aspose.words.saving
- class PdfSaveOptions