Best-practice strategies for your documentation projects
585.383.1992

How to show an image cropped in one Flare output but not in another

How to show an image cropped in one Flare output but not in another

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.

Because I opened the image from within Flare, the Flare project’s conditions came along with the image into Capture. But did you know that you can open an image directly in Capture and then associate the image with a Flare project so that you have access to that project’s conditions and variables? Check out the Project tab of the image’s File Properties. But I digress…

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.

OriginalImage_InCapture

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.

OriginalImage_withImageObject_uponCopy

I repositioned the image object so that it completely overlaid the background image.

I worked with Snap to Grid turned on, so aligning the two images perfectly was easy.

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.

Don’t confuse hiding an object in the Capture Editor with excluding that object from output by way of conditioning. Hiding objects in the Capture Editor just makes some tasks easier while editing.

Here’s the image showing only the background image with the image object hidden. Now I was ready to crop.

OriginalImage_withImageObject_Hidden

Making the cropped image

Cropping the background image was a cinch. Using Capture’s Cropimage 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.)

OriginalImage_Cropped

You might be wondering if you should condition the background image for PDF/print only? Actually, no. The only way to condition the background image is to condition the file itself, and that would exclude the image altogether from the online 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!)

ImageInPDF

And here’s the same topic in HTML5 Help, for which the full-size image object had been included.

ImageInHTML5Help

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.

If you edit the background image in any way (such as adding a callout) before copying it to make the image object, all those same edits will be copied too, but they will be flattened (become uneditable) in the image object. My general advice is to copy the background image before you’ve done anything else to it. (YMMV. You might find that you want to manipulate the background image in some way, such as to scale it, before making the copy image object.)

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.

OriginalImage_Cropped_withObjects

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 image 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.

  1. Before cropping the background image (or, generally, doing anything else to it), copy it to make an image object.
  2. Reposition the image object to overlay it perfectly over the background image.
  3. Condition the image object for online output only.
  4. Hide the image object.
  5. Crop the background image.

To achieve other effects for the image, the general process is this:

  1. 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.)
  2. If any of the objects will be outside the cropped background image, condition them for online only.
  3. 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!

Share

MAD Certified in Flare

MadCap Advanced Developer (MAD) certified in Flare since 2009

Latest Posts

Bad Behavior has blocked 168 access attempts in the last 7 days.