The ML Platform Behind Uber's AI
Michelangelo AI: Uber's end-to-end machine learning platform.
Translation pending
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
Translation pending
Developer toolsR · CGitHub @pedrobtzOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
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
Loading the full README.
Read the full 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.