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
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
PyMuPDF is a Python binding with support for MuPDF

PyMuPDF is a Python binding with support for MuPDF (current version 1.18.*), a lightweight PDF, XPS, and E-book viewer, renderer, and toolkit, which is maintained and developed by Artifex Software, I

PyMuPDF 1.9k Jan 03, 2023
Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python.

About Zen-Knit: Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python. Inspired fro

Zen Reportz 27 Jul 13, 2022
Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza.

tratapdf Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza. dependências icc-profiles ghostscript visualizador de PDF

1 Nov 30, 2021
Busca no nome e conteúdo de arquivos PDF no diretório e subdiretórios.

PDF Finder Este script auxilia na pesquisa em pastas com inúmeros arquivos PDF. A pesquisa é feita em todos os arquivos do doretório e subdiretórios.

William Pilger 1 Nov 27, 2021
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
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
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
Python lib for Simple PDF text extraction

Python lib for Simple PDF text extraction

Jason Alan Palmer 651 Jan 01, 2023
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
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
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
Performing the following operations using python on PDF.

Python PDF Handling Tutorial Python is a highly versatile language with a huge set of libraries. It is a high level language with simple syntax. Pytho

Prajwol Lamichhane 131 Dec 16, 2022
WeasyPrint is a smart solution helping web developers to create PDF documents.

WeasyPrint is a smart solution helping web developers to create PDF documents. It turns simple HTML pages into gorgeous statistical reports, invoices, tickets…

Kozea 5.4k Jan 08, 2023
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
Simple pdf editor while preserving structure and format.

SIMPdf Simple pdf editor while preserving structure and format.

Shashwat Singh 242 Jan 04, 2023
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
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
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