PDF Filter Support

סקירה

זרמי PDF ותמונות מוטמעות מזהים את הקידוד שלהם באמצעות שמות filter. ‏HotPDF עובדת בעיקר עם משפחות ה-filter הבאות בעת יצירת מסמכים או פענוח תוכן חיצוני

Common Filters

  • FlateDecode: filter הדחיסה הראשי לזרמים שנוצרים ומסלול פירוק הדחיסה העיקרי המבוסס zlib
  • LZWDecode: נתמך לתרחישי legacy ותאימות דרך HPDFLZW.pas
  • DCTDecode: Used for standard JPEG image data handled by HotPDF image loading paths
  • CCITTFaxDecode: Common in monochrome TIFF and fax-style image data
  • ASCIIHexDecode / ASCII85Decode / RunLengthDecode: עזרי encoder שנחשפים ב-HPDFTypes.pas ‏(_ASCIIHexEncode, ‏_ASCII85Encode, ‏_RunLengthEncode) מאז HotPDF v2.4.0. שימושיים בעת עטיפת תוכן binary שרירותי לערוצים של 7-bit או לתמיכת round-trip מפורשת של PDF 1.7 7.4
  • JBIG2Decode / JPXDecode: Filter names defined by PDF 1.7 7.4.7 / 7.4.9. HotPDF's bundled JBIG2 and JPEG 2000 helpers are stubs that report unsupported (return False) until a real OpenJPEG / JBIG2 backend is linked. Earlier builds returned a fake 100×100 success which produced unreadable images; this is now corrected

Practical Notes

  • Not every filter is exposed through a single generic API; some are reached through dedicated image or stream helper units
  • עבור תוכן PDF שנוצר, THotPDF.Compression נשארת ההגדרה המרכזית הפונה למשתמש
  • בעת טעינת נתונים חיצוניים, ה-filter הרלוונטי תלוי בפורמט קובץ המקור ובמחלקת העזר שבה משתמשים
  • Encrypted PDFs combine these filters with the security handler; see CryptKeyLength for the supported AES‑128 (V=4 R=4 / CFM=AESV2) and RC4 (V=1/V=2) options
  • Interactive form fields are emitted as Widget annotations that the viewer paints; see AcroForm Support
  • Text-markup annotations (Highlight, Underline, Squiggly, StrikeOut) and intra-document jump links (GoTo, GoToR, Launch) are exposed as new THPDFPage.Add*Annotation / AddGoToLink / AddGoToRLink / AddLaunchLink methods since HotPDF v2.6.0
  • פלט DeviceCMYK זמין דרך THPDFPage.SetCMYKColor / SetCMYKFillColor / SetCMYKStrokeColor; color spaces מנוהלים ICC נרשמים עם THotPDF.RegisterICCProfile ומוחלים באמצעות SetFillColorSpace / SetStrokeColorSpace + SetFillColor / SetStrokeColor מאז HotPDF v2.7.0
  • הגדר THotPDF.UseXRefStream ל-true לפני שמירה כדי לפלוט זרם cross-reference יחיד מסוג /Type /XRef דחוס FlateDecode במקום רצף טקסטואלי של xref / trailer / startxref ‏(PDF 1.7 7.5.8); זמין מאז HotPDF v2.8.0
  • הגדר THotPDF.EnableXMPMetadata ל-true כדי להצמיד ל-Catalog זרם XMP מסוג /Type /Metadata /Subtype /XML ‏(PDF 1.7 14.3.2); נבנה אוטומטית משדות Info dict, או ספק packet שנכתב ידנית דרך CustomXMP. זמין מאז HotPDF v2.9.0
  • שערי גרסת PDF לכל מתודה, מאז HotPDF v2.24.0. כל feature method שהוצג ב-v2.4.0+ מתייעץ עם RequirePDFVersion לפני פליטה; כאשר StrictVersionLock=false, ברירת המחדל, Version של המסמך עולה בשקט למינימום שה-feature דורש, וכאשר StrictVersionLock=true הקריאה מסורבת כדי שהקובץ השמור יתאים בקפדנות למפרט reference שנבחר 1.3 / 1.4 / 1.5 / 1.6 / 1.7
  • מקודדי predictor עבור PNG ו-TIFF לנתוני תמונה דחוסים ב-FlateDecode ‏(PDF 1.7 7.4.4.4): ‏_PNGPredictorEncode מחיל heuristic של libpng לפי minimum-absolute-difference filter ‏(Predictor=15), ו-_TIFFPredictor2Encode מחיל horizontal differencing ‏(Predictor=2). זמין מאז HotPDF v2.10.0
  • Tagged PDF entry points (PDF 1.7 14.7-14.8): THotPDF.Lang populates /Lang in the Catalog, EnableTaggedPDF emits /MarkInfo <</Marked true>> and a stub /StructTreeRoot, and the new THPDFPage.BeginMarkedContent / BeginMarkedContentMCID / EndMarkedContent methods write the BMC / BDC / EMC content-stream operators. Available since HotPDF v2.11.0
  • Axial and radial gradients (PDF 1.7 7.10 / 8.7): THotPDF.RegisterAxialGradient / RegisterRadialGradient build the full Function Type 2 / Shading Type 2-3 / Pattern Type 2 stack and return a stable pattern name; THPDFPage.SetFillPattern / SetStrokePattern install it onto the page. Component count of the start / end color selects DeviceGray (1) / DeviceRGB (3) / DeviceCMYK (4). Available since HotPDF v2.13.0; multi-stop axial gradients via Function Type 3 are exposed through RegisterMultiStopAxialGradient since v2.18.0
  • תמונות inline ‏(PDF 1.7 8.9.7) דרך THPDFPage.DrawInlineImage; bytes גולמיים נעטפים אוטומטית ב-ASCIIHex כאשר לא סופק Filter כדי ש-content stream יישאר נקי 7-bit. זמין מאז HotPDF v2.18.0
  • OutputIntents ‏(PDF 1.7 14.11) דרך THotPDF.AddOutputIntent; כל קריאה מוסיפה ל-Catalog מילון /Type /OutputIntent עם /DestOutputProfile אופציונלי שמפנה לפרופיל ICC רשום. זמין מאז HotPDF v2.18.0
  • יצירה אוטומטית של AcroForm appearance-stream ‏(PDF 1.7 12.5.5 / 12.7.3.3 / 8.10): הגדר THotPDF.AutoFormAppearances ל-true לפני הוספת שדות form אינטראקטיביים ו-HotPDF תבנה מראש /Subtype /Form Form XObject עבור ערך /AP /N של כל widget, כולל sub-dicts של Yes / Off לכפתורים, תמלא את AcroForm /DR default resources במילוני פונט indirect של Helvetica / ZapfDingbats, ותעביר את /NeedAppearances ל-false כדי ש-renderers יכבדו את הזרמים המוטמעים. זמין מאז HotPDF v2.28.0
  • ViewerPreferences/ViewArea ו-/ViewClip ‏(PDF 1.4 12.2 Table 152) נחשפים כעת דרך מאפייני THotPDF.ViewArea / THotPDF.ViewClip, עם members תואמים vpViewArea / vpViewClip. שניהם מקבלים ערכי THPDFPageBoundary ‏(MediaBox / CropBox / BleedBox / TrimBox / ArtBox) ומשלימים את כיסוי HotPDF לארבעת ViewerPreferences של page-boundary ב-PDF 1.4. זמין מאז HotPDF v2.29.0
  • מעברי עמוד ‏(PDF 1.1 / 1.5 12.4.4): ‏THPDFPage.SetPageTransition כותב מילון /Trans על העמוד כך שקוראי PDF במצב /PageMode /FullScreen ינפישו ניווט. סגנונות PDF 1.1 ‏(Split, Blinds, Box, Wipe, Dissolve, Glitter, R) וסגנונות PDF 1.5 ‏(Fly, Push, Cover, Uncover, Fade) נחשפים דרך enum ‏THPDFTransitionStyle; נחשפות גם תת-אפשרויות /Dm, ‏/M ו-/Di. ‏THPDFPage.SetPageDuration כותב את השהיית auto-advance ‏/Dur בשניות. זמין מאז HotPDF v2.30.0
  • קבוצת transparency ברמת עמוד ‏(PDF 1.4 11.6.6 / 7.5.5): ‏THPDFPage.SetTransparencyGroup מצמיד מילון /Group ‏(/Type /Group /S /Transparency) כדי ש-renderers ירכיבו תוכן נושא alpha באופן צפוי. בחר device color space דרך enum ‏THPDFGroupColorSpace ‏(DeviceGray / DeviceRGB / DeviceCMYK או השמט), או קרא ל-THPDFPage.SetTransparencyGroupICC עם שם של פרופיל ICC שנרשם קודם דרך THotPDF.RegisterICCProfile. דגלים אופציונליים /I ‏(Isolated) ו-/K ‏(Knockout) מכוונים את compositor; ‏THPDFPage.ClearTransparencyGroup מסיר entry קודם. זמין מאז HotPDF v2.32.0
  • incremental update ‏(PDF 1.7 ISO 32000-1 7.5.6): ‏THotPDF.BeginIncrementalUpdate(SourceFile) טוען PDF קיים במצב append-only; קריאות CreateIndirect* מאוחרות מסמנות אוטומטית אובייקטים חדשים כ-dirty, ו-THotPDF.MarkDirty(Obj) מסמן אובייקטים טעונים קיימים לפליטה מחדש. THotPDF.SaveIncrementalUpdate(TargetFile) כותב את bytes המקוריים כפי שהם, מצרף רק אובייקטים dirty תוך שמירת מספרי האובייקט שלהם, פולט xref subsection חדש ומסיים ב-trailer עם /Prev שמצביע אל ה-xref הקודם. שלב עם pipeline הקיים AddSignedSignatureField + PreparePDFForSigning + InsertSignatureHex כדי להוסיף שדות חתימה מאוחרים למסמך שכבר חתום בלי לפסול חתימות קודמות, משום ש-digests של /ByteRange נשארים תקפים כאשר אף byte מקורי אינו משתנה. זמין מאז HotPDF v2.35.0
  • נרמול שמות פונט TrueType מוטמעים: HotPDF קוראת את טבלת name של TrueType המוטמע ומיישרת את /BaseFont, ‏/FontDescriptor /FontName, ‏/FontFamily ושמות פונטי CID צאצאים עם שם PostScript של תוכנית הפונט. הדבר מונע כשלים של Adobe Acrobat Font Capture שנגרמים מחוסר התאמה בין מילון הפונט ב-PDF לבין payload ה-TTF המוטמע. זמין מאז HotPDF v2.35.1
  • TrueType font subsetting (PDF 1.7 ISO 32000-1 9.6.4 / 9.8.2): set THotPDF.EnableFontSubsetting to true before BeginDoc and HotPDF rebuilds the embedded TrueType payload to contain only the glyphs actually used by the document. Typical Latin documents see ~90% reduction in embedded font weight (1 MB Arial -> ~70 KB on a one-line "Hello, world."). Composite-glyph dependencies are tracked recursively, GID numbering is preserved (so existing Type0 / Identity-H content streams keep working), and the new /BaseFont automatically gains the spec-mandated six-letter "+"-suffixed prefix (e.g. /BaseFont /AAAAAA+ArialMT). Off by default; enable opt-in to keep full-font embedding for editing workflows. Available since HotPDF v2.36.0
  • Compact Font Format (CFF) subsetter (PDF 1.7 ISO 32000-1 9.7.4 / 9.9): companion to the TrueType subsetter for OpenType-CFF (.otf, sfntVersion OTTO) and Type 1 / Type 1C fonts. The unit-exported HPDFSubsetCFF(CFFBytes, KeepGlyph) function rebuilds the CharStrings INDEX with un-kept glyphs replaced by the minimal 1-byte endchar stub, preserving GID numbering byte-for-byte. Available since HotPDF v2.37.0.
  • מסלול הטמעת OpenType-CFF ‏(.otf) חובר אל StoreFont ‏(PDF 1.6+ 9.7.4 Table 117). כאשר binary הפונט שנטען דרך GDI הוא container ‏sfnt OTTO, ‏HotPDF מבצעת subset לתת-טבלת 'CFF ' המוטמעת דרך HPDFSubsetOTFContainer, פולטת את תוכנית הפונט דרך /FontFile3 /Subtype /OpenType, וכותבת את מילון descendant font עם /Subtype /CIDFontType0 במקום /CIDFontType2. פונטי TrueType ממשיכים דרך מסלול /FontFile2 + /CIDFontType2 הקיים ללא שינוי התנהגות. זמין מאז HotPDF v2.38.0
  • subsetting מקצה לקצה של CFF subroutine ‏(PDF 1.7 9.7.4 §6 / Adobe Tech Note #5177 §3.1): ה-CFF subsetter מסיר כעת entries שאינם בשימוש גם מ-Global Subr INDEX וגם מ-Local Subr INDEX. closure אחד בנקודה קבועה עוקב טרנזיטיבית אחרי שרשראות callsubr ‏(op 0x0A) ו-callgsubr ‏(op 0x1D), כך ש-CharString שקורא ל-Local Subr שקורא ל-Global Subr שקורא ל-Local Subr אחר נאסף באיטרציה אחת. כל entry שאינו בשימוש מוחלף ב-return stub בגודל 1 byte וה-INDEX נכתב מחדש במקום עם אפסים ב-slack בסוף. ההתנהגות נחשפת דרך העזרים הציבוריים HPDFSubsetCFF ו-HPDFSubsetOTFContainer; סורקי CFF ברמה נמוכה נשארים פנימיים. זמין מאז HotPDF v2.39.0
  • subsetting של CFF ממופה CID ‏(PDF 1.7 ISO 32000-1 9.7.4 / Adobe Tech Note #5176 §18-19): ה-CFF subsetter מזהה כעת operator ‏Top DICT ROS ‏(12-30) שמסמן פונט OpenType-CFF ממופה CID ועובר על FDArray ‏(12-36) INDEX של Font DICTs, שכל אחד נושא Private DICT ו-Local Subr INDEX משלו. מפת FDSelect ‏(12-37) glyph-to-FD נשמרת byte-for-byte. סריקת subroutine-closure עוקבת אחרי FD context של כל CharString שנשמר, כך ש-glyph ב-FD #5 מסמן רק Local Subrs ב-FD #5; global subrs נשארים משותפים בין FDs. כל Local Subr INDEX של FD נכתב מחדש במקום כאשר entries שאינם בשימוש מכווצים ל-return stubs של 1 byte. פונטי OTF של CJK / Indic / Arabic עוברים כעת דרך pipeline subsetting מלא במקום להיטמע כפי שהם. זמין מאז HotPDF v2.40.0
  • Object Streams ‏(PDF 1.5 ISO 32000-1 7.5.7): הגדר THotPDF.UseObjectStreams ל-true בנוסף ל-UseXRefStream, ו-SaveToStream יארוז אובייקטים indirect מתאימים, כל דבר מלבד streams, מילון ההצפנה ומילוני Catalog ו-Info שאליהם trailer מצביע, לתוך אחד או יותר container streams מסוג /Type /ObjStm. cross-reference stream מפנה אז לאובייקטים הארוזים דרך entries מסוג type-2. הדבר מקטין משמעותית קבצים עם מילונים קטנים רבים, כגון מסמכים מרובי עמודים, annotations, ‏AcroForm widgets, רכיבי structure-tree ו-Optional Content layers; smoke גרפי של 30 עמודים קטן מ-14502 ל-8488 bytes ‏(קטן ב-41.5%). יורד בשקט ל-false כאשר UseXRefStream כבוי או כאשר Version נמוכה מ-PDF 1.5. זמין מאז HotPDF v2.41.0
  • תמונת soft-mask ‏/ SMask ‏(PDF 1.4 ISO 32000-1 8.9.5.4): ‏THotPDF.AddImageWithSMask(Width, Height, RGB, Alpha) פולט image XObject צבעוני יחד עם image XObject של soft-mask מסוג 8-bit DeviceGray ומחבר אוטומטית את cross-reference של /SMask, כך שכל pixel יכול לשאת שקיפות מלאה לכל channel במקום מגבלת on/off בינארית של מסלול /ImageMask הישן. overload convenience ‏THotPDF.AddImageWithSMask32(Bitmap32) שולף את מישורי RGB ו-alpha מתוך TBitmap ‏BGRA בגודל 32-bit לצורך הטמעת PNG עם alpha בקריאה אחת. שני call sites עוברים דרך RequirePDFVersion(pdf14) כדי שפלט strict-mode 1.3 יישאר תקין. זמין מאז HotPDF v2.42.0
  • צביעת Uncolored Tiling Pattern ‏(PDF 1.7 ISO 32000-1 8.6.6.1): ‏THotPDF.RegisterTilingPattern פלטה מאז v2.19.0 גם /PaintType 1 ‏(colored) וגם /PaintType 2 ‏(uncolored), אך רצף operator בצד העמוד היה נכון רק ל-colored variant. שש מתודות חדשות של THPDFPage - ‏SetFillPatternRGB / SetStrokePatternRGB / SetFillPatternGray / SetStrokePatternGray / SetFillPatternCMYK / SetStrokePatternCMYK - מפעילות כעת את מסלול uncolored באמצעות רישום אוטומטי של color space מתאים [/Pattern /BaseCS] במילון Resources/ColorSpace של העמוד ופליטת רצף tint_components /Pn scn שנדרש במפרט. השתמש במתודות המקוריות SetFillPattern / SetStrokePattern עבור colored variant שבו ה-tile נושא צבע משלו. זמין מאז HotPDF v2.43.0
  • CIELab color space (PDF 1.3+ ISO 32000-1 8.6.5.3): THotPDF.RegisterLabColorSpace(Xw, Yw, Zw, aMin, aMax, bMin, bMax) builds an inline [/Lab << /WhitePoint /BlackPoint /Range >>] color space array, stores it under an auto-generated name (Lab1, Lab2, ...) and returns that name for use with the regular THPDFPage.SetFillColorSpace / SetStrokeColorSpace + SetFillColor([L, a, b]) / SetStrokeColor([L, a, b]) pipeline. Drop in a D50 illuminant [0.9505, 1.0, 1.089] for ICC print workflows or a D65 illuminant [0.95047, 1.0, 1.08883] for sRGB-equivalent display, then paint with L* in [0..100] and a*, b* in the chosen range (typically [-128..127]). Available since HotPDF v2.44.0.
  • Separation color space עבור spot colors ‏(PDF 1.3+ ISO 32000-1 8.6.6.4): ‏THotPDF.RegisterSeparation(ColorantName, AlternateCS, TintC1) מצהיר על spot ink בעל רכיב אחד, שבו operand tint יחיד ב-[0..1] מפעיל tint transform ליניארי מסוג Function Type 2 שנבנה פנימית. השתמש בשם המוחזר, כמו Sep1 או Sep2, עם pipeline הרגיל SetFillColorSpace / SetStrokeColorSpace + SetFillColor([tint]) / SetStrokeColor([tint]). ‏AlternateCS מקבל DeviceGray, DeviceRGB או DeviceCMYK; ‏TintC1 מספק את רכיבי alt-CS ב-tint = 1.0. שמות Pantone ודיו אחרים עם רווחים מתקבלים ישירות; HotPDF מבצעת להם escape ל-#20 לפי PDF 1.7 7.3.5 בעת כתיבת שם color-space. זמין מאז HotPDF v2.45.0
  • זרמי appearance של AcroForm multi-line ו-comb text ‏(PDF 1.7 ISO 32000-1 12.7.4.3): כאשר THotPDF.AutoFormAppearances פעיל, שדות טקסט ש-Flags שלהם כוללים ffMultiline מקבלים Form XObject של /AP /N עם word-wrap, layout של Td + T* + /TL, כיבוד מפרידי CR / LF / CRLF וחיתוך לפי מספר השורות הנראות. שדות ש-Flags שלהם כוללים ffComb יחד עם MaxLen חיובי מרנדרים כל תו בתא שווה-רוחב משלו באמצעות מטריצת Tm מוחלטת לכל glyph. layout של שורה אחת מ-v2.28.0 נשמר byte-for-byte לשדות ללא דגלים אלה. תווים בינלאומיים בערך ההתחלתי עדיין נופלים למסלול recomputation של /NeedAppearances ב-viewer; יצירת appearance מלאה עם embedded-CID-font נשארת עבודה עתידית. זמין מאז HotPDF v2.46.0
  • AcroForm /AP Unicode font (PDF 1.7 ISO 32000-1 12.7.2 + 12.7.4.3): THotPDF.SetFormUnicodeFontDict(LogicalName, FontDict) registers a caller-supplied Type 0 / CIDFontType2 + Identity-H composite font in the AcroForm /DR/Font default-resources dict. Once registered, the AcroForm-level /DA, every Tx widget's /DA, and the /AP /N stream produced by AutoFormAppearances for non-ASCII Tx initial values all switch to the logical name; the Form XObject's /Resources/Font sub-dict also references the same indirect font so the AP is self-contained without depending on /DR resolution at render time. The companion helper THotPDF.CreateIndirectFontDict returns a fresh empty THPDFDictionaryObject registered as an indirect PDF object so callers can build custom font dicts (or any other dict requiring "N G R" indirect serialization) without touching internal helpers. Pass empty LogicalName and nil FontDict to revert to the v2.46.0 ASCII-only /Helv behavior. ASCII Tx fields continue to use /Helv with byte-identical output to v2.46.0 / v2.55.0. Multi-line + comb non-ASCII /AP and RTL bidi shaping (UAX #9 + Arabic contextual joining) remain future work. Available since HotPDF v2.56.0; ffMultiline non-ASCII /AP support (per-line UTF-16BE hex Tj with Td / T* / /TL leading and CJK-aware word-wrap) since v2.57.0; ffComb non-ASCII /AP support (per-CID equal-width absolute Tm cells + single-cell Tj per code point with UTF-16 surrogate-pair handling) since v2.58.0; THotPDF.FormUnicodeRTL property for right-to-left direction (reverses UTF-16 order in /AP Tj hex while keeping /V in logical order; caller pre-shapes Arabic to Unicode presentation forms U+FB50..U+FDFF + U+FE70..U+FEFF; full UAX #9 + automatic GSUB shaping pending) since v2.59.0.
  • AcroForm rich-text Tx widget ‏(PDF 1.5+ ISO 32000-1 12.7.4.3 + Annex L): ‏THPDFPage.AddRichTextField(FieldName, InitialValue, RichValue, DefaultStyle, Rectangle, [MaxLen], [Flags]) פולט text widget עם /RV ‏(rich-text XHTML body), ‏/DS ‏(CSS-like default style), bit ‏ffRichText /Ff ‏26 שנוסף אוטומטית, וגם fallback plain-text ‏/V + /DV עבור קוראים שאינם מנתחים /RV. Acrobat ו-Foxit מרנדרים ישירות מ-/RV כאשר bit ‏RichText פעיל ומקבלים font fallbacks מהפונטים המותקנים של הקורא, כך שתוכן multi-byte כמו CJK / Cyrillic / Arabic / Latin עם accents מוצג נכון ללא הטמעת פונט CID ב-/DR Resources של HotPDF. ‏/V ו-/RV מזהים אוטומטית קלט multi-byte ועוברים לקידוד UTF-16BE hex-string בעת הצורך. יצירת CID-font appearance-stream עבור מסלול /AP של HotPDF נשארת עבודה עתידית; קוראים מודעי rich-text אינם זקוקים לה. זמין מאז HotPDF v2.55.0
  • DeviceN color space for multi-colorant spot-ink workflows (PDF 1.3+ ISO 32000-1 8.6.6.5): THotPDF.RegisterDeviceN(ColorantNames, AlternateCS, TintC1Matrix) generalises RegisterSeparation from a single spot ink to N. The tint transform is a PostScript-calculator Function Type 4 emitting a linear weighted-blend over the supplied N x M matrix (row n column m is colorant n's contribution to AlternateCS channel m when colorant n is 1.0 alone). Returns a color-space name (DevN1, DevN2, ...) that drives the regular SetFillColorSpace + SetFillColor([t0, t1, ..., t_{N-1}]) pipeline. AlternateCS accepts DeviceGray, DeviceRGB or DeviceCMYK; ink names with spaces are escaped to #20 per PDF 1.7 7.3.5; the special name None marks an unused colorant slot. Available since HotPDF v2.47.0.
  • Free-form Gouraud-shaded triangle mesh (PDF 1.3+ ISO 32000-1 8.7.4.5.4): THotPDF.RegisterFreeFormGouraudShading(XMin, YMin, XMax, YMax, NumComponents, Vertices) declares a /ShadingType 4 stream with /BitsPerCoordinate 16 + /BitsPerComponent 8 + /BitsPerFlag 8, wraps it in an inline Pattern Type 2 entry on the page Resources/Pattern dict, and returns the auto-generated pattern name (Sh1, Sh2, ...) for the regular SetFillPattern / SetStrokePattern pipeline. Each vertex is packed as 1 flag byte (always 0 for independent triangles) + 2 big-endian X bytes + 2 big-endian Y bytes + NumComponents 8-bit color components. The NumComponents argument accepts 1 (DeviceGray), 3 (DeviceRGB) or 4 (DeviceCMYK); each vertex contributes 2 + NumComponents Extended values to Vertices in (X, Y, c1...cN) order; vertex count must be a multiple of 3. /Decode maps the 16-bit coordinates back to [XMin, XMax] x [YMin, YMax] and the color components to [0, 1]. Type 5 (lattice), Type 6 (Coons patch) and Type 7 (tensor product) mesh shadings remain future work. Available since HotPDF v2.48.0.
  • lattice-form Gouraud-shaded triangle mesh ‏(PDF 1.3+ ISO 32000-1 8.7.4.5.5): ‏THotPDF.RegisterLatticeFormGouraudShading מצהיר על stream ‏/ShadingType 5 שמסדר vertices ב-lattice של M rows x N columns ומאפשר ל-renderer לבצע auto-triangulate לכל זוג שורות סמוכות לרצועת משולשים. בניגוד ל-RegisterFreeFormGouraudShading ‏(Type 4), אין flag byte לכל vertex; ‏/BitsPerFlag נעדר ממילון shading וכל vertex תופס רק 4 + NumComponents bytes. השתמש בו לנתוני מקור שכבר נמצאים על sample grid רגיל, כמו terrain, תוצאות FEA ו-heatmaps מדעיים. VerticesPerRow חייב להיות לפחות 2 ומספר vertices הכולל חייב להיות כפולה שלו עם לפחות שתי שורות. זמין מאז HotPDF v2.49.0
  • Coons patch mesh shading ‏(PDF 1.3+ ISO 32000-1 8.7.4.5.6): ‏THotPDF.RegisterCoonsPatchMesh מצהיר על stream ‏/ShadingType 6 של Coons patches, שכל אחד תחום בארבע עקומות cubic Bezier ונושא צבע אחד לכל פינה. ה-renderer מתאים את משטח Coons בין ארבעת הקצוות, ויוצר quad נושא צבע בעל עקמומיות שרירותית; שימושי ל-foil ו-gradients מתכתיים על נתיבים מכופפים, gradient meshes שמקורם ב-SVG וכל quad בעל קצוות מעוקלים שהיה דורש משולשים קטנים רבים לקירוב. כל patch תורם 12 נקודות בקרה ולאחריהן 4 צבעי פינה, ולכן stride של Patches הוא 24 + 4 * NumComponents. זמין מאז HotPDF v2.50.0
  • Separation color space with sampled LUT tint transform (PDF 1.3+ ISO 32000-1 8.6.6.4 + 7.10.2): THotPDF.RegisterSeparationLUT(ColorantName, AlternateCS, Samples) wraps RegisterSampledFunction so callers can express a full non-linear tint -> alt-CS curve as a flat byte stream of 8-bit (M-tuple) samples without manually constructing a Function Type 0 dictionary. Use the LUT variant when the color transition is non-linear - PANTONE Hexachrome-style tint ramps, gamma-corrected density curves, hand-drawn tone curves matching a press characterisation, sRGB-to-spot conversion ICC LUTs without the full ICC profile machinery; the v2.45.0 RegisterSeparation entry point still covers the linear single-endpoint case. AlternateCS accepts DeviceGray, DeviceRGB or DeviceCMYK; Samples length must be a positive multiple of M with at least 2 * M bytes so the function has interpolable range, and the grid-point count S is inferred from Length(Samples) / M. Linear interpolation is the default per PDF 1.7 /Order 1. Returns the registered color-space name (Sep1, Sep2, ...) for use with the regular SetFillColorSpace + SetFillColor([tint]) pipeline. Available since HotPDF v2.53.0.
  • Function Type 0 (Sampled) registration (PDF 1.3+ ISO 32000-1 7.10.2): THotPDF.RegisterSampledFunction(Domain, Range, Size, BitsPerSample, Samples, [Order]) declares an indirect /FunctionType 0 stream that expresses an arbitrary input-to-output mapping as a regular N-dimensional grid of M-dimensional output samples, interpolated between grid points. Use it where ICC profile machinery is overkill but a hand-tuned color LUT is desired - tone curves for /TransferFunction (ExtGState /TR), sampled tint transforms for /Separation / /DeviceN beyond the linear Type 2 / arithmetic Type 4 paths, halftone threshold curves, or any other PDF construct that takes a Function dictionary. Domain is 2N entries (one [min, max] pair per input dimension); Range is 2M entries (one pair per output dimension); Size is N grid-point counts; BitsPerSample accepts 1, 2, 4, 8, 12, 16, 24, or 32 per PDF 1.7 Table 38; Samples is the raw bit-packed sample stream (MSB-first within each sample, no padding between samples beyond the final-byte zero-fill, with input 0 varying fastest per spec sample-order rules); Order defaults to 1 (linear) and accepts 3 (cubic-spline interpolation, since v2.54.0) per PDF 1.7 Table 38. HotPDF validates the sample-byte count against ceil(GridPoints * M * BitsPerSample / 8). Returns the indirect THPDFStreamObject so callers can attach it wherever a Function dictionary is expected. Available since HotPDF v2.52.0; cubic /Order 3 + end-to-end multi-input / multi-output coverage since v2.54.0.
  • Tensor product patch mesh shading ‏(PDF 1.3+ ISO 32000-1 8.7.4.5.7): ‏THotPDF.RegisterTensorProductPatchMesh מצהיר על stream ‏/ShadingType 7 של tensor-product patches, שכל אחד מוגדר על ידי רשת מלאה 4 x 4 של נקודות בקרה bicubic Bezier ‏p[i][j] ועוד צבע אחד לכל פינה. הוא מרחיב את RegisterCoonsPatchMesh ‏(Type 6) באמצעות 4 נקודות בקרה פנימיות מפורשות, ומספק שליטה עדינה יותר בפנים ה-patch. שימושי ל-round-trips של SVG mesh-gradient וליצירה שצריכה משטח tensor-product Bezier. כל patch תורם 16 נקודות בקרה ולאחריהן 4 צבעי פינה, ולכן stride של Patches הוא 32 + 4 * NumComponents. עם גרסה זו כל משפחת ISO 32000-1 8.7.4.5 mesh shading ‏(Types 4 / 5 / 6 / 7) מכוסה. זמין מאז HotPDF v2.51.0
  • Annotation border style and Popup linkage (PDF 1.7 12.5.4 / 12.5.6.14): THPDFPage.SetAnnotationBorderStyle(Annot, Width, Style, DashPattern) attaches a /BS dictionary with the chosen THPDFAnnotBorderStyle (absSolid / absDashed / absBeveled / absInset / absUnderline). THPDFPage.AddPopupAnnotationFor(ParentAnnot, Rect, Open) emits a /Popup annotation that is wired in both directions (parent /Popup -> popup, popup /Parent -> parent) so the viewer can render the speech-balloon connector. The new THPDFPage.LastAnnotation property feeds either helper without changing the signature of the existing Add*Annotation procedures. Available since HotPDF v2.34.0
  • Public-Key Security Handler ‏(PDF 1.7 7.6.5): ‏THotPDF.EnablePubKeyEncryption(seed, KeyType, EncryptMetadata) + THotPDF.AddPubKeyRecipient(envelope) פולטים מילון הצפנה /Filter /Adobe.PubSec עם /SubFilter /adbe.pkcs7.s4 עבור V=1 RC4-40, ‏/adbe.pkcs7.s5 עבור V=2 RC4-128 / V=4 AESV2. הקורא מספק seed אקראי בן 20 bytes ו-blob בינארי PKCS#7 envelopedData אחד לכל נמען, שנבנה חיצונית עם Windows CryptoAPI, OpenSSL או pycryptodome. ‏HotPDF גוזרת את מפתח הצפנת הקובץ דרך algorithm 9 ומשתמשת מחדש בגזירת מפתח per-object הסטנדרטית ל-AES-128 / RC4 streams. זמין מאז HotPDF v2.33.0

See Also