Skip to content

Version Coverage

phpdftk covers the entire PDF specification history from version 1.0 through 2.0, with 172 features precisely annotated to their introduction version. The library automatically manages version requirements — use any feature and the document version bumps to match, or enable strict mode to catch version mismatches at development time.

use Phpdftk\Pdf\Writer\PdfWriter;
use Phpdftk\Pdf\Core\Document\OCG;
$writer = new PdfWriter();
// OCG requires PDF 1.5 — version auto-bumps
$ocg = new OCG();
$ocg->name = 'Layer 1';
$writer->register($ocg);
// Output will be PDF 1.5 (not the default 1.7)
$writer->save('layered.pdf');

In strict mode, the writer throws instead of bumping:

$writer->getFileWriter()->setStrictVersionMode(true);
// Now registering a 1.5 feature when targeting 1.4 throws VersionRequirementException

172 classes and properties are annotated across PDF 1.1 through 2.0.

All unannotated features default to 1.0: core primitives, Catalog, PageTree, Page, Type1 fonts, content stream operators, DeviceRGB/CMYK/Gray.

Bookmarks, page transitions, CIE-based color, Multiple Master fonts.

FeatureWhat it adds
CalGray, CalRGB, LabCIE-based color spaces
Outline + OutlineItemDocument bookmarks
TransitionDictPage transition effects
MMType1FontMultiple Master fonts
LaunchAction, ThreadActionApplication launch, article threads

Interactive forms, composite fonts, patterns.

FeatureWhat it adds
AcroFormInteractive form support
WidgetAnnotationForm field widgets
Type0Font, CIDFontComposite (CJK) fonts
TilingPattern, PatternFill patterns
HideAction, SubmitFormAction, ResetFormAction, ImportDataActionForm actions
AppearanceDict, AppearanceCharacteristicsAnnotation appearance control
AdditionalActionsEvent triggers

ICC color, shading/functions, tagged PDF, digital signatures, text markup annotations.

FeatureWhat it adds
ICCBased, SeparationICC profiles, spot colors
ShadingPattern, Shading (types 1–7)Gradient fills
Func (types 0–4)Mathematical functions
StructTreeRoot, StructElemTagged PDF / accessibility
SignatureField, SignatureValue, SignatureReferenceDigital signatures
JavaScriptAction, PageLabelJavaScript, page numbering
14 annotation typesFreeText, Line, Square, Circle, Polygon, PolyLine, Highlight, Underline, Squiggly, StrikeOut, Stamp, Ink, Popup, FileAttachment

Transparency, metadata, markup annotations.

FeatureWhat it adds
SoftMask, GroupAttributesTransparency model
MetadataStreamXMP metadata streams
MarkupAnnotation (base)Reply threading, creation dates
OutputIntentColor management for print
ExtGState transparencyBlend mode, alpha, soft mask properties

Optional content (layers), multimedia, compressed object/xref streams.

FeatureWhat it adds
OCG, OCMD, OCPropertiesDictLayers / optional content
CrossReferenceStream, ObjectStreamCompressed PDF internals
CryptFilterPer-stream encryption
MediaRendition, SelectorRenditionRich media playback
MediaClipData/Section, MediaPlayParams, MediaScreenParamsMedia configuration
ScreenAnnotation, CaretAnnotationScreen, caret markers
PolygonAnnotation, PolyLineAnnotation, RedactAnnotationGeometry, redaction
RenditionAction, SetOCGStateAction, TransActionMultimedia/layer actions
SigFieldLockSignature field locking

3D content, DeviceN color, document timestamps.

FeatureWhat it adds
ThreeDStream + 5 sub-objectsU3D and PRC 3D content
ThreeDAnnotation3D viewport in page
DeviceNMulti-component color (e.g., Hexachrome)
DocTimeStampRFC 3161 document-level timestamps
WatermarkAnnotationWatermarks
CFFFontFileOpenType CFF font embedding
GoToEAction, GoTo3DViewActionEmbedded file / 3D navigation
CIDFontType0FontCID CFF font type

Portable collections, document requirements.

FeatureWhat it adds
Collection, CollectionSchema, CollectionItemPortable file collections
Requirement, RequirementHandlerDocument requirement declarations
Catalog::$extensionsDeveloper extensions dictionary

Document parts, rich media, Document Security Store.

FeatureWhat it adds
DPartRoot, DPartVariable data printing structure
DSSDocument Security Store (LTV signatures)
ProjectionAnnotation, RichMediaAnnotationProjection, rich media
GoToDPAction, RichMediaExecuteActionDocument part / rich media actions
Associated files (Catalog, Page, FormXObject, FileSpec)File attachment relationships
ViewerPreferences::$enforceEnforced viewer settings
SeedValueDictionary fieldsSignature appearance/lock control

7 features are marked deprecated. With strict deprecation enabled, using them at their removal version throws DeprecatedFeatureException.

FeatureDeprecatedReplacement
Movie2.0RichMediaAnnotation
MovieAction2.0RichMediaExecuteAction
MovieAnnotation2.0ScreenAnnotation
Sound2.0MediaRendition
SoundAction2.0RenditionAction
SoundAnnotation2.0RichMediaAnnotation
PostScriptXObject1.7.1

Some features determine their version at runtime:

  • StructElem — bumps to 2.0 when using PDF 2.0 structure types (DocumentFragment, Aside, Title, THead, TBody, TFoot, FENote, Artifact)
  • PdfEncryptor — RC4 requires 1.4, AES-128 requires 1.6, AES-256 requires 2.0
  • PdfFileWriter — auto-bumps to 1.5 for xref streams, syncs Catalog /Version for versions > 1.4