Overview
A Web Page View field creates a document-like view using underlying entity data. It combines HTML with system variables and supports printing, exporting, saving, and converting to PDF.
What You Build: The HTML Template
The HTML Template is the body of your document. It is typically a mix of:
- HTML tags that control layout and formatting
- Static text that does not change
- Variables that are replaced with live values when the document is generated
The HTML should conform to applicable accessibility requirements.
SmartFields Sample Template can be used as a starter layout that renders fields in a review-friendly format and generally converts well to PDF.
Configure the Field: Document Options
General Options
- Open in Modal Window — Displays the document in a modal window.
- Enable Printing — Adds a print button using the browser’s print function. For best results, export to PDF and print from the PDF.
- Enable Editing — Allows temporary HTML edits (changes are not saved).
- Enable Switching Language — Adds a language dropdown; translated custom-field values display when switching languages.
- Render As XML Document — Prepares the output as XML.
- Default User ID as File Name — When saving to file fields, names the stored file using the current user’s ID.
If a file with that name already exists, it will be replaced unless versioning is enabled on the target Multiple Files field. - Enable HCAI — Enables HCAI features (if available in your environment).
- HCAI Automatically Redirect — Applies automatic HCAI redirect behavior (if configured).
- Enable Field Selection for SmartFields — Allows selecting a subset of fields to display.
- Hide Instructions — Hides instruction text in exported PDFs.
PDF Options
- Open Directly as PDF — Automatically generates a PDF without first showing the HTML preview.
- Enable Online Signature — Enables online signature features on the document.
- Enable Password Protection — Prompts for a password when saving/emailing a PDF; the password is required to open it.
- Enable Email as Attachment — Allows emailing the PDF as an attachment.
- Enable Export — Adds an “Export as DOCX” button (formatting may not be maintained).
- Enable Save to Server — Saves the PDF into a Multiple Files field on the related entity.
PDF Page Options
- Fit to Page — Compresses content to fit onto one PDF page.
- Landscape Mode — Outputs the PDF in landscape orientation.
Paper Size
- Letter — 8.5 × 11 inches
- Legal — 8 × 13 inches
- Ledger — 11 × 17 inches
- A4 — 297 × 210 mm
Maximum Page Length
Defines the maximum number of pages allowed when saving the generated PDF into a Multiple Files field. This includes any pages appended via ssattach. If the PDF exceeds the limit, it will not be stored.
HTML Options
- Enable Email as Attachment — Sends the document as the body of an email message.
- Enable Save to Server — Saves the document as HTML into a Multiple Files field.
- Enable Export — Exports a local HTML copy.
Word Options
- Enable Export — Exposes the “Export as DOCX” button.
Value Storage
- Value Storage — Allows linking multiple custom fields to the same underlying file data.
- Enforce Selection — Restricts file storage to the selected Multiple Files field only.
Attaching PDFs to the Output (ssattach)
You can append one or more PDF documents (stored in a file field or Smart Folder) to a Web Page View output using ssattach.
Important: Attached PDFs do not appear in HTML preview mode. They are appended only when the output is generated as a PDF (exported/saved/emailed as PDF, or produced by workflow as a PDF attachment).
Syntax
<!--@ssattach(position;pdf file location)-->
Where:
- position is
beforeorafter - pdf file location can be one of the following:
Smart Folder
/files/folder1/folder2/File_Name.pdf
The location must begin with /files/... (omit the domain portion).
Single File Custom Field
@CustomFieldName.value@
Note: .value is required.
Multiple Files Custom Field
@CustomFieldName.files@
All PDF files stored in the field will be attached.
Parent / Grandparent File Fields
@parent.CustomFieldName.value@ @parent.parent.CustomFieldName.files@
Examples
Append a Smart Folder PDF before the Web Page View content:
<!--@ssattach(before;/files/1234/123/myfile.pdf)-->
Append a Smart Folder PDF after the Web Page View content:
<!--@ssattach(after;/files/1234/123/myfile.pdf)-->
Append a PDF from a Single File custom field named “AttachPDFFile”:
<!--@ssattach(before;@AttachPDFFile.value@)-->
Attach PDFs from role custom fields in a Level 1 Web Page View (contact section):
[#(?object=contact;)<!--@ssattach(after;$?opr_123456.value$)-->#]
Where 123456 is the custom field ID.
Attach PDF files from an organization (customer) multi-file upload field:
<!--@ssattach(after;@client.UploadFieldName.files@)-->
Attach a file from a transaction to a Level 1 Web Page View:
@client.[#(?object=transaction::criteria=typename="Transaction Name" and statusname="Submitted"::orderby=trsts desc) <!--@ssattach(after;$fieldname.value$)-->#]@
Transaction example:
@client.[#(?object=transaction::criteria=typename="Audited Financial Statements" and statusname="Submitted"::orderby=trsts desc) <!--@ssattach(after;$Recent Audited Financial statements.value$)-->#]@
Multiple Attachments
<!--@ssattach(before;/files/1234/123/myfileheader.pdf)--> <!--@ssattach(after;/files/1234/123/myfilefooter.pdf)--> <!--@ssattach(after;/files/1234/123/myfileappendix.pdf)--> <html><body> My PDF content </body></html>
Conditional Attachments with SSLogic
<!--@sslogic('@type@'='contact')-->
<!--@ssattach(after;@parent.contract.value@)-->
<!--@else-->
<!--@ssattach(after;@parent.othercontract.value@)-->
<!--@end-->Security Restriction Warning
PDFs with security restrictions (for example, content copying/extraction restrictions) may be encrypted and cannot be appended.
Conditional Display (SSLogic)
Web Page View fields support a logic interpreter for conditional display and actions using sslogic:
<!--@sslogic(CONDITION)--> Content displayed when condition is true <!--@end-->
Images and Logos
A common pattern is storing an image/logo in an Image-type custom field and referencing it in your template using a variable (for example a branch/company logo field).
Note: When converting to PDF, image references often need to be relative paths rather than absolute URLs.
Layout, Printing, and PDF Output Tips
Margins and Header/Footer
- Control margins both in your HTML template and in the user’s browser print settings.
- If browser margins are not reduced, browser margins and document margins can combine and reduce printed font size.
Default Font Considerations
If you do not set font and size in the Web Page View, the display may be governed by browser settings. For consistent output, explicitly set font styles in your HTML.
Paragraph Spacing vs Line Breaks
- Enter typically creates a new paragraph (
<p>) which may add extra spacing due to margins. - Shift + Enter typically creates a line break (
<br>) which avoids paragraph spacing.
Landscape Output
Landscape can be enabled via PDF options, and some implementations also support special PDF-writer tags (varies by environment).
Automatic PDF Conversion (.pdfwrite)
To auto-generate PDF output without clicking “Export as PDF,” place the following at the end of the source:
<script language="javascript"> parent.pdfwrite(); </script>
Common Troubleshooting
- Issue: Two variables run together (missing ending/starting
@)
Resolution: Place a non-breaking space between them (e.g., ). - Issue: List syntax shows code instead of rendered values
Resolution: Insert a comment tag before the first cell tag (implementation-specific).