public class PdfZoomBehavior
extends java.lang.Object
Examples:
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);
| Modifier and Type | Field and Description |
|---|---|
static int |
FIT_BOX
Fits the bounding box (rectangle containing all visible elements on the page).
|
static int |
FIT_HEIGHT
Fits the height of the page.
|
static int |
FIT_PAGE
Displays the page so it visible entirely.
|
static int |
FIT_WIDTH
Fits the width of the page.
|
static int |
length |
static int |
NONE
How the document is displayed is left to the PDF viewer.
|
static int |
ZOOM_FACTOR
Displays the page using the specified zoom factor.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String pdfZoomBehaviorName) |
static java.lang.String |
getName(int pdfZoomBehavior) |
static int[] |
getValues() |
static java.lang.String |
toString(int pdfZoomBehavior) |
public static int NONE
public static int ZOOM_FACTOR
public static int FIT_PAGE
public static int FIT_WIDTH
public static int FIT_HEIGHT
public static int FIT_BOX
public static int length