pdf.write_merge
pdf.write_merge(path, list)
Input: path, list · Output: no output
What it is
Exactly pdf.merge, written to a file instead of returned. path (string) is the destination, overwritten if it exists; list is as above. Denied in sandboxed execution.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
pdf.write_merge(path, list) | path stringpath (string) is the destination, overwritten if it exists.list —list is as above. | no output | Exactly pdf.merge, written to a file instead of returned. Denied in sandboxed execution. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
import pdf
# Only `subject` changes; title/author/producer/... are untouched.
tagged = pdf.set_metadata("paper.pdf", subject = "Impedance spectroscopy")
pdf.write_merge("tagged.pdf", [tagged]) # or write it out any other way
hits = pdf.find_text("paper.pdf", "impedance", case_sensitive = false)
for h in hits
print("page {h.page}, offset {h.offset}")
end
d = pdf.text_diff("draft_v1.pdf", "draft_v2.pdf")
print("{length(d.differing_pages)} of {d.pages_b} pages changed")
s = pdf.structural_diff("draft_v1.pdf", "draft_v2.pdf")
if s.pages_a != s.pages_b
print("page count changed: {s.pages_a} -> {s.pages_b}")
end
not run by the build — this one needs something the repository cannot supply · from file-io