DynaPDF Manual - Page 361

Previous Page 360   Index   Next Page 362

Function Reference
Page 361 of 860
ExchangePages
Syntax:
LBOOL pdfExchangePages(
const PPDF* IPDF, // Instance pointer
UI32 First,
// First page number
UI32 Second)
// Second page number
The function exchanges two pages. Page links, bookmarks, go-to actions, and named destinations
are changed so that the destination page still refers to the correct page. Note that page numbering
starts at 1. It is also possible to move a page to another position in the file (see MovePage() for
further information).
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
ExtractText
Syntax:
LBOOL pdfExtractText(
const PPDF* IPDF,
// Instance pointer
UI32 PageNum,
// Page number
TTextExtractionFlags Flags, // See below
struct TFltRect* Area,
// Optional -> Get the text of this area
UI16** Text,
// Out (required)
UI32* TextLen)
// Out (required)
typedef enum
{
tefDefault
= 0, // Create text lines in the original order.
tefSortTextX
= 1, // Sort text records in x-direction.
tefSortTextY
= 2, // Sort text records in y-direction.
tefSortTextXY
= tefSortTextX | tefSortTextY,
tefDeleteOverlappingText = 4
// See description
}TTextExtractionFlags;
The function extracts the text of the page PageNum. The first page is denoted by 1.
Text lines can be sorted in x- and y-direction. It is recommended to sort text in x-direction since this
is what Adobe's Acrobat does. Sorting text in y-direction can useful in certain special cases but
should be avoided by default.
Text that uses vertical writing mode is sorted by comparing the y-coordinate if the flag tefSortTextX
is set.
The flag tefDeleteOverlappingText causes that identical text records which are placed on the same
position (with a tolerance of 2 units) will be deleted. The records must occur one after the other in
order to detect them.
 

Previous topic: ExchangeBookmarks

Next topic: FileAttachAnnot