[id, t] = pdf.GetBrush(id, page, brid[, transparent, getlinks])
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. The PDF document specified
by id
must have been 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 while you still need the brush.
Also note that you should only use this function for pages that haven't been loaded with pdf.LoadPage() before. If you want to convert a page that has been loaded using pdf.LoadPage() to a brush, use the pdf.GetBrushFromPage() function instead. See pdf.GetBrushFromPage for details.
Starting with Polybios 1.1, there is an optional argument called getlinks
. If this
is set to True
, pdf.GetBrush()
will return a table containing all links
in the page. The table is returned as the second return value if getlinks
is set
to True
. For each entry, the table will have the following fields initialized:
Action:
#PDFACTION_GOTO:
#PDFACTION_REMOTEGOTO:
#PDFACTION_URI:
#PDFACTION_LAUNCH:
#PDFACTION_UNSUPPORTED:
Target:
Action
, this may be set to
a page number, a URI, or the path to an external file.
Left:
Top:
Right:
Bottom:
Nil
for auto id selectionTrue
for a transparent page background, False
for a white page backgroundTrue
if page links should be returned (see above) (defaults to False
) (V1.1)Nil
as argument 3 (see above)