summaryrefslogtreecommitdiff
path: root/python-pypdfform.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-pypdfform.spec')
-rw-r--r--python-pypdfform.spec306
1 files changed, 306 insertions, 0 deletions
diff --git a/python-pypdfform.spec b/python-pypdfform.spec
new file mode 100644
index 0000000..0094b9c
--- /dev/null
+++ b/python-pypdfform.spec
@@ -0,0 +1,306 @@
+%global _empty_manifest_terminate_build 0
+Name: python-PyPDFForm
+Version: 1.2.8
+Release: 1
+Summary: The Python library for PDF forms.
+License: MIT License
+URL: https://github.com/chinapandaman/PyPDFForm
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/8a/83/a40a40c423f1dbf6dac7af6e6f2e3c8b6778a4e289a7a8f7a35c009b42be/PyPDFForm-1.2.8.tar.gz
+BuildArch: noarch
+
+Requires: python3-pdfrw
+Requires: python3-pillow
+Requires: python3-reportlab
+
+%description
+<p align="center"><img src="https://github.com/chinapandaman/PyPDFForm/raw/master/logo.png"></p>
+<p align="center">
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-black-isort.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-black-isort.yml/badge.svg"></a>
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-package.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-package.yml/badge.svg"></a>
+ <a href="https://codecov.io/gh/chinapandaman/PyPDFForm"><img src="https://codecov.io/gh/chinapandaman/PyPDFForm/branch/master/graph/badge.svg?token=CSRLN14IFE"></a>
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-publish.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-publish.yml/badge.svg"></a>
+ <a href="https://pepy.tech/project/pypdfform"><img src="https://static.pepy.tech/personalized-badge/pypdfform?period=total&units=international_system&left_color=black&right_color=magenta&left_text=Downloads"></a>
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-orange.svg"></a>
+</p>
+
+## Introduction
+
+PyPDFForm is a pure Python library for PDF form processing.
+It allows filling a PDF form programmatically by creating
+a Python dictionary with keys matching its annotated names
+for elements like text fields and checkboxes. It also supports other functionalities such as
+drawing image and merging multiple PDFs together.
+
+## Installing
+
+Install using [pip](https://pip.pypa.io/en/stable/):
+
+```shell script
+pip install PyPDFForm
+```
+
+## Quick Example
+![Check out the GitHub repository for a live demo if you can't see it here.](https://github.com/chinapandaman/PyPDFForm/raw/master/demo.gif)
+
+A sample PDF form can be found [here](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/sample_template.pdf). Download it and try:
+
+```python
+import os
+
+from PyPDFForm import PyPDFForm
+
+PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join(
+ os.path.expanduser("~/Downloads"), "sample_template.pdf"
+) # Change this to where you downloaded the sample PDF form
+
+PATH_TO_FILLED_PDF_FORM = os.path.join(
+ os.path.expanduser("~"), "output.pdf"
+) # Change this to where you wish to put your filled PDF form
+
+with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output:
+ output.write(
+ PyPDFForm(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM)
+ .fill(
+ {
+ "test": "test_1",
+ "check": True,
+ "test_2": "test_2",
+ "check_2": False,
+ "test_3": "test_3",
+ "check_3": True,
+ },
+ )
+ .read()
+ )
+```
+
+After running the above code snippet you can find `output.pdf` at the location you specified,
+and it should look like [this](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/sample_filled.pdf).
+
+## Documentation
+
+[Examples](https://github.com/chinapandaman/PyPDFForm/blob/master/docs/examples.md)
+
+## How to Contribute
+
+If you wish to improve this library, there is one specific way you can contribute
+on top of the usual open source project norms such as issues and pull requests.
+
+It is difficult to make sure that the library supports all the PDF form creating tools out
+there. So if you run into a case where the library does not work for certain PDF forms created by
+certain tools, feel free to open an issue with the problematic PDF form attached. I will seek
+to make the library support the attached PDF form as well as the tool used to create it.
+
+
+%package -n python3-PyPDFForm
+Summary: The Python library for PDF forms.
+Provides: python-PyPDFForm
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-PyPDFForm
+<p align="center"><img src="https://github.com/chinapandaman/PyPDFForm/raw/master/logo.png"></p>
+<p align="center">
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-black-isort.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-black-isort.yml/badge.svg"></a>
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-package.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-package.yml/badge.svg"></a>
+ <a href="https://codecov.io/gh/chinapandaman/PyPDFForm"><img src="https://codecov.io/gh/chinapandaman/PyPDFForm/branch/master/graph/badge.svg?token=CSRLN14IFE"></a>
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-publish.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-publish.yml/badge.svg"></a>
+ <a href="https://pepy.tech/project/pypdfform"><img src="https://static.pepy.tech/personalized-badge/pypdfform?period=total&units=international_system&left_color=black&right_color=magenta&left_text=Downloads"></a>
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-orange.svg"></a>
+</p>
+
+## Introduction
+
+PyPDFForm is a pure Python library for PDF form processing.
+It allows filling a PDF form programmatically by creating
+a Python dictionary with keys matching its annotated names
+for elements like text fields and checkboxes. It also supports other functionalities such as
+drawing image and merging multiple PDFs together.
+
+## Installing
+
+Install using [pip](https://pip.pypa.io/en/stable/):
+
+```shell script
+pip install PyPDFForm
+```
+
+## Quick Example
+![Check out the GitHub repository for a live demo if you can't see it here.](https://github.com/chinapandaman/PyPDFForm/raw/master/demo.gif)
+
+A sample PDF form can be found [here](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/sample_template.pdf). Download it and try:
+
+```python
+import os
+
+from PyPDFForm import PyPDFForm
+
+PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join(
+ os.path.expanduser("~/Downloads"), "sample_template.pdf"
+) # Change this to where you downloaded the sample PDF form
+
+PATH_TO_FILLED_PDF_FORM = os.path.join(
+ os.path.expanduser("~"), "output.pdf"
+) # Change this to where you wish to put your filled PDF form
+
+with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output:
+ output.write(
+ PyPDFForm(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM)
+ .fill(
+ {
+ "test": "test_1",
+ "check": True,
+ "test_2": "test_2",
+ "check_2": False,
+ "test_3": "test_3",
+ "check_3": True,
+ },
+ )
+ .read()
+ )
+```
+
+After running the above code snippet you can find `output.pdf` at the location you specified,
+and it should look like [this](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/sample_filled.pdf).
+
+## Documentation
+
+[Examples](https://github.com/chinapandaman/PyPDFForm/blob/master/docs/examples.md)
+
+## How to Contribute
+
+If you wish to improve this library, there is one specific way you can contribute
+on top of the usual open source project norms such as issues and pull requests.
+
+It is difficult to make sure that the library supports all the PDF form creating tools out
+there. So if you run into a case where the library does not work for certain PDF forms created by
+certain tools, feel free to open an issue with the problematic PDF form attached. I will seek
+to make the library support the attached PDF form as well as the tool used to create it.
+
+
+%package help
+Summary: Development documents and examples for PyPDFForm
+Provides: python3-PyPDFForm-doc
+%description help
+<p align="center"><img src="https://github.com/chinapandaman/PyPDFForm/raw/master/logo.png"></p>
+<p align="center">
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-black-isort.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-black-isort.yml/badge.svg"></a>
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-package.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-package.yml/badge.svg"></a>
+ <a href="https://codecov.io/gh/chinapandaman/PyPDFForm"><img src="https://codecov.io/gh/chinapandaman/PyPDFForm/branch/master/graph/badge.svg?token=CSRLN14IFE"></a>
+ <a href="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-publish.yml/badge.svg"><img src="https://github.com/chinapandaman/PyPDFForm/actions/workflows/python-publish.yml/badge.svg"></a>
+ <a href="https://pepy.tech/project/pypdfform"><img src="https://static.pepy.tech/personalized-badge/pypdfform?period=total&units=international_system&left_color=black&right_color=magenta&left_text=Downloads"></a>
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-orange.svg"></a>
+</p>
+
+## Introduction
+
+PyPDFForm is a pure Python library for PDF form processing.
+It allows filling a PDF form programmatically by creating
+a Python dictionary with keys matching its annotated names
+for elements like text fields and checkboxes. It also supports other functionalities such as
+drawing image and merging multiple PDFs together.
+
+## Installing
+
+Install using [pip](https://pip.pypa.io/en/stable/):
+
+```shell script
+pip install PyPDFForm
+```
+
+## Quick Example
+![Check out the GitHub repository for a live demo if you can't see it here.](https://github.com/chinapandaman/PyPDFForm/raw/master/demo.gif)
+
+A sample PDF form can be found [here](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/sample_template.pdf). Download it and try:
+
+```python
+import os
+
+from PyPDFForm import PyPDFForm
+
+PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join(
+ os.path.expanduser("~/Downloads"), "sample_template.pdf"
+) # Change this to where you downloaded the sample PDF form
+
+PATH_TO_FILLED_PDF_FORM = os.path.join(
+ os.path.expanduser("~"), "output.pdf"
+) # Change this to where you wish to put your filled PDF form
+
+with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output:
+ output.write(
+ PyPDFForm(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM)
+ .fill(
+ {
+ "test": "test_1",
+ "check": True,
+ "test_2": "test_2",
+ "check_2": False,
+ "test_3": "test_3",
+ "check_3": True,
+ },
+ )
+ .read()
+ )
+```
+
+After running the above code snippet you can find `output.pdf` at the location you specified,
+and it should look like [this](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/sample_filled.pdf).
+
+## Documentation
+
+[Examples](https://github.com/chinapandaman/PyPDFForm/blob/master/docs/examples.md)
+
+## How to Contribute
+
+If you wish to improve this library, there is one specific way you can contribute
+on top of the usual open source project norms such as issues and pull requests.
+
+It is difficult to make sure that the library supports all the PDF form creating tools out
+there. So if you run into a case where the library does not work for certain PDF forms created by
+certain tools, feel free to open an issue with the problematic PDF form attached. I will seek
+to make the library support the attached PDF form as well as the tool used to create it.
+
+
+%prep
+%autosetup -n PyPDFForm-1.2.8
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-PyPDFForm -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.8-1
+- Package Spec generated