A complete rewrite. The package writes Word and PDF paper versions of an XLSForm through a new API, a terminal interface and one document model that both outputs share.
convertxlsform() writes a Word document
(.docx) by default. format = "pdf" or
format = c("docx", "pdf") also writes a PDF. The output
location, format and overwrite rules follow from the arguments, and the
function returns the paths invisibly.doconv package when LibreOffice is
not found. docx_to_pdf() and has_libreoffice()
are exported.cli() runs a conversion from a terminal, for example
Rscript -e 'convertxlsform::cli()' form.xlsx --format pdf.
Scripts can use quit(status = convertxlsform::cli()) to get
the exit status.xlsform_outline() returns the numbered form as a data
frame, for checking a form before conversion.xlsform_languages() lists the languages in a form and
marks the default.label::English (en),
label::en and label::English. The
lang argument accepts a code, a name or the full suffix. A
blank translated cell falls back to the plain column, then to the
default language. Headers with a common language name only, such as
label::French, also match their ISO 639-1 code
(lang = "fr").strings option replaces any of them for
another language.nested_serial_numbers) and blank copies of repeats
(repeat_copies).font_family_cs option
overrides the choice.template, title, and switches for hints,
constraints, relevants, choice codes, variable names and hidden
rows.inst/extdata/multilang (multilingual,
with an external choice list and images) and
inst/extdata/all_types (every question type and feature the
package renders).xlsform_path is now
xlsform, output_docx is now
output, selected_language is now
lang, and number_questions is now
nested_serial_numbers. The 0.2.1 names are not
accepted.cli, flextable,
magrittr, officer, readxl,
rlang and zip, plus base packages
(stats, tools, utils).
optparse is no longer used, and the command line is parsed
by cli().First public release.
survey, choices, and
settings sheets; errors if any are missing or
malformed.label, hint,
and constraint_message via commonmark to
officer::body_add_html.form_title) in 16 pt bold Arial,
centered.*.number_questions = TRUE) for
top‑level, groups, and repeats.Note: … (no numbering).\u25EF).\u2B1B).start,
end, step.choices$image is provided and file exists, embeds
under each bullet (max 1″ height).readxl,
officer, commonmark, flextable,
magick declared in Imports.\uXXXX escapes.@importFrom
for all used functions.testthat scaffold with
basic validation tests.Thank you for using convertxlsform: feedback and issues are welcome on GitHub (https://github.com/masud90/convertxlsform)!