You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ If this project is useful to you, please consider [supporting development via Gi
24
24
-[Installation](#installation)
25
25
-[Font Setup](#font-setup)
26
26
-[Quick Start](#quick-start)
27
+
-[PDF Import](#pdf-import)
27
28
-[Remote Resources and fileOptions](#remote-resources-and-fileoptions)
28
29
-[Digital Signatures](#digital-signatures)
29
30
-[PDF/X Conformance](#pdfx-conformance)
@@ -124,6 +125,12 @@ The fastest way to evaluate the library is to follow the installation and font s
124
125
-**PDF/X** (generic alias, PDF/X-1a, PDF/X-3, PDF/X-4, PDF/X-5) — print-exchange conformance: per-variant OutputIntent identifiers, GTS_PDFXVersion in Info dict and XMP, PDF version enforcement, CMYK color forcing for restrictive profiles (X-1a, X-3), transparency restrictions, and suppression of encryption and JavaScript
125
126
-**PDF/UA** (generic alias, PDF/UA-1, PDF/UA-2) — accessibility conformance: tagged structure tree (`StructTreeRoot` / `ParentTree`), `MarkInfo /Marked true`, document language (`/Lang`), `DisplayDocTitle true`, `ActualText` for ligatures and special glyphs, figure alt-text tagging, and heading-level clamping to prevent skipped levels; PDF/UA-2 targets PDF 2.0
126
127
128
+
### PDF Import
129
+
- Import pages from existing PDFs as **Form XObjects** and place them on any destination page
130
+
- Import a single page at a user-defined position and scale (`importPage` / `useImportedPage`)
131
+
- Append full documents page-by-page, auto-sized to the source page dimensions (`addPageFromImport`)
132
+
- Load source PDFs from a file path or raw byte string (`setImportSourceFile` / `setImportSourceData`)
133
+
127
134
### Other
128
135
-**1D and 2D barcodes** via [`tc-lib-barcode`](https://github.com/tecnickcom/tc-lib-barcode)
129
136
- Interactive AcroForm fields (buttons, checkboxes, radio buttons, text, combo boxes, list boxes)
@@ -277,6 +284,78 @@ If the minimal example fails on first run, verify these two points first:
277
284
278
285
---
279
286
287
+
## PDF Import
288
+
289
+
`tc-lib-pdf` can import pages from existing PDFs as Form XObjects and place them on destination pages.
Unlike FPDI numeric template IDs, `tc-lib-pdf` returns typed `PageTemplate` objects and keeps import behavior inside the same library stack (`tc-lib-*`) without external importer dependencies.
347
+
348
+
### Import limitations and fidelity notes
349
+
350
+
- Form and annotation semantics are not merged into editable destination structures; pages are imported as Form XObjects.
351
+
- Digital signatures in source files are not preserved as valid signatures in the destination output.
352
+
- Encrypted source PDFs are currently not importable with the bundled parser backend. Password-like options are accepted by the import API, but encrypted inputs fail with an explicit actionable exception.
353
+
- For multi-stream page contents, import normalizes by decoding and concatenating stream bytes; this can change low-level byte representation while preserving rendered appearance in typical cases.
354
+
- Transparency-group behavior is conformance-aware: when transparency is disallowed by the active PDF mode (for example PDF/X-1a or PDF/X-3), import suppresses transparency groups to remain compliant.
355
+
- Setting `groupXObject` to `false` can reduce output size, but may change compositing on source pages that rely on transparency blending.
356
+
357
+
---
358
+
280
359
## Remote Resources and `fileOptions`
281
360
282
361
By default `tc-lib-pdf`**does not fetch any remote URLs**. Images, fonts, and SVG files referenced by HTTP or HTTPS are blocked unless you explicitly allow the originating hosts. Local file paths are never restricted.
0 commit comments