HTML Extended: <phpdocx_image> tag

<phpdocx_image> tag

PREMIUM TRIAL / ADVANCED

Inserts an image.

HTML Extended (Premium licenses)
Attribute Description
data-src Path to the image or stream that you want to insert into the Word document. If a stream is added use with the streamMode option.
data-borderColor hexadecimal color: FF0000.
data-borderStyle Possible values are:
  • solid
  • dot
  • dash
  • lgDash
  • dashDot
  • lgDashDot
  • lgDashDotDot
  • sysDash
  • sysDot
  • sysDashDot
  • sysDashDotDot
data-borderWidth Given in emus (1cm = 360000 emus).
data-dpi Dots per inch.
data-float (left, right, center) floating image. It only applies if textWrap is not inline (default value).
data-height Image height in pixels.
data-horizontalOffset Given in emus (1cm = 360000 emus). Only applies if the image is not floating.
data-hyperlink Image link.
data-imageAlign Image alignment: right, center...
data-mime Forces a mime (image/jpg, image/jpeg, image/png, image/gif, image/bmp, image/webp).
data-relativeToHorizontal margin (default), page, column, character, leftMargin, rightMargin, insideMargin, outsideMargin. Not compatible with inline text wrapping.
data-relativeToVertical margin, page, line (default), paragraph, topMargin, bottomMargin, insideMargin, outsideMargin. Not compatible with inline text wrapping.
data-scaling % of size: 50, 100.
data-spacingTop Spacing top in pixels.
data-spacingBottom Spacing bottom in pixels.
data-spacingLeft Spacing left in pixels.
data-spacingRight Spacing right in pixels.
data-streamMode If true, uses src as stream. PHP 5.4 or greater needed to autodetect the mime type; otherwise set it using mime option. Default is false.
data-target document (default value), defaultHeader, firstHeader, evenHeader, defaultFooter, firstFooter, evenFooter, comment, endnote or footnote.
data-textWrap Text wrap:
  • 0 (inline)
  • 1 (square)
  • 2 (front)
  • 3 (back)
  • 4 (top and bottom)
data-verticalAlign top, center, bottom. To be used with relativeFromVertical.
data-verticalOffset Given in emus (1cm = 360000 emus).
data-width Image width in pixels.
Code samples

Example #1

The resulting Word document looks like: