CompressFonts
Fonts, Document properties
Popis
Nastaví výchozí příznak komprese aplikovaný na fontové programy TrueType, OpenType, Packaged a Type 1 přidané do dokumentu po tomto volání. Když je zapnuté, fontový proud se zabalí filtrem /FlateDecode; když je vypnuté, ukládá se fontový proud nekomprimovaný
Syntaxe
Delphi
Function TPDFlib.CompressFonts(Compress: Integer): Integer;
ActiveX
Function PDFlib::CompressFonts(Compress As Long) As Long
DLL
int DLCompressFonts(int InstanceID, int Compress);
Parametry
| Compress | 0 — do not compress font streams. 1 — compress font streams with Flate. |
|---|
Return values
| 0 | Parametr Compress byl mimo rozsah |
|---|---|
| 1 | Nastavení komprese fontů se aktualizovalo |
Poznámky
This setting only affects fonts added after the call — fonts already embedded in the document keep their original encoding. The default is to compress (matching PDF reader expectations and the smallest output). Disable compression only when debugging a font extraction issue or when integrating with a downstream pipeline that rejects flate-encoded font streams.
Subsetování fontů (AddTrueTypeSubsettedFont) a komprese fontů jsou nezávislé: subsetování sníží počet zahrnutých glyfů; komprese zmenší jakákoli zahrnutá glyfová data
Příklad
// Default behaviour: every font added is flate-compressed
PDF.CompressFonts(1);
PDF.AddTrueTypeFontFromFile('C:\Windows\Fonts\arial.ttf');
PDF.AddTrueTypeFontFromFile('C:\Windows\Fonts\arialbd.ttf');
// One uncompressed font for downstream tooling that cannot decode flate fonts
PDF.CompressFonts(0);
PDF.AddType1Font('Helvetica');Viz také
CompressContent, CompressImages, AddTrueTypeFont, AddTrueTypeSubsettedFont, AddOpenTypeFontFromFile