Product: | Platform: | Area: | Versions: |
Impressario for Director | All | PDF Customization | v2.x Full Version |
Summary
Impressario allows you to replace an existing bitmap image within your PDF document. By default the new image is stretched to fill the container of the previously exisitng image. This is fine if the new image is the same size as the original, or if you want it to be stretched to fill the original dimenstions. However, if you are inserting an image that is smaller than the original, and you don't want to change the image size, we have some tips and a pre-scripted behavior to make life easier.
For greater flexibility and control over the positioning of your bitmaps within the PDF "container", use Director's CopyPixels function, or use the pre-scripted behavior named ReplaceImage, available in the sample movie below.
Solution
Start by placing a bitmap image in your source document that is larger than the image(s) you plan to insert at runtime. This will be the "place holder" image. Create your PDF and use Adobe Acrobat to define the container, as described in the Impressario User Manual.
Important: Take note of the original image dimensions; you will need them for the ReplaceImage behavior parameters (for use with the CopyPixels function).
In Director, you can use the ReplaceImage behavior, as shown in the sample movie below. This behavior lets you choose the horizontal alignments (Left, Right, Center) and vertical alignments (Top, Bottom, Center), as well as the background fill color.
This sample movie is provided openSource. You are free to customize the ReplaceImage behavior or any of the code within this sample as needed.
Sample
This sample is supported by Director 8.5 and above: | |