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

DynaPDF Manual - Page 713

Previous Page 712   Index   Next Page 714

Function Reference
Page 713 of 750
pdf := nil;
try
pdf := TPDF.Create;
pdf.SetOnErrorProc(nil, @ErrProc);
pdf.SetUseGlobalImpFiles(true);
// No conversion to templates is required. In addition, we need the
// page contents only.
pdf.SetImportFlags(ifImportAsPage);
pdf.OpenImportFileA('c:/test.pdf', ptOpen, '');
// In the following loop we create a new PDF file, import one page
// and close the new file. We continue until all pages are stored
// in a new PDF file each.
// We store the files in the directory c:/SplitOut. Note that the
// size of all single page files is many times larger as the size
// of the original import file because used fonts and other
// resources must be exported to each file, they cannot be shared.
for i := 1 to pdf.GetInPageCount do begin
pdf.CreateNewPDFA(Format('c:/SplitOut/split%.4d.pdf', [i]));
pdf.Append;
pdf.ImportPageEx(i, 1.0, 1.0); // Import a page
pdf.EndPage;
pdf.CloseFile;
end;
except
on E: Exception do MessageDlg(E.Message, mtError, [mbOK], 0);
end;
if pdf <> nil then pdf.Free;
end;
SetUserUnit
Syntax:
LBOOL pdfSetUserUnit(
const PPDF* IPDF, // Instance pointer
float Value)
// Must be in the range 0.01..75.0
The function sets the user unit of the current open page. A user unit is a scaling factor. The page
format and all page coordinates are multiplied with this factor in a viewer application. The default
size of a PDF unit is 1/72 inch. User units can be useful if the page format would be too large to be
expressed in standard PDF units. The largest page format in PDF is limited to 14,400 units or 200
inches. This limit can be extended with the user unit.
The largest value that is supported is 75.0 which results in a maximum page format of 15,000 x 15,000
inches or 1,800,000 units. Note that all functions which return page coordinates or page properties do
not consider the user unit.
The page format must still be in the range 3..14400 units. It is also strongly recommended to set the
user unit only if necessary. This is only the case if the required page format is larger 14400 units.
Default value = 1.0
 

Previous topic: SetUseGlobalImpFiles

Next topic: SetUseSwapFile (obsolete)