Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 712

Previous Page 711   Index   Next Page 713

Function Reference
Page 712 of 750
Only if the file was opened with the owner password, all rights should be granted. See PDF Reference
1.5 for further information. This document is available at www.adobe.com.
The property UseExactPwd should be true, if the application is a commercial product.
LBOOL pdfSetUseGlobalImpFiles(
const PPDF* IPDF, // Instance pointer
LBOOL Value)
// True or false
The property can be used to load one or more external PDF files permanent into memory, e.g. to split
a large PDF file into smaller pieces. The next PDF file that will be opened with the function
OpenImportFile() or OpenImportBuffer() will not be closed when CloseFile() or FreePDF() is called.
When creating a new PDF file the previously opened import file is still open and it is possible to
import pages from this file without loading the file again.
If more than one file should be loaded permanent into memory then set also the flag if2UseProxy
with SetImportFlags2(). PDF files which are no longer needed can be closed with CloseImportFile()
or CloseImportFileEx().
Return values:
This function cannot fail, the return value is always 1.
Example (Delphi):
In this example we have a large PDF file that should be splitted into separate files which should
contain one page each.
If we would not use the property UseGlobalImpFiles we must read the entire file structure each time a
page was extracted because the import file would be closed when CloseFile() is called. Splitting a
large file in this way would be extremely slow. To improve processing speed we set the property
UseGlobalImpFiles to true so that we must open the import file only one time.
// This is our error callback function
function ErrProc(const Data: Pointer; ErrCode: Integer; const ErrMessage:
PChar; ErrType: Integer): Integer; stdcall;
var s: String;
s := ErrMessage + #13#13'Abort processing?';
if MessageDlg(s, mtError, [mbYes, mbNo], 0) = mrYes then
Result := 1
Result := 0;
procedure TForm1.Button2Click(Sender: TObject);
var pdf: TPDF; i: Integer;

Previous topic: SetUseExactPwd

Next topic: SetUserUnit