Wraps FPDF_CreateNewDocument. The returned pdfium_doc has
no pages — add some with pdf_page_new() before saving.
Always returned with readwrite = TRUE; there is no read-only
new document.
Details
PDFium fills the new document's /Info dictionary with
/Creator (PDFium) and a /CreationDate holding the current
local wall-clock time. It labels that time with a +00'00' (UTC)
offset whatever the local time zone, so on a machine not running
in UTC, pdf_parse_date() of the creation date is off by the
local UTC offset.
See also
pdf_page_new() to add a page;
pdf_save() to persist the result.
Examples
doc <- pdf_doc_new()
pdf_page_new(doc, 1, 612, 792)
#> <pdfium_page [open] page 1 of <new>>
tmp <- tempfile(fileext = ".pdf")
pdf_save(doc, tmp)
pdf_doc_close(doc)