ExtractFilePageContentToStringA

Extraction, Page properties

Description

Koncové A označuje vstupní bod ANSI (char) knihovny DLL; rozhraní ActiveX/COM zpřístupňuje pouze formu Unicode. Chování je shodné s ExtractFilePageContentToString a řetězcové argumenty jsou interpretovány pomocí aktuální znakové stránky nastavené funkcí SetAnsiMode

Extracts the raw content stream of a specified page from an external PDF file and returns it as a string. This function uses the direct access backend, avoiding loading the entire document into memory, which is ideal for large files.

Syntax

Delphi

Function DLExtractFilePageContentToStringA(InstanceID: Integer; InputFileName, Password: PAnsiChar; Page: Integer): PAnsiChar;

DLL

const char * DLExtractFilePageContentToStringA(int InstanceID, const char * InputFileName, const char * Password, int Page);

Parameters

InputFileNameThe path to the source PDF file.
PasswordThe password to open the file. Pass an empty string if the file is not protected.
PageThe page number to extract (1-based).

Return values

Empty stringFailed to open file, invalid page, or extraction error.
Content stringThe raw PDF content stream of the page.

Remarks

The returned string contains raw PDF page description instructions (such as drawing, text positioning operators). To extract human-readable text instead, use ExtractFilePageText.

Example

var Content: AnsiString;
Content := PDF.ExtractFilePageContentToString('sample.pdf', '', 1);
if Content <> '' then
  // Process the content instructions...

See also

ExtractFilePageText, ExtractFilePageTextBlocks