Lasso Soft Inc. > Home

[PDF_Doc]

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.

  • Syntax
  • Parameters
[Var_Set:'MyFile'=(PDF_Doc: -File='MyFile.pdf',  
-Size='A4', 
-Color='#000000',  
-UseDate, 
-NoCompress, 
-PageNo=1, 
'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 parameter instead of the -Size parameter.
-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 -Height parameter instead of the -Size parameter.
-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-bit encryption is used rather than 40-bit encryption. Note, encryption will only be performed if either -UserPassword or -OwnerPassword is specified.
-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 -EncryptStrong is used including FillIn, Assemble, ScreenReader, and DegradedPrint.
Examples

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:
-File='MyFile.pdf',                                                                         
-Size='A4',                                     
-Margins=(Array: 144, 144, 72, 72))]
[Var: 'MyFont'=(PDF_Font: -Face='Helvetica', -Color='#00FF00', -Size=24)]
[Var:'Text'=(PDF_Text:'Hello, World\nI am a PDF document', -Font=$MyFont)]
[$MyFile->(Add: $Text)]
[$MyFile->(Close)]
Tag Link [PDF_Doc] Category PDF
Type Substitution Data Source Any
Support Preferred Version 6.0
Output Type PDF File Security File
Implementation LJAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft