10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Fig. 7.33Adjusting the pagesize. Left to right:exact, enlarge,shrink7.3.6 Adjusting the Page SizeIn the next example we will automatically adjust the page size to the object’s size. Thiscan be useful, for example, for archiving images in the PDF format. The reference point(x, y) can be used to specify whether the page will have exactly the object’s size, or somewhatlarger or smaller. When enlarging the page size (see Figure 7.33) some border willbe kept around the image. If the page size is smaller than the image some parts of theimage will be clipped. Let’s start with exactly matching the page size to the object’s size:p.fit_image(image, 0, 0, "adjustpage");The next code fragment increases the page size by 40 units in x and y direction, creatinga white border around the object:p.fit_image(image, 40, 40, "adjustpage");The next code fragment decreases the page size by 40 units in x and y direction. The objectwill be clipped at the page borders, and some area within the object (with a width of40 units) will be invisible:p.fit_image(image, -40, -40, "adjustpage");In addition to placing by means of x and y coordinates (which specify the object’s distancefrom the page edges, or the coordinate axes in the general case) you can also specifya target box. This is a rectangular area in which the object will be placed subject tovarious formatting rules. These can be controlled with the boxsize, fitmethod and positionoptions.7.3 Placing Images and Imported PDF Pages 163

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!