com.aspose.words

Class PdfZoomBehavior

  • java.lang.Object
    • com.aspose.words.PdfZoomBehavior
public class PdfZoomBehavior 
extends java.lang.Object

Utility class containing constants. Specifies the type of zoom applied to a PDF document when it is opened in a PDF viewer.

Example:

Shows how to set the default zooming that a reader applies when opening a rendered PDF document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(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%.
PdfSaveOptions options = new PdfSaveOptions();
{
    options.setZoomBehavior(PdfZoomBehavior.ZOOM_FACTOR);
    options.setZoomFactor(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(getArtifactsDir() + "PdfSaveOptions.ZoomBehaviour.pdf", options);

Field Summary
static final intNONE = 0
How the document is displayed is left to the PDF viewer. Usually the viewer displays the document to fit page width.
static final intZOOM_FACTOR = 1
Displays the page using the specified zoom factor.
static final intFIT_PAGE = 2
Displays the page so it visible entirely.
static final intFIT_WIDTH = 3
Fits the width of the page.
static final intFIT_HEIGHT = 4
Fits the height of the page.
static final intFIT_BOX = 5
Fits the bounding box (rectangle containing all visible elements on the page).
 

    • Field Detail

      • NONE = 0

        public static final int NONE
        How the document is displayed is left to the PDF viewer. Usually the viewer displays the document to fit page width.
      • ZOOM_FACTOR = 1

        public static final int ZOOM_FACTOR
        Displays the page using the specified zoom factor.
      • FIT_PAGE = 2

        public static final int FIT_PAGE
        Displays the page so it visible entirely.
      • FIT_WIDTH = 3

        public static final int FIT_WIDTH
        Fits the width of the page.
      • FIT_HEIGHT = 4

        public static final int FIT_HEIGHT
        Fits the height of the page.
      • FIT_BOX = 5

        public static final int FIT_BOX
        Fits the bounding box (rectangle containing all visible elements on the page).