SetPrecision
Measurement and coordinate units
Description
Use this function to set the precision of numerical values stored in the PDF document. Setting the precision to a lower number will reduce the size of the generated file, while a higher precision will result in a larger file, although objects and graphics will be more accurately positioned. The default precision is 4
Syntax
Delphi
Function TPDFlib.SetPrecision(NewPrecision: Integer): Integer;
ActiveX
Function PDFlib::SetPrecision(NewPrecision As Long) As Long
DLL
int DLSetPrecision(int InstanceID, int NewPrecision);
Parameters
| NewPrecision | The precision to use for subsequent drawing operations. A value from 2 to 8 |
|---|
This setting controls newly created or explicitly edited numeric objects; decimal values loaded from a PDF retain their input precision until modified, preserving calibrated color parameters during an ordinary save; page edits that rewrite a content layer, such as ScalePage or TransformPageElement, keep the text of every operand they do not change and write the operands they create with four decimal places, while NormalizeContentStreams and the save-time content optimizer canonicalize every numeric operand to four decimal places regardless of this setting
Return values
| 0 | The precision specified was out of range |
|---|---|
| 1 | The precision was set successfully |