Merge PDFs (page model)
Concatenates pages in documents-array order without filename sorting or de-duplicating repeated files; emits a 5-page plan and thumbnail order for the "2 pages + 3 pages = 5 pages" acceptance case.
Inputs and parameters
documents— Document page-model array (JSON, at least 2)
Real example
documents=[{"id":"A","pages":[{"id":"A1","width":595,"height":842},{"id":"A2","width":842,"height":595}]},{"id":"B","pages":[{"id":"B1","width":595,"height":842},{"id":"B2","width":842,"height":595},{"id":"B3","width":595,"height":842}]}]
→ plan.pageCount=5, plan.pageIds=["A1","A2","B1","B2","B3"], identical thumbnailOrder; engine=page-model/no-pdf-engine, output is a JSON plan, not a PDF file.
Limits and failure handling
At least 2 documents; default total budget 50 MiB / 200 pages; no real PDF binary parsing, no encrypted/password-protected, corrupt or empty files; no PDF file output; repeated files are never de-duplicated.
FAQ
Will the same file twice be dropped?
No. A+A gives 4 pages, duplicateSourceIds is ["A"], and the order stays A1,A2,A1,A2.
Does it produce an openable PDF?
Not this round. The real PDF engine is not integrated/tested; the result is a JSON plan with a .json filename.