DynaPDF Manual - Page 509

Previous Page 508   Index   Next Page 510

Function Reference
Page 509 of 839
GetUsesTransparency
Syntax:
SI32 pdfGetUsesTransparency(
const PPDF* IPDF, // Instance pointer
SI32 PageNum)
// Page number or -1 to check all pages
The function checks whether a page or the entire document uses transparency. This is no quick
check as GetDocUsesTransparency() applies. The function parses the page or pages to determine
whether transparent objects are really used.
To check whether a specific page uses transparency set the parameter PageNum to the wished page
number. The first page is denoted by 1. To check the entire PDF file set PageNum to -1.
Return values:
The return value is a bit mask on success (a positive integer value), or a negative error code on
failure.
The following flags are defined:
0: The page or document uses no transparency.
1: The content stream of a page contains transparent objects.
2: A page defines the blending color space (Group dictionary).
4: A page contains transparent annotations or form fields.
The above values can occur in any combination. To check whether a specific flag was set use a
binary and operator:
Example C++:
SI32 retval = pdfGetUsesTransparency(pdf, 1);
if (retval < 0)
// an error occurred
else if (retval == 0)
// no transparency used
else
{
if (retval & 1)
{
// The page or document uses transparency
}
if (retval & 2)
{
// At least one page defines the blending color space. If bit 1 is absent then no transparency
// is used in the content stream of a page.
}
if (retval & 4)
{
// A page contains transparent annotations or form fields.
}
}
 

Previous topic: GetUseStdFonts, GetUseSystemFonts

Next topic: GetUseTransparency, GetUseVisibleCoords, GetViewerPreferences