inherits from Exception
The composer's own failure class. It descends from Exception directly, like ePdfError in StreamSec.Pdf.Model and ePdfSignError in StreamSec.Pdf.Signer: this unit is the DEEPEST of the three - stDERUtils and nothing else - so it cannot reach either of theirs without acquiring the dependency the unit exists to avoid. Nothing here raises a bare Exception.
(no public members)
constructor Create; overload;
constructor Create(aWidth, aHeight: Double); overload;
destructor Destroy; override;
procedure SetPageSize(aWidth, aHeight: Double);
procedure NewPage;
property Unrenderable: tPdfUnrenderable read fUnrenderable write fUnrenderable;
property Substitutions: Integer read fSubstitutions;
function CanRender(const aText: string; out aBadAt: Integer; out aCodePoint: Cardinal): Boolean;
procedure TextOut(aX, aY: Double; aFont: tPdfFont; aSize: Double; const aText: string; aAlign: tPdfAlign = paLeft; aLetterSpace: Double = 0);
function TextWidth(aFont: tPdfFont; aSize: Double; const aText: string; aLetterSpace: Double = 0): Double;
function FitText(aFont: tPdfFont; aSize: Double; const aText: string; aMaxWidth: Double; out aRest: string): string;
procedure HLine(aX1, aX2, aY: Double; aThickness: Double = 0.75);
function SaveToOS: OctetString;
procedure SaveToFile(const aFileName: string);
property PageWidth: Double read fWidth;
property PageHeight: Double read fHeight;
WHAT TO DO WITH A CHARACTER WinAnsiEncoding CANNOT CARRY.
puRefuse is the default and the right answer for a document that will be signed, filed and read back in seven years: a '?' standing where a customer's name should be is a defect, and one that no longer announces itself once the file is closed.
puSubstitute exists because that is not every caller's trade-off. A webshop generating an invoice automatically the moment a payment is captured cannot stop and ask a human, and for it a document with a mangled name beats no document at all - the invoice still has to exist. The choice is therefore PER INSTANCE and not per unit, because both callers are right about their own case. SUBSTITUTION IS NEVER SILENT. The original objection to '?' was not the character, it was that nothing recorded the loss. So a canvas in
puSubstitute counts every substituted character in Substitutions, and a caller that opts in is expected to look at it - log it, flag the document, or warn the operator. A count nobody reads is the defect the strict mode exists to prevent, merely relocated.