LassoScript Utility
Basics Browse Detail

▼ [PDF_Doc->InsertPage]

Tag Link [PDF_Doc->InsertPage] Category PDF
Type Member Source Available Yes
Support Preferred Version 7.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LJAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

▼ Description

Inserts a page from a [PDF_Read] object into a [PDF_Doc] variable. Requires the name of a [PDF_Read] variable, followed by a comma and the number of the page to insert.

▼ Syntax

[$PDF_Doc->(InsertPage: PDF_Read Variable, Integer)]

▼ Parameters

Required Parameters
[PDF_Read] Variable The name of a [PDF_Read] object to insert.
Page Number The number of the page in the [PDF_Read] object to insert. Follows the [PDF_Read] variable parameter (comma-delimited).
Optional Parameters
-NewPage Keyword parameter specifying that the new page should be appended at the end of the document. Otherwise the page is drawn over the first page in the [PDF_Doc] variable by default. Requires a boolean value of 'true' to work (e.g. -NewPage='true').
-Top If the page being inserted is shorter than the current pages in the [PDF_Doc] variable, this parameter may be used to specifiy the offset of the new page from the top of the current page frame in points.
-Left If the page being inserted is not as wide the current pages in the [PDF_Doc] variable, this parameter may be used to specifiy the offset of the new page from the left of the current page frame in points.
-Width Scales the inserted page by width. Requires either a point width value, or a percentage string (e.g. 50%).
-Height Scales the inserted page by height. Requires either a point height value, or a percentage string (e.g. 50%).
-Rotate Specifies that the inserted PDF should be rotated. Positive degrees are counter-clockwise.

▼ Examples

To insert an existing page into a new PDF document:

Use the [PDF_Doc->InsertPage] tag with a defined [PDF_Read] variable. The example below makes the first page of the somepdf.pdf PDF the first page of the [PDF_Doc] variable.

[Var:'New_PDF'=(PDF_Doc: -File='MyFile.pdf', -Size='A4')]
[Var:'Old_PDF'=(PDF_Read:-File='/documents/somepdf.pdf')]
[$New_PDF->(InsertPage: $Old_PDF, 1)]

To insert an existing page at the end of a new PDF document:

Use the [PDF_Doc->InsertPage] tag with the optional -NewPage parameter. The example below adds the first page of the somepdf.pdf PDF after all existing pages in the [PDF_Doc] variable.

[Var:'New_PDF'=(PDF_Doc: -File='MyFile.pdf', -Size='A4')]
[Var:'Old_PDF'=(PDF_Read:-File='/documents/somepdf.pdf')]
[$New_PDF->(InsertPage: $Old_PDF, 1, -NewPage='true')]

To place an inserted page:

Use the [PDF_Doc->InsertPage] tag with the optional -Top and/or -Width parameters. The example below places the inserted page 50 points away from the top and left sides of the new document page frame.

[Var:'New_PDF'=(PDF_Doc: -File='MyFile.pdf', -Size='A4')]
[Var:'Old_PDF'=(PDF_Read:-File='/documents/somepdf.pdf')]
[$New_PDF->(InsertPage: $Old_PDF, 1, -Width=50, -Height=50)]

To scale an inserted page:

Use the [PDF_Doc->InsertPage] tag with the optional -Height or -Width parameter. The example below proportionally reduces the size of the inserted page by 50% using the -Width and -Proportional parameters.

[Var:'New_PDF'=(PDF_Doc: -File='MyFile.pdf', -Size='A4')]
[Var:'Old_PDF'=(PDF_Read:-File='/documents/somepdf.pdf')]
[$New_PDF->(InsertPage: $Old_PDF, 1, -Width='50%', -Proportional)]

▼ Related Tags

▼ Category Tags

Substitution
[PDF_Barcode]
[PDF_Color]
[PDF_Font]
[PDF_Image]
[PDF_List]
[PDF_Read]
[PDF_Table]
[PDF_Text]
Process
[PDF_Serve]
Member
[PDF_Barcode->GenerateChecksum]
[PDF_Barcode->GetBarHeight]
[PDF_Barcode->GetBarMultiplier]
[PDF_Barcode->GetBarWidth]
[PDF_Barcode->GetBaseline]
[PDF_Barcode->GetCode]
[PDF_Barcode->GetFont]
[PDF_Barcode->GetSize]
[PDF_Barcode->GetTextAlignment]
[PDF_Barcode->GetTextSize]
[PDF_Barcode->GetType]
[PDF_Barcode->SetBarHeight]
[PDF_Barcode->SetBarMultiplier]
[PDF_Barcode->SetBarWidth]
[PDF_Barcode->SetBaseline]
[PDF_Barcode->SetCode]
[PDF_Barcode->SetFont]
[PDF_Barcode->SetGenerateChecksum]
[PDF_Barcode->SetShowChecksum]
[PDF_Barcode->SetTextAlignment]
[PDF_Barcode->SetTextSize]
[PDF_Barcode->ShowChecksum]
[PDF_Barcode->ShowCode39StartStop]
[PDF_Barcode->ShowEANGuardBars]
[PDF_Font->GetColor]
[PDF_Font->GetEncoding]
[PDF_Font->GetFace]
[PDF_Font->GetFullFontName]
[PDF_Font->GetPSFontName]
[PDF_Font->GetSize]
[PDF_Font->GetSupportedEncodings]
[PDF_Font->IsTrueType]
[PDF_Font->SetColor]
[PDF_Font->SetEncoding]
[PDF_Font->SetFace]
[PDF_Font->SetSize]
[PDF_Font->SetUnderline]
[PDF_Font->TextWidth]
[PDF_List->Add]
[PDF_Read->AddJavaScript]
[PDF_Read->ExportFDF]
[PDF_Read->FieldNames]
[PDF_Read->FieldType]
[PDF_Read->FieldValue]
[PDF_Read->GetHeaders]
[PDF_Read->ImportFDF]
[PDF_Read->JavaScript]
[PDF_Read->PageCount]
[PDF_Read->PageSize]
[PDF_Read->Save]
[PDF_Read->SetFieldValue]
[PDF_Read->SetPageRange]
[PDF_Table->Add]
[PDF_Table->GetAbsWidth]
[PDF_Table->GetAlignment]
[PDF_Table->GetBorderColor]
[PDF_Table->GetBorderWidth]
[PDF_Table->GetColumnCount]
[PDF_Table->GetPadding]
[PDF_Table->GetRowCount]
[PDF_Table->GetSpacing]
[PDF_Table->Insert]
[PDF_Table->Remove]
[PDF_Table->SetAlignment]
[PDF_Table->SetBorderColor]
[PDF_Table->SetBorderWidth]
[PDF_Table->SetPadding]
[PDF_Table->SetSpacing]
[PDF_Text->Add]