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.

  • Syntax
  • Parameters
[Var_Set:'MyFile'=(PDF_Doc: -File='MyFile.pdf', 
-Format='PDF',  
-Size='A4', 
-Color='#000000', 
-Margins=(1.0, 1.0, 3.0, 3.0), 
-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 a decimal value which represents the size in inches. This can be used with the -Width parameter instead of the -Size parameter.
-Width Defines a custom page width for the document.Requires a decimal value which represents the size in inches. 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 background color of the page. Requires a regular color hex string (#FFCCDD).
-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.
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',                                      
-Format='PDF',                                     
-Size='A4',                                     
-Margin=(Array: 144.0, 144.0, 72.0, 72.0))]
[Var: 'MyFont'=(PDF_Font: -Face='Helvetica',                                        -Color='#00FF00',                                        
-Size=24)]
[$MyFile->(AddText:'Hello, World\n', -Font=$MyFont)]
[$MyFile->(AddText:'I am a PDF document', -Font$MyFont)]
[$MyFile->(Close)]
Result:
PDF file named MyFile.pdf in the same folder as the [PDF_Doc] format file (Windows), or a PDF file named MyFile.pdf in the root file permission folder of the current user (Mac OS X).
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 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