Skip to main content

Adjust Image Size

When you About Publishing the content, the images will be sized based on added attributes and values. You can Preview a Topic to see what the sizing will look like in your different outputs.

Note

Depending on the type of software used to generate .svg images, setting width values for .svg images in PDF output can be problematic. In some cases this is caused by the omission of width and height attributes on the root svg element of the image.

  1. Check the image's raw XML code to see if the width and height attributes are included.

  2. If they are not, add them to the root element. Take the values from the viewBox attribute as the values for the width and height attributes. 

    Example: svg XML without width and height attributes.

    <?xml version="1.0" encoding="UTF-8"?>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:link="http://www.w3.org/1999/xlink" id="Layer_1" data-name="Layer_1" viewBox="0 0 258 429">

    After correction:

    <?xml version="1.0" encoding="UTF-8"?>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:link="http://www.w3.org/1999/xlink" id="Layer_1" data-name="Layer_1" viewBox="0 0 258 429" width="258" height="429">

    Note

    Do not use units for the with and height values.

Typically, you should only set the width or contentwidth of an image. The depth or contentdepth (height) will automatically be calculated, to keep the image dimensions as the original image file. If you set both width and depth the smallest value of the two is used, and the image is scaled according to that.

There are several other attributes to control width and height. If you want to learn more about the possibilities, see DocBook image sizing reference.

For HTML5 output, you can combine the features Thumbnail Images and Lightbox for Images to get small image versions that are enlarged when selected.

Tip

To keep the SVG functionality in HTML and HTML5:

  • Add the format attribute in Element Attributes Panel and select svg in the dropdown menu.

  • Use contentwidth and contentdepth instead of width and depth.

Format_SVG_small.jpg

To set the image sizing attributes:

  1. Select the topic or component in the Content Manager to open it in the Editor.

    Content Manager in Paligo. It shows the Documents section contains an Acme 100 Topics folder. Inside the folder there is a publication and many topics, including "Connect to Network (100).

    Alternatively, you can Create a Topic and edit that.

  2. Select the image that you want to size.

  3. Select the imagedata in Element Structure Menu and choose Go to element.

    Element-Structure-Menu_Imagedata_small.png
  4. Add the width or contentwidth attribute in the Element Attributes Panel.

  5. Set its value to the desired width in combination with any of the Measurement Units for Image Sizing.

    Width_Element_Attributes_Panel_small.jpg

    By default, if no measurement unit is specified, the sizes are in pixels (px).

  6. Select Save. Save icon.