Tag Link | [PDF_Doc] | Category | |
---|---|---|---|
Type | Substitution | Source Available | Yes |
Support | Preferred | Version | 6.0 |
Change | Unchanged | Data Source | Any |
Output Type | PDF File | Security | File |
Implementation | LJAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0 |
Initializes and creates a PDF document. Uses optional parameters to set the basic specifications of the file to be created. Data is added to the variable using [PDF_Doc] member tags, most notably the [PDF_Doc->Add] tag.
[Var_Set:'MyFile'=(PDF_Doc:
'Author'='John Doe',
'Title'='My PDF File')]
Optional Parameters | |
---|---|
-File | Path to the new PDF file. If omitted, the PDF document is created in the memory. |
-Format | Specifies the format in which the file will be output. This can be PDF or RTF. This parameter is optional, and defaults to PDF if not used. |
-Size | Define the page size of the document. Values for this parameter are standard print sizes, and can be A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, B0, B1, B2, B3, B4, B5, ARCH_A,ARCH_B,ARCH_C,ARCH_D,ARCH_E, FLSA,FLSE,HALFLETTER,LEDGER,LEGAL,LETTER,NOTE,and TABLOID. Defaults to A4. |
-Height | Defines a custom page height for the document. Accepts an integer value which represents the size in points. This can be used with the |
-Width | Defines a custom page width for the document. Requires an integer value which represents the size in points. This can be used with the |
-Margins | Defines the margin size for the page. Requires an array of four decimal values, which define the left, right, top, and bottom margins for the page (Left, Right, Top, Bottom). |
-Color | Defines the initial text color of the page. Requires a [PDF_Color] object or a color hex string (#990000). |
-UseDate | Adds the current date and time to the file header. |
-NoCompress | Produces a PDF without compression to allow PDF code to be viewed. |
-PageNo | Sets the starting page number for the PDF document. Requires an integer value, which is the page number of the first page. |
'Header'='Content' | Adds defined file headers to the PDF document. Header is replaced with the name of the file header (e.g. Title, Author), and 'Content' is replaced with the header value. |
-PageHeader | Adds the specified text to the top of each page in the PDF file. |
-UserPassword | Specifies a password which will be required to open the resulting PDF in a reader appliccation including Adobe Reader, Preview, etc. The file will be encrypted if this parameter is specified. |
-OwnerPassword | Specifies a password which will be required to open the resulting PDF in an editor including Acrobat Pro, Lasso's [PDF_Read] tag, etc. The file will be encrypted if this parameter is specified. |
-EncryptStrong | If specified then strong 128 |
-Permissions | A comma delimited list of permissions for the PDF file. Values include Print, Modify, Copy, or Annotate. Four additional options are available only if |
The
To create a basic PDF file:
PDF files are created by setting a variable as a [PDF_Doc] type, and using various member tags and other [PDF_...] tags to add data to the variable. The PDF is then written to file when the format file containing all code is served by the Web server
[Var:'MyFile'=(PDF_Doc:
[Var: 'MyFont'=(PDF_Font:
[Var:'Text'=(PDF_Text:'Hello, World\nI am a PDF document',
[$MyFile->(Add: $Text)]
[$MyFile->(Close)]