REDCap: Inline Image and Documents

With SMPH REDCap's upgrade to version 11.0.3, you will now be able to display certain images or files (uploaded to file upload fields) inline on a page. This feature works for forms, surveys, and emails.

Screenshot of file upload field where only the file name is displayed versus inline display.
How a standard file upload field appears when an image is uploaded, compared to when the @INLINE action tag is used to display the image inline.

On This Page:

@INLINE Action Tag

For a full list of REDCap action tags, and instructions on how to use them, see Action Tags in REDCap.

The @INLINE action tag allows a PDF file or image file that is uploaded to a File Upload field to be displayed in an inline manner on the survey page or data entry form. The PDF file or image can be viewed on the page by the user or survey participant without having to download it.

This action tag works for certain image types (JPG, JPEG, GIF, PNG, TIF, BMP) and PDF files.

Screenshot of inline display of a uploaded PDF. The PDF displays at 300 pixels wide.
Inline display of an uploaded PDF file.

Tips and tricks for using the @INLINE action tag:

  • The PDF/image will be displayed inline on the page immediately above the download link for the field.
  • The PDF will be displayed with 100% width by default. This means it will fill up to 100% of the width of the space it is contained in.
  • Images will be displayed with their native width:height ratio. PDFs will be displayed with a 300 pixel height by default.
  • If you wish to manually set the width and/or height of the image/PDF, you may put the width/height values inside parentheses after the action tag in the following manner:
    • @INLINE(width)
    • @INLINE(width,height).
    The width/height can be a percentage value (e.g., 50%) or a number representing size in pixels (e.g., 400). Thus @INLINE(50%) will display an image at 50% size for the area in which it is contained on the page, and @INLINE(400,100) would display the image always at 400px tall and 100px wide. To make an inline PDF appear taller on the page, you might use @INLINE(100%,600) since 300px is the default height for inline PDFs. The example will display the PDF at 600px height.
  • The @INLINE action tag also works if the File Upload field is embedded inside another field on the page.
  • Note: When adjusting the size of inline display for a file upload field, keep in mind that the display may be constrained by other design elements on the page.
  • Note: Inline images are not able to be displayed inside a downloaded PDF of a survey/instrument that contains data

Inline Piping

You can also pipe an uploaded image or file inline using the ":inline" piping parameter. You may pipe an uploaded image or file into another field or into an email.

To use inline piping, append ":inline" to the name the piped file upload field, such as [my_field:inline]. If the uploaded file is a PDF file or image file (JPG, JPEG, GIF, PNG, TIF, BMP), the file will be displayed in an inline manner so that it is viewable on the page.

The ':inline' option DOES work inside emails, so you can pipe a field with ':inline' inside the email body. This allows you to display inline images inside survey invitations or Alerts & Notifications.




Keywords:REDCap   Doc ID:111587
Owner:Amy S.Group:SMPH Research Informatics
Created:2021-06-10 09:42 CSTUpdated:2022-08-09 13:11 CST
Sites:Institute for Clinical and Translational Research, SMPH Research Informatics
Feedback:  0   0