Code Monkey home page Code Monkey logo

pypdf2_fields's Introduction

PyPDF2_Fields

Français

La bibliothèque PyPDF2_Fields est un complément à PyPDF2. Elle aide à l’utilisation des champs d’un fichier PDF en facilitant les tâches suivantes.

  • Lire la valeur des champs
  • Modifier la valeur des champs
  • Identifier le type d’un champ
  • Assurer la visibilité du contenu des champs
  • Déterminer si les champs d’un fichier PDF généré par une application seront modifiables

À cette fin, PyPDF2_Fields fournit les fonctions ci-dessous.

  • get_field_type

Identifie le type d’un champ d’un fichier PDF. La valeur renvoyée est un membre de l’énumeration PdfFieldType, aussi incluse dans cette bibliothèque.

  • make_writer_from_reader

Crée un objet PdfFileWriter dont le contenu est identique à celui de l’objet PdfFileReader donné. Selon le choix de l’appelant, les champs du fichier produit par cet écriveur seront modifiables ou non.

  • pair_fields_name_and_val

Constitue un dictionnaire associant le nom des champs à leur valeur.

  • set_need_appearances

Assure qu’un PdfFileWriter produira un fichier dont le contenu des champs sera visible.

  • update_page_fields

Définit la valeur des champs de texte, des boîtes à cocher et des groupes de boutons radio. Cette fonction utilise des instances de la classe RadioBtnGroup, aussi incluse dans cette bibliothèque.

Voyez les exemples d'utilisation demo_field_names_vals.py et demo_update_fields.py dans le dépôt de code source.

English

Library PyPDF2_Fields is a complement to PyPDF2. It helps using a PDF file’s fields by facilitating the following tasks.

  • Reading the fields' value
  • Setting the fields' value
  • Identifying a field’s type
  • Ensuring the visibility of the fields’ content
  • Determining whether the fields of a PDF file generated by an application will be editable

For this purpose, PyPDF2 provides the functions below.

  • get_field_type

Identifies the type of a PDF file's field. The returned value is a member of enumeration PdfFieldType, which is also included in this library.

  • make_writer_from_reader

Creates a PdfFileWriter object whose content is identical to that of the given PdfFileReader object. Depending on the caller’s choice, the fields of the file produced by that writer will be editable or not.

  • pair_fields_name_and_val

Creates a dictionary that maps the fields’ name to their value.

  • set_need_appearances

Ensures that a PdfFileWriter will produce a file with fields whose content will be visible.

  • update_page_fields

Sets the value of text fields, checkboxes and radio button groups. This function uses instances of class RadioBtnGroup, which is also included in this library.

See usage examples demo_field_names_vals.py and demo_update_fields.py in the source code repository.

pypdf2_fields's People

Contributors

grv96 avatar

Watchers

 avatar

pypdf2_fields's Issues

Do you want to extend PyPDF2 directly?

Hello!

I've just found your package - very cool that you approached the problem that PyPDF2 does not deal well with forms / fields!

We have several open issues regarding forms. Being the new maintainer, I want to fix them. But I'm not knowledgeable enough to do it directly. I need the help of skilled people like you :-)

Do you want to write a PR to improve one aspect of forms in PyPDF2? (better do it in several smaller PRs, that makes it easier to review... In case you want/have the time to support at all)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.