minipdf is a package for creating simple, single-page PDF documents.

Overview

minipdf

R-CMD-check

minipdf is a package for creating simple, single-page PDF documents.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("coolbutuseless/minipdf")

See the online documentation here (thanks to pkgdown)

Hello-world.pdf

doc <- PDFDocument$new(width = 200, height = 60, fontname = 'Helvetica-Bold')
doc$rect(0, 0, 200, 60, fill = '#123456', stroke = NULL)
doc$text("Hello World!", x = 10, y = 15, fontsize = 20, fill = 'white')
doc$line(0, 10, 200, 10, stroke = 'grey80')
doc$save("man/figures/helloworld.pdf")

Creating geometric patterns

By copying and modifying/transforming a basic shape (e.g. a diamond) complex patterns can be built.

xs <- c(0, 75, 150, 75, 0)
ys <- c(0, -50, 0, 50, 0)
diamond <- PDFPolygon$new(xs = xs, ys = ys, stroke = NULL)
d1a <- diamond$copy()$fill('darkred')$translate(  0,  50)
d1b <- diamond$copy()$fill('#123456')$translate(150,  50)
d1c <- diamond$copy()$fill('darkred')$translate(300,  50)
d2a <- diamond$copy()$fill('#123456')$translate(  0, 150)
d2b <- diamond$copy()$fill('darkred')$translate(150, 150)
d2c <- diamond$copy()$fill('#123456')$translate(300, 150)
d3  <- diamond$copy()$fill('#12345630')$
  stroke('white')$
  linewidth(2)$
  translate(75, 100)$scale(2)
doc <- pdf_doc(width = 450, height = 200, d1a, d1b, d1c, d2a, d2b, d2c, d3)
doc$save("man/figures/diamonds.pdf")

Supported features

  • Documents with a single page only
  • Only one font per document (set during initialization)
  • Objects: Text, lines, polylines, polygons, rectangles and circles
  • Attributes: Fill colour (including alpha), stroke colour (including alpha), linewidth, linetype
  • Clipping regions - per object clipping region as well as the global document clipping region.

Currently there is no support for annotations or any sort of text layout.

News

  • minipdf v0.2.1 and minidf v0.2.2
    • transforms are now methods on the PDF stream objects
    • renamed methods on the PDFDcoument e.g. add_rect() is now just rect()
    • internal refactoring of attribute handling.

Gallery

References

A bulk pdf generator. This application can generate PDFs in bulk by using just one click.

A bulk html pdf generator. This application can generate PDFs in bulk by using just one click. Screenshots Requirements 🧱 Your system must have the f

Aman Nirala 3 Apr 23, 2022
Scans pdfs for links written in plaintext and checks if they are active or returns an error code.

Scans pdfs for links written in plaintext and checks if they are active or returns an error code. It then generates a report of its findings. Extract references (pdf, url, doi, arxiv) and metadata fr

Marshal Miller 22 Nov 21, 2022
A tool for certificate PDF generation.

certificate-pdf-generator 获奖证书PDF批量生成工具 | a Tool for certificate PDF generation. ⚠️ 下载前请注意 本项目使用了LFS来存储PDF等大文件。在克隆或下载本仓库前,请先使用apt等包管理器安装git-lfs包。如果已经克

Wanghao Xu 4 Nov 28, 2022
CLI tool to generate pdf invoices written in python

invoicepy CLI invoice tool, store and print invoices as pdf. save companies and customers for later use. installation pip install invoicepy config co

Adam Wojtczak 9 Aug 01, 2022
pikepdf is a Python library for reading and writing PDF files.

A Python library for reading and writing PDF, powered by qpdf

1.6k Jan 03, 2023
A python library for extracting text from PDFs without losing the formatting of the PDF content.

Multilingual PDF to Text Install Package from Pypi Install it using pip. pip install multilingual-pdf2text The library uses Tesseract which can be ins

Shahrukh Khan 49 Nov 07, 2022
Telegram bot that can do a lot of things related to PDF files.

Telegram PDF Bot A Telegram bot that can: Compress, crop, decrypt, encrypt, merge, preview, rename, rotate, scale and split PDF files Compare text dif

130 Dec 26, 2022
PDFSanitizer - Renders possibly unsafe PDF files and outputs harmless PDF files

PDFSanitizer Renders possibly malicious PDF files and outputs harmless PDF files

9 Jan 30, 2022
A backend for mdbook in Python for generating PDF based on Chrome DevTools Protocol.

mdbook-pdf A backend for mdbook written in Python for generating PDF based on Chrome DevTools Protocol. Python library dependency Usage Put mdbook-pdf

Hollow Man 49 Dec 27, 2022
Simple HTML and PDF document generator for Python - with built-in support for popular data analysis and plotting libraries.

Esparto is a simple HTML and PDF document generator for Python. Its primary use is for generating shareable single page reports with content from popular analytics and data science libraries.

Dom 76 Dec 12, 2022
A Python tool to generate a static HTML file that represents the internal structure of a PDF file

PDFSyntax A Python tool to generate a static HTML file that represents the internal structure of a PDF file At some point the low-level functions deve

Martin D. 394 Dec 30, 2022
pdf_sprinkles: sprinkles text in your PDFs

pdf_sprinkles: sprinkles text in your PDFs pdf_sprinkles remotely OCRs a PDF with Google Cloud Document AI, and returns the result as a PDF with searc

Will Angley 2 Dec 17, 2021
Python bindings for MuPDF's rendering library.

PyMuPDF 1.19.3 Release date: December 15, 2021 On PyPI since August 2016: Author Jorj X. McKie, based on original code by Ruikai Liu. Introduction PyM

Jorj X. McKie 0 Nov 03, 2022
A simple Python script to convert multiple images (well technically also a single image) into a pdf.

PythonImage2PDF A simple Python script to convert multiple images into a single PDF-document. Created basically for only my own needs for converting m

Joona Gynther 1 Jun 28, 2022
PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files.

PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files. It can also add custom data, viewing options, and passwords to PDF files

Matthew Stamy 5k Jan 04, 2023
Convert given source code into .pdf with syntax highlighting and more features

Code2pdf 📠 Convert given source code into .pdf with syntax highlighting and more features Build Status Version Downloads Python Demo Installation Bui

Tushar Gautam 343 Jan 05, 2023
Python PDF Parser (Not actively maintained). Check out pdfminer.six.

PDFMiner PDFMiner is a text extraction tool for PDF documents. Warning: As of 2020, PDFMiner is not actively maintained. The code still works, but thi

Yusuke Shinyama 4.9k Jan 04, 2023
Extract the table in the PDF,outputs the data similar to the json format

extract the table in the PDF,outputs the data similar to the json format

3 Nov 25, 2021
Merge multiple PDF files into one.

PDF Merger Merge multiple PDF files into one. Usage % python pdf_merger.py -h usage: pdf_merger.py [-h] [-o OUTPUT] [-f [FILES ...]] optional argumen

Duo Apps 6 Oct 03, 2022
x-ray is a Python library for finding bad redactions in PDF documents.

A tool to detect whether a PDF has a bad redaction

Free Law Project 73 Dec 19, 2022