RML2PDF Test Suite #32 - Image FunctionalityImage FunctionalityThis tries out some new features of images.PDF files as imagesPDF files (or their pagecatcherised pals, .data files) can be used just like images. Below
you should see a few little internet access icons; zoom in and you'll see they are vector. The original
PDF is 1296x1296, so the rubbish at top right of the page is the unscaled one being drawn in the illustration below at (0,0).The preserveAspectRatio flag lets you place your image in a box and it will be centered intelligently,
touching either the sides or the top depending on its own aspect ratio.The anchor attribute lets you determine which part of the image corresponds to the given x and y.
You can choose an anchor from the standard compass points.
nw
43 43 47 47 43 47 47 43
n
43 43 47 47 43 47 47 43
ne
43 43 47 47 43 47 47 43
w
43 43 47 47 43 47 47 43
c
43 43 47 47 43 47 47 43
e
43 43 47 47 43 47 47 43
sw
43 43 47 47 43 47 47 43
s
43 43 47 47 43 47 47 43
se
43 43 47 47 43 47 47 43
First attempt to place an image which has an artbox. We have created a PDF with MediaBox (the usual size measure) approx 300x400 points,
and a 100x100 circle in top right corner, and instructed RML to draw it in a box of half size. This seems to work.Now we try to place it with the art box. The blue should leak out horribly to left and below, but the red circle should
end up elliptical within the box. (In real life, the art box defines the 'area of interest' and there would be no stuff outside it). This isn't working yet. Also,
we get an extraneous boundary box from drawPdfImage appearing at top right - shifted the wrong way.