Changes

Attach a PDF to a Web Page View

36 bytes removed, 23 February
Additional Information
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>
 
 
To attach a PDF file to a defined page location within the [[Web Page View]]:
:<font size="3">'''&lt;!--@ssattach(insert;''pdf file location'';''page number'')-->'''</font>
 
 
To control the format settings of the PDF generated by the [[Web Page View]] use the following syntax:
:<font size="3">'''&lt;!--@ssattach(setting;''pdf file location'')-->'''</font>
 
'''Where:'''
* ''position'' is either '''before''', or '''after''' or '''insert'''.* ''page number'' is the page at which the file should be inserted into the PDF document.::'''Note:''' The ''page number'' is '''only''' specified when using ''insert'' as the position.
* ''pdf file location'' is:
:{|cellpadding="5" cellspacing="0" border="1"
* 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.
* The ''page number'' is only specified when using ''insert'' as the position.
* When using '''setting''' the PDF file will not be attached. The PDF file referenced should be a blank one-page PDF file which has the format settings you wish your PDF document to have. These are normally stored in a [[Smart Folder]].
==Examples==
* Append a PDF file from a [[Smart Folder]] '''before''' the current [[Web Page View Field]] page:
 
<pre>
<!--@ssattach(before;/files/1234/123/myfile.pdf )-->
* Append a PDF file from a [[Smart Folder]] '''after''' the current [[Web Page View Field]] page:
 
<pre>
<!--@ssattach(after;/files/1234/123/myfile.pdf )-->
* Insert all Attach PDF files stored in to a Level 1 [[Custom Field Type: Link – Multiple Files|Multiple Files Custom FieldWeb Page View]] called ''"AttachManyPDFFiles"'' at page 4 of from the current UTA Role [[Web Page View FieldCustom Fields]] pageon the contact section:.
<pre>[#(?object=contact;)<!--@ssattach(insertafter;@AttachManyPDFFiles$?opr_123456.files@;4value$)--> #]
</pre>
Where 123456 is the Custom Field ID
:* '''Note:''' Don't forget to include '''.files'''
* Attach PDF files to a Level 1 [[Web Page View]] from the organization [[Custom Fields]] associated as the Customer on the Level 1 record:
* Attach PDF files to a Level 1 [[Web Page View]] from the UTA Role [[Custom Fields]] on the contact section: [#(?object=contact;)&lt;!--@ssattach(after;$?opr_123456.value$)-->#]Where 123456 is the Custom Field ID  * To control the format settings of the PDF that is output by using the following syntax. The PDF file referenced should be a blank one-page PDF file which has the format settings you wish your PDF document to have. The [[Web Page View]] will be inserted onto this template:<pre><!--@ssattach(settingafter;/@client.UploadFieldName.files/1234/123/myfile.pdf@)-->
</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 the security restriction in place such as '''Content Copying''' or '''Content Copying or Extraction''' security restriction in place 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:
<prestyle="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 )-->
<html><body>
My Pdf file
</body></html>
 
</pre>
* [[sslogic]] can be used if the PDF file(s) to be attached needs to be varied using conditional statements:
<prestyle="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>
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>
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)<!--@ssattach(after;$Recent Audited Financial statements.value$)-->#]@</pre>
==See Also==
* [[Web Page View]]
* [[sslogic]]
* [[Display Additional File Attributes for PDF Documents]]
[[Category:Custom Fields]][[Category:PDF]]
Smartstaff, administrator
4,478
edits