Create and read a PDF report
Create a scientific report with a reusable metadata template, then inspect its page text and source identity.
// Requires Aner 0.0.10 or greater and an installed PDF module.
// All values are synthetic teaching data; this source trains no model.
// Run in a fresh writable directory; experiment-report.pdf must not exist.
import aner.pdf
import aner.data
let template = pdf.template(header: "Aner Research", footer: "Page {page} of {pages}")
let report = pdf.document(title: "Experiment summary", author: "Research team")
pdf.with_template(report, template)
pdf.heading(report, "Model evaluation")
pdf.text(report, "Synthetic teaching values illustrate a validation report. Values are formatted explicitly for reporting.")
pdf.table(report, List("Model", "RMSE", "Samples"),
List(List("Baseline", "0.42", "120"), List("Candidate", "0.31", "120")))
let receipt = pdf.create("experiment-report.pdf", report)
print(pdf.to_json(receipt))
let extracted = pdf.read("experiment-report.pdf")
let pages = pdf.pages(extracted)
print(pages.rows())
print(pdf.extract_text(extracted))
Make it your experiment.
Use Aner 0.0.10 or newer. Save this program as examples/pdf_report.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/pdf_report.aner
aner run examples/pdf_report.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Requires Aner 0.0.10 or greater and an explicitly installed compatible PDF module. Save the download at `examples/pdf_report.aner` beneath a fresh project directory and run from that project root. The example creates a PDF and preserves existing output paths.
aner --version
aner install pdf
aner check examples/pdf_report.anerBundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution