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

An application which enables the users to perform simple yet intriguing PDF operations

AstutePDF A repository containing the GUI for an application which enables the users to perform simple yet intriguing PDF operations. These include, M

Raghav S 5 Jan 22, 2022
Mipdfcompressor - 💕A simple pdf size compressing telegram robot

Pdf Compressor Telegram Bot A simple pdf size compressing telegram robot. Useful for digital documentation. Mandatory Variables API_HASH - Your A

Madhavan Mi 1 Feb 14, 2022
This is PDF Merger Application Developed using Just Python

This is PDF Merger Application Developed using Just Python

Sandeep Kumar Reddy 2 Nov 18, 2021
A bot for PDF for doing Many Things....

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

Mr. Developer 60 Dec 27, 2022
A simple pdf size compressing telegram robot witten in python.

Pdf Compressor Telegram Bot ##About : A simple pdf size compressing telegram robot witten in python. Mostly useful for digital documentation. Deploy t

Renjith Mangal 22 Oct 28, 2022
Table automatically extraction from PDF Document

PDF Table Extractor Table automatically extraction from PDF Document Our Icon 📌 Name : PDF Table Extractor 📌 Authors : Minku Koo Jiyong Park 📌 Deve

1 Jan 10, 2022
Produce pdf in python backend from simple bootstrap vue frontend and download to browser

vollmacht produce pdf in python backend from simple bootstrap vue frontend and download to browser Frontend in one file with bootstrap-vue (allthough

Otto 1 Nov 08, 2020
Camelot is a Python library that can help you extract tables from PDFs!

A Python library to extract tabular data from PDFs

1.8k Jan 03, 2023
Split given PDF document into 4 page groups and convert them to booklet format

PUTO: PDF to Booklet converter Split given PDF document into 4 page groups and convert them to booklet format. It creates a PDF like shown below: Fir

3 Mar 12, 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
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
Convert Lecture Videos to PDF

Convert Lecture Videos to PDF Description Want to go through lecture videos faster without missing any information? Wish you can read the lecture vide

Emilio Kartono 20 Nov 25, 2022
Camelot is a Python library that makes it easy for anyone to extract tables from PDF files

Camelot: PDF Table Extraction for Humans Camelot is a Python library that makes it easy for anyone to extract tables from PDF files! Note: You can als

Atlan Technologies Pvt Ltd 3.3k Jan 06, 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
Simple python tool created for downloading PDF.

PDFdownloader Usage Open PDF in full-screen mode Run scan.exe Enter how many pages you want to scan Focus PDF After scanning is done, run merge.exe En

5 Oct 27, 2021
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
OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched or copy-pasted. ocrmypdf

8k Jan 08, 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
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