Difference between revisions of "Attach a PDF to a Web Page View"

From SmartWiki
Jump to: navigation, search
(Additional Information)
 
(39 intermediate revisions by 5 users not shown)
Line 1: Line 1:
You can use the '''ssattach''' function to append one or more PDF documents stored in either a [[Custom Field]] or [[Smart Folder]] to a [[Web Page View Field]].  
+
You can use the '''ssattach''' function to append one or more PDF documents stored in either a [[Custom Field Type: Link – Single File|Single File Field]] or [[Smart Folder]] to a [[Web Page View Field]].  
  
The attached PDF file(s) will not not visible when viewing the web page in HTML mode, but will be appended when exported as a PDF, saved as a PDF, emailed as PDF or created by a [[Workflow]] as attachment.
 
  
 +
'''Note:''' The attached PDF file(s) will '''not''' be visible when viewing the web page in HTML mode, but will be appended when exported as a PDF, saved as a PDF, emailed as PDF or created by a [[Workflow]] as attachment.
  
'''Sample Codes'''
+
==Syntax==
 +
To attach a PDF file to the beginning or the end of the [[Web Page View]]:
 +
:<font size="3">'''&lt;!--@ssattach(''position'';''pdf file location'')-->'''</font>
 +
 
 +
'''Where:'''
 +
* ''position'' is either '''before''' or '''after'''.
 +
* ''pdf file location'' is:
 +
:{|cellpadding="5" cellspacing="0" border="1"
 +
| '''File Source'''
 +
| '''Syntax'''
 +
|'''Comments'''
 +
|-
 +
| [[Smart Folder]]
 +
| /files/''folder1''/''folder2''/''File_Name''.pdf
 +
| To obtain select '''View URL''' from the '''File Options''' combo box next to the relevant file in the [[Smart Folder]]. <br>
 +
The first part of the URL should be omitted: the location specified should begin with "/files/..." as in the examples below.
 +
|-
 +
| [[Single File]] Custom Field
 +
| @''Custom Field Name''.value@
 +
|
 +
|-
 +
| [[Multiple Files]] Custom Field
 +
| @''Custom Field Name''.files@
 +
| All PDF files stored in field will be attached.
 +
|}
 +
 
 +
 
 +
'''Notes:'''
 +
* Single or Multiple file fields on parent/grandparent levels can also be included using:
 +
::* @parent.''Custom Field Name''.value@, @parent.parent.''Custom Field Name''.files@, etc.
 +
 
 +
==Examples==
 
* Append a PDF file from a [[Smart Folder]] '''before''' the current [[Web Page View Field]] page:
 
* Append a PDF file from a [[Smart Folder]] '''before''' the current [[Web Page View Field]] page:
 +
 
<pre>
 
<pre>
 
<!--@ssattach(before;/files/1234/123/myfile.pdf )-->
 
<!--@ssattach(before;/files/1234/123/myfile.pdf )-->
Line 12: Line 44:
  
 
* Append a PDF file from a [[Smart Folder]] '''after''' the current [[Web Page View Field]] page:
 
* Append a PDF file from a [[Smart Folder]] '''after''' the current [[Web Page View Field]] page:
 +
 
<pre>
 
<pre>
 
<!--@ssattach(after;/files/1234/123/myfile.pdf )-->
 
<!--@ssattach(after;/files/1234/123/myfile.pdf )-->
Line 17: Line 50:
  
  
* Append a PDF file from a [[Custom Field|custom field]] (single file type) '''before''' the current [[Web Page View Field]] page:.
+
* Append a PDF file from a [[Custom Field Type: Link – Single File|Single File Custom Field]] called ''"AttachPDFFile"'' <u>before</u> the current [[Web Page View Field]] page:.
  
 
<pre>
 
<pre>
<!--@ssattach(before;@attach pdf file@)-->  
+
<!--@ssattach(before;@AttachPDFFile.value@)-->  
 
</pre>
 
</pre>
::::or
+
 
<pre>
+
:* '''Note:''' Don't forget to include '''.value'''
<!--@ssattach(before;@#xxxxxxx#@)--> where xxxx is customfield id.
+
 
 +
 
 +
* Attach PDF files to a Level 1 [[Web Page View]] from the UTA Role [[Custom Fields]] on the contact section:
 +
 
 +
<pre> [#(?object=contact;)<!--@ssattach(after;$?opr_123456.value$)-->#]
 
</pre>
 
</pre>
 +
Where 123456 is the Custom Field ID
  
'''Rules'''
 
  
* The '''ssattach''' function can be placed anywhere inside the [[Web Page View Field]]
+
* Attach PDF files to a Level 1 [[Web Page View]] from the organization [[Custom Fields]] associated as the Customer on the Level 1 record:
* Multiple files can be attached from different sources:
+
 
<pre>
+
<pre> <!--@ssattach(after;@client.UploadFieldName.files@)-->
 +
</pre>
 +
Where UploadFieldName is the field name of the multi-file upload custom field on the organization record
 +
 
 +
==Additional Information==
 +
* '''IMPORTANT''' Any [[PDF]] files that have security restriction in place such as '''Content Copying''' or '''Content Copying or Extraction''' have been encrypted and '''cannot''' be included.
 +
::The settings can be viewed by opening the [[PDF]] and clicking File > Document Properties > Security (steps may vary depending on the version of your PDF reader)
 +
::See also: [[Display Additional File Attributes for PDF Documents]]
  
<!--@ssattach(before;/files/1234/123/myfileheader.pdf )-->
+
* The '''ssattach''' function can be placed anywhere inside the HTML tags within the [[Web Page View Field]]
<!--@ssattach(after;/files/1234/123/myfilefooter.pdf )-->
+
* All PDF page settings will driven by the first PDF document file, whether it is a static file or one generated by [[SmartSimple]]
 +
* Multiple PDF files can be attached from different sources by using multiple ssattach statements:
 +
<pre style="white-space: pre-wrap;  white-space: -moz-pre-wrap;  white-space: -pre-wrap;  white-space: -o-pre-wrap;  word-wrap: break-word;"><!--@ssattach(before;/files/1234/123/myfileheader.pdf )--><!--@ssattach(after;/files/1234/123/myfilefooter.pdf )-->
 
<!--@ssattach(after;/files/1234/123/myfileappendix.pdf )-->
 
<!--@ssattach(after;/files/1234/123/myfileappendix.pdf )-->
 
<html><body>
 
<html><body>
 
   My Pdf file
 
   My Pdf file
 
</body></html>
 
</body></html>
 +
</pre>
  
 +
* [[sslogic]] can be used if the PDF file(s) to be attached needs to be varied using conditional statements:
 +
<pre style="white-space: pre-wrap;  white-space: -moz-pre-wrap;  white-space: -pre-wrap;  white-space: -o-pre-wrap;  word-wrap: break-word;"><!--@sslogic('@type@'='contact')-->
 +
      <!--@ssattach(after;@parent.contract.value@)-->
 +
<!--@else-->
 +
    <!--@ssattach(after;@parent.othercontract.value@)-->
 +
<!--@end-->
 
</pre>
 
</pre>
  
* All page settings will driven by first PDF document file, either it is a static file or generated by [[SmartSimple]]
+
Attaching a file from a transaction to a {{l1}} {{WPV}}, use:
  
 +
<pre style="white-space: pre-wrap;  white-space: -moz-pre-wrap;  white-space: -pre-wrap;  white-space: -o-pre-wrap;  word-wrap: break-word;">@client.[#(?object=transaction::criteria=typename="Transaction Name" and statusname="Submitted"::orderby=trsts desc)
 +
<!--@ssattach(after;$fieldname.value$)-->#]@
 +
</pre>
  
'''SSlogic'''
+
Example:  
 
+
<pre style="white-space: pre-wrap;  white-space: -moz-pre-wrap;  white-space: -pre-wrap;  white-space: -o-pre-wrap;  word-wrap: break-word;">@client.[#(?object=transaction::criteria=typename="Audited Financial Statements" and statusname="Submitted"::orderby=trsts desc)
* Using @customfield@ instead of [[Smart Folder|smart folder]] file (like @parent.contract@)
+
<!--@ssattach(after;$Recent Audited Financial statements.value$)-->#]@</pre>
* Use if sslogic like this:
 
 
 
<pre>
 
<!- -@sslogic(‘@type@’=’contact’) - ->
 
      <!- -@ssattach(after;/files/1234/123/myfilefooter.pdf )- ->
 
  
<!--@else-->
+
==See Also==
    <!- - @ssattach(after;/files/1234/123/myotherfilefooter.pdf )- ->
+
* [[Web Page View]]
<!--@end-->
+
* [[sslogic]]
 +
* [[Display Additional File Attributes for PDF Documents]]
  
</pre>
 
  
[[Category:Custom Fields]]
+
[[Category:Custom Fields]][[Category:PDF]]

Latest revision as of 14:49, 23 February 2024

You can use the ssattach function to append one or more PDF documents stored in either a Single File Field or Smart Folder to a Web Page View Field.


Note: The attached PDF file(s) will not be visible when viewing the web page in HTML mode, but will be appended when exported as a PDF, saved as a PDF, emailed as PDF or created by a Workflow as attachment.

Syntax

To attach a PDF file to the beginning or the end of the Web Page View:

<!--@ssattach(position;pdf file location)-->

Where:

  • position is either before or after.
  • pdf file location is:
File Source Syntax Comments
Smart Folder /files/folder1/folder2/File_Name.pdf To obtain select View URL from the File Options combo box next to the relevant file in the Smart Folder.

The first part of the URL should be omitted: the location specified should begin with "/files/..." as in the examples below.

Single File Custom Field @Custom Field Name.value@
Multiple Files Custom Field @Custom Field Name.files@ All PDF files stored in field will be attached.


Notes:

  • Single or Multiple file fields on parent/grandparent levels can also be included using:
  • @parent.Custom Field Name.value@, @parent.parent.Custom Field Name.files@, etc.

Examples

<!--@ssattach(before;/files/1234/123/myfile.pdf )-->


<!--@ssattach(after;/files/1234/123/myfile.pdf )-->


<!--@ssattach(before;@AttachPDFFile.value@)--> 
  • Note: Don't forget to include .value


 [#(?object=contact;)<!--@ssattach(after;$?opr_123456.value$)-->#]

Where 123456 is the Custom Field ID


  • Attach PDF files to a Level 1 Web Page View from the organization Custom Fields associated as the Customer on the Level 1 record:
 <!--@ssattach(after;@client.UploadFieldName.files@)-->

Where UploadFieldName is the field name of the multi-file upload custom field on the organization record

Additional Information

  • IMPORTANT Any PDF files that have security restriction in place such as Content Copying or Content Copying or Extraction have been encrypted and cannot be included.
The settings can be viewed by opening the PDF and clicking File > Document Properties > Security (steps may vary depending on the version of your PDF reader)
See also: Display Additional File Attributes for PDF Documents
  • The ssattach function can be placed anywhere inside the HTML tags within the Web Page View Field
  • All PDF page settings will driven by the first PDF document file, whether it is a static file or one generated by SmartSimple
  • Multiple PDF files can be attached from different sources by using multiple ssattach statements:
<!--@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 file
</body></html>
  • sslogic can be used if the PDF file(s) to be attached needs to be varied using conditional statements:
<!--@sslogic('@type@'='contact')-->
       <!--@ssattach(after;@parent.contract.value@)-->
<!--@else-->
     <!--@ssattach(after;@parent.othercontract.value@)-->
<!--@end-->

Attaching a file from a transaction to a Level 1 Web Page View, use:

@client.[#(?object=transaction::criteria=typename="Transaction Name" and statusname="Submitted"::orderby=trsts desc)
<!--@ssattach(after;$fieldname.value$)-->#]@

Example:

@client.[#(?object=transaction::criteria=typename="Audited Financial Statements" and statusname="Submitted"::orderby=trsts desc)
<!--@ssattach(after;$Recent Audited Financial statements.value$)-->#]@

See Also