Name
pdf.GetBrushFromPage -- get PDF page as vector brush (V1.1)
Synopsis
[id] = pdf.GetBrushFromPage(id, page, brid[, transparent])
Function
This function can be used to convert a page from the PDF document specified by id to a vector brush using the identifier brid. If you pass Nil in brid, pdf.GetBrush() will automatically choose a vacant identifier and return it.

The page to convert must be specified in the page argument. It must be a number in the range of 1 to the total number of pages in the document and the page must have been previously loaded using pdf.LoadPage(). The PDF document specified by id must have been previously opened using pdf.OpenDocument().

The optional parameter transparent allows you to specify whether you'd like the page background to be transparent or white. If you pass True here, you'll get a vector brush in which the page background is completely transparent by using alpha channel transparency. Otherwise the page background will be white and your vector brush won't use any transparency.

Note that the vector brush will still depend on the PDF document so it is not allowed to call pdf.CloseDocument() on the document before freeing the brush. It also is not allowed to call pdf.FreePage() before freeing the brush.

If you want to convert a PDF page into a brush without being forced to load the page using pdf.LoadPage() first, use the pdf.GetBrush() function. See pdf.GetBrush for details.

Inputs
id
identifier of the PDF document to use
page
page number to convert (starting from 1)
brid
identifier for the vector brush or Nil for auto id selection
transparent
optional: True for a transparent page background, False for a white page background
Results
id
optional: identifier of the brush; will only be returned when you pass Nil as argument 3 (see above)

Show TOC