Opens Portable Document Format (PDF) files and reads their metadata, pages, objects, streams, fonts, images and text in reading order; copies pages between files to split, merge, rotate and reorder th
翻译准备中
开发工具R · CGitHub @pedrobtz在线运营者未确认
试用过了吗? 点一下就好,无需登录。
尚未检测到更新。GitHub 发布版本后会显示在这里。
Opens Portable Document Format (PDF) files and reads their metadata, pages, objects, streams, fonts, images and text in reading order; copies pages between files to split, merge, rotate and reorder them, and sets metadata, permissions and encryption; and writes new PDF files from R with text, paths and images. Uses a bundled copy of the pdfio library (<https://github.com/michaelrsweet/pdfio>), so no system library beyond zlib is required. Untrusted input is bounded by limits on size, object coun
翻译准备中
正在加载完整 README。
查看完整 README ↗zupdf reads, assembles and writes PDF files from R. It opens a file and reads its metadata, pages, objects, streams, fonts, images and text; copies pages between files to split, merge, rotate and reorder them; and writes new files with text, paths and images. It bundles the pdfio C library, so it needs no system library beyond zlib. It never renders a page to pixels: for that, use pdftools.
Install zupdf from CRAN:
install.packages("zupdf")
Or the development version from GitHub:
# install.packages("pak")
pak::pak("pedrobtz/zupdf")
library(zupdf)
pdf <- pdf_open("report.pdf") # a path, raw vector or connection
pdf_meta(pdf)$pages
pdf_page_text(pdf, pages = 1)
pdf_font_table(pdf)
pdf_close(pdf)
Untrusted files are bounded by limits on size, objects, stream size and nesting depth, and every error is a classed condition.
w <- pdf_new(media_box = pdf_paper("a4"))
page <- pdf_page_new(w)
pdf_draw_text(page, 72, 760, "A heading", font = "Helvetica-Bold", size = 18)
pdf_draw(page, data.frame(op = "rect", x = 72, y = 600, w = 200, h = 100), fill = "steelblue")
pdf_page_end(page)
pdf_save(w, "out.pdf")
zupdf provides the pdftools and qpdf functions that need no renderer, under
their names and with their arguments: pdf_info(), pdf_text(),
pdf_data(), pdf_fonts(), pdf_pagesize(), pdf_toc(),
pdf_attachments(), pdf_length(), pdf_split(), pdf_subset(),
pdf_combine() and pdf_rotate_pages(). Code using only these runs with
library(zupdf) in their place. Attached after pdftools or qpdf, zupdf masks
their functions of the same name. See vignette("switching", package = "zupdf")
for where the results differ.