-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add example with attachment (#26)
- Loading branch information
1 parent
d87c33e
commit 964fb47
Showing
8 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.11 | ||
# To update, run: | ||
# This file is autogenerated by pip-compile with Python 3.11 | ||
# by the following command: | ||
# | ||
# pip-compile .github/workflows/ci.in | ||
# | ||
pydantic==1.10.4 | ||
# via -r .github/workflows/ci.in | ||
pypdf==3.3.0 | ||
annotated-types==0.6.0 | ||
# via pydantic | ||
pydantic==2.5.0 | ||
# via -r .github/workflows/ci.in | ||
typing-extensions==4.4.0 | ||
pydantic-core==2.14.1 | ||
# via pydantic | ||
pypdf==3.17.0 | ||
# via -r .github/workflows/ci.in | ||
typing-extensions==4.8.0 | ||
# via | ||
# pydantic | ||
# pydantic-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from pypdf import PdfReader, PdfWriter | ||
|
||
reader = PdfReader("../001-trivial/minimal-document.pdf") | ||
writer = PdfWriter() | ||
writer.append_pages_from_reader(reader) | ||
|
||
with open("image.png", "rb") as file: | ||
writer.add_attachment("image.png", file.read()) | ||
with open("with-attachment.pdf", "wb") as file: | ||
writer.write(file) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
maint: | ||
pip-compile .github/workflows/ci.in --upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters