
I visit the MadCap Software forums practically daily, and recently I ran across this intriguing question: How can one show an image cropped in PDF output but have the whole image appear in online output, without resorting to two images?
The forum poster described how, back in his FrameMaker days, he could achieve this result by putting the image in a table anchor, which he would resize as a sort of pseudo-crop. In his PDF output, the image appeared “cropped,” but in his online output, the whole image appeared because the image itself wasn’t actually cropped.
Now he’s a MadCap Flare user, and he just can’t figure out how to achieve the same result without having to resort to having two files of the same image, a cropped version conditioned for PDF/print output and an uncropped version conditioned for online output. That approach would violate the goal of single-sourcing.
I like a good challenge, so on a rainy Saturday I set out to search for a single-image solution. I turned not to MadCap Flare, but to MadCap Capture.
The setup
I started by capturing an image, inserting it into a topic in a Flare project, and then electing to edit it with Capture.
Here’s what I had so far in Capture. In “Capture-speak,” this image is the background image. And this is what I wanted to crop… just not yet.
Making the full-size image
To make the full-size image, I simply needed to copy the background image as it looked right now. I right-clicked the background image and clicked Copy, and then I pasted. This gave me an image object, offset from the background image.
I repositioned the image object so that it completely overlaid the background image.
Next, I conditioned the image object for online only (using the default ScreenOnly condition), which would keep it out of the PDF output.
Last, in preparation for the next stage, I hid the image object. This was important so that I could again see the background image.
Here’s the image showing only the background image with the image object hidden. Now I was ready to crop.
Making the cropped image
Cropping the background image was a cinch. Using Capture’s Crop tool, I drew a rectangle over the part of the background that I wanted to keep. Here’s what I ended up with. (I didn’t need to worry about the “white space” because that was just the space being used by the hidden image object, which I knew would be excluded from the PDF output.)
The results
So, how did the image look in the generated output? (I assume you’re familiar with setting up a target in Flare to include and exclude content based on their conditions.)
Here’s the topic in the PDF, showing the cropped background image from which the image object had been excluded. (I hadn’t applied any particular CSS magic to the image or its containing <p> block in Flare, so the image is quite plain. That’s the subject of another article, I guess!)
And here’s the same topic in HTML5 Help, for which the full-size image object had been included.
What about other effects?
The original forum question didn’t ask about any other effects, but I was on the hunt anyway.
In my experimenting, I found that it was easy to add image effects that would appear in both the cropped image and the full-size image.
Because the image object perfectly overlaid the background image, I just added the objects I wanted, such as bubbles (for callouts), rectangles, blur effects, and grayscale effects.
I had to be careful not to place an object where it would would end up being outside the cropped background image. Otherwise that object would appear to be floating in space when output to the PDF and as we can see below, where the callout bubble and cursor are beyond the cropped image.
But suppose I did want those objects, but only for the image in online output. All I had to do was condition them for online only.
Finally, I unhide the image object and then used Capture’s Sink To Bottom tool to sink the image object to the bottom of the stack of objects. That way, there wouldn’t be any objects unintentionally hidden beneath it.
Recap
In the end, the process turns out to be pretty simple.
- Before cropping the background image (or, generally, doing anything else to it), copy it to make an image object.
- Reposition the image object to overlay it perfectly over the background image.
- Condition the image object for online output only.
- Hide the image object.
- Crop the background image.
To achieve other effects for the image, the general process is this:
- Add objects such as callouts, cursors, and shapes as usual. (To help you place the objects correctly, you may need to hide or to show the image object.)
- If any of the objects will be outside the cropped background image, condition them for online only.
- Sink the image object to the bottom to make sure nothing will be hidden beneath it.
If you try this technique, let me know what you think. And especially let me know if you find an even easier way!