Tag Link | [PDF_Serve] | Category | |
---|---|---|---|
Type | Process | Source Available | Yes |
Support | Preferred | Version | 6.0 |
Change | Unchanged | Data Source | Any |
Output Type | None | Security | File |
Implementation | LDML | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0 |
The [PDF_Serve] tag serves a PDF file which is stored in a variable in place of the current Lasso format file. The name of the PDF file can be specified and, in supported browsers, the PDF file will be written to disk using that name and/or automatically opened in the visitor's PDF reader.
None of the contents of the current format file will be served. [PDF_Serve] completely rewrites the HTTP headers and contents of the served response. [PDF_Serve] also performs an [Abort] so no tags after [PDF_Serve] will be executed.
The first parameter to the tag should be a variable which contains the PDF file to be served. An optional
[PDF_Serve: 'PDF Data']
[PDF_Serve: 'PDF Data',
[Variable: 'myPDF' = (PDF_Doc: ...)]
...
[PDF_Serve: $myPDF,
[PDF_Serve: (File_Read: 'Example.PDF'),
Required Parameters | |
---|---|
'File Data' | The first parameter to the tag should be the PDF file data that will be served. |
Optional Parameters | |
-File | The |
-Type | The |
-Disposition | The disposition can be set to 'Inline' to force most browsers to display the served file in the browser rather than saving it to disk. |
To serve a PDF file without writing To file:
PDF files may be served to the client browser without ever writing them to file on the local server. This is done using the [PDF_Doc] tag without the
<?LassoScript
Var:'MyFile'=(PDF_Doc:
Var:'Text'=(PDF_Text: 'Hello World');
$MyFile->(Add: $Text);
$MyFile->Close;
PDF_Serve: $MyFile,
?>