All Projects → revolunet → Pypdftk

revolunet / Pypdftk

Licence: other
Python module to drive the awesome pdftk binary.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Pypdftk

Pdfforms
Populate fillable pdf forms from csv data file
Stars: ✭ 33 (-69.16%)
Mutual labels:  pdf, forms
I7j Pdfhtml
pdfHTML is an iText 7 add-on for Java that allows you to easily convert HTML and CSS into standards compliant PDFs that are accessible, searchable and usable for indexing.
Stars: ✭ 104 (-2.8%)
Mutual labels:  pdf, forms
Atom Pdf View
Support for viewing PDF files in Atom.
Stars: ✭ 99 (-7.48%)
Mutual labels:  pdf
Pdfviewpager
Android widget that can render PDF documents stored on SD card, linked as assets, or downloaded from a remote URL.
Stars: ✭ 1,508 (+1309.35%)
Mutual labels:  pdf
Input Value
React hook for creating input values
Stars: ✭ 104 (-2.8%)
Mutual labels:  forms
Uniforms
A React library for building forms from any schema.
Stars: ✭ 1,368 (+1178.5%)
Mutual labels:  forms
Nostyle
Design System
Stars: ✭ 101 (-5.61%)
Mutual labels:  forms
Form
Form is an iOS Swift library for building and styling UIs
Stars: ✭ 99 (-7.48%)
Mutual labels:  forms
Invoice As A Service
💰 Simple invoicing service (REST API): from JSON to PDF
Stars: ✭ 106 (-0.93%)
Mutual labels:  pdf
Fbpdf
A small framebuffer pdf, djvu, epub, xps, and cbz viewer
Stars: ✭ 103 (-3.74%)
Mutual labels:  pdf
Dirty Check Forms
🐬Detect Unsaved Changes in Angular Forms
Stars: ✭ 105 (-1.87%)
Mutual labels:  forms
Rsfloatinputview
A Float Input View with smooth animation and supporting icon and seperator written with Swift
Stars: ✭ 103 (-3.74%)
Mutual labels:  forms
Pdflayouttextstripper
Converts a pdf file into a text file while keeping the layout of the original pdf. Useful to extract the content from a table in a pdf file for instance. This is a subclass of PDFTextStripper class (from the Apache PDFBox library).
Stars: ✭ 1,369 (+1179.44%)
Mutual labels:  pdf
Htmldoc
HTML Conversion Software
Stars: ✭ 99 (-7.48%)
Mutual labels:  pdf
Jafar
🌟!(Just another form application renderer)
Stars: ✭ 107 (+0%)
Mutual labels:  forms
Mit Deep Learning Book Pdf
MIT Deep Learning Book in PDF format (complete and parts) by Ian Goodfellow, Yoshua Bengio and Aaron Courville
Stars: ✭ 9,859 (+9114.02%)
Mutual labels:  pdf
Play2 Html5tags
HTML5 form tags module for Play Framework
Stars: ✭ 101 (-5.61%)
Mutual labels:  forms
Xamarincontrols
Cross-platform controls for Xamarin and Xamarin.Forms.
Stars: ✭ 104 (-2.8%)
Mutual labels:  forms
Pdfscribe
A PDF virtual printer for 64-bit Windows 7 / 2008R2 or later.
Stars: ✭ 106 (-0.93%)
Mutual labels:  pdf
Pdf
Simple http microservice that converts Word documents to PDF
Stars: ✭ 107 (+0%)
Mutual labels:  pdf

pypdftk circleci travis

Python module to drive the awesome pdftk binary.

Proudly brought to you by the revolunet team and awesome contributors

Features

fill_form

Fill a PDF with given data and returns the output PDF path

  • pdf_path : input PDF
  • datas : dictionnary of fielf names / values
  • out_file (default=auto) : output PDF path. will use tempfile if not provided
  • flatten (default=True) : flatten the final PDF

concat

Merge multiple PDFs into one single file and returns the output PDF path

  • files : list of PDF files to concatenate
  • out_file (default=auto) : output PDF path. will use tempfile if not provided

split

Split a single PDF in many pages and return a list of pages paths

  • pdf_path : input PDF
  • out_dir (default=auto) : output PDFs dir. will use tempfile if not provided

warning if you give a out_dir parameter, ensure its empty, or the split function may destroy your files and return incorrect results.

gen_xfdf

Generate a XFDF file suited for filling PDF forms and return the generated XFDF file path

  • datas : dictionnary of datas

get_num_pages

Return the number of pages for a given PDF

  • pdf_path : input PDF file

replace_page

Replace a page in a PDF (pdf_path) by the PDF pointed by pdf_to_insert_path.

  • pdf_path is the PDF that will have its page replaced.
  • page_number is the number of the page in pdf_path to be replaced. It is 1-based.
  • pdf_to_insert_path is the PDF that will be inserted at the old page.

stamp

Applies a stamp (from stamp_pdf_path) to the PDF file in pdf_path. If no output_pdf_path is provided, it returns a temporary file with the result PDF.

[compress | uncompress]

These are only useful when you want to edit PDF code in a text
editor like vim or emacs.  Remove PDF page stream compression by
applying the uncompress filter. Use the compress filter to
restore compression.
  • pdf_path : input PDF file
  • out_file (default=auto) : output PDF path. will use tempfile if not provided
  • flatten (default=True) : flatten the final PDF

dump_data_fields

Read PDF and output form field statistics.

  • pdf_path : input PDF file

Example

Fill a PDF model and add a cover page :

import pypdftk

datas = {
    'firstname': 'Julien',
    'company': 'revolunet',
    'price': 42
}
generated_pdf = pypdftk.fill_form('/path/to/model.pdf', datas)
out_pdf = pypdftk.concat(['/path/to/cover.pdf', generated_pdf])

pdftk path

By default, path is /usr/bin/pdftk, but you can override it with the PDFTK_PATH environment variable

Licence

This module is released under the permissive MIT license. Your contributions are always welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].