Lasso Soft Inc. > Home

[PDF_Doc->InsertPage]

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
  • Parameters
[$PDF_Doc->(InsertPage: PDF_Read Variable, Integer)]
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%).
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)]
Tag Link [PDF_Doc->InsertPage] Category PDF
Type Member Data Source Any
Support Preferred Version 7.0
Output Type None Security None
Implementation Sets Lasso 7.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