In the event that you have an original image that is too large to insert into the description of an item, there is the option to add the image as an attachment to the item. Once it is uploaded, it is possible to include the original image in PDF output. This article describes how to configure a report or document so that attachments are included in the PDF output. 


Example Data 

The section item in this document structure has an image attachment.

Example Configuration

Use the <ForEachAttachment> and <Image> tags in the configuration as shown below. 

<Report>
	<ForEach select="/IRRS">
		<ApplyItemTemplates/>
	</ForEach>
	<ItemTemplate type="SSSE">
		<Section title="#{Name}">
			<Description/>
			<ForEachAttachment>
				<Image/>
			</ForEachAttachment>
			<ForEach select="/ISSE">
				<ApplyItemTemplates/>
			</ForEach>
		</Section>
	</ItemTemplate>
</Report>


Example Result

This will put the attached image at the end of the item description in the document.


Things to Consider

If there is only one attachment, this would be a good solution as-is. However, with this solution, if there are multiple attachments, they would all get included in the document. If there are multiple attachments on an item and you do not want them all included in the report, one option is to create an item specifically for the attachment upload and link that item in to the item and configure it to be included in the report using the above tag. This is illustrated below.

Using a Specified Item for Single Attachment

Example Data 

The section item in this document structure has an image attachment.


Example Configuration

Use the <ForEachAttachment> and <Image> tags in the configuration as shown below. 

<Report>
	<ForEach select="/IRRS">
		<ApplyItemTemplates/>
	</ForEach> 
	<ItemTemplate type="SSSE">
		<Section title="#{Name}"> 
			<Description/>
			<ForEachAttachment>
				<Image/>
			</ForEachAttachment>
			<ForEach select="/ATCH1">
				<ApplyItemTemplates/>
			</ForEach>
		</Section>
	</ItemTemplate>
</Report>


Example Result

This will put the attached image as a sub-section after the Section 1 item. 


Note: Depending on quantity and size, including large images as attachments will affect total report generation time.

What's Next?

Find out how to include information about the attachment file in a report.