-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3275bd9
commit 0d165ca
Showing
6 changed files
with
83 additions
and
22 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
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,50 @@ | ||
# Sample code snippets you can refer for easy copy/paste | ||
|
||
from pdfgeneratorapi import PDFGenerator | ||
|
||
pdf_client = PDFGenerator( | ||
api_key="61e5f04ca1794253ed17e6bb986c1702", | ||
api_secret="68db1902ad1bb26d34b3f597488b9b28", | ||
) | ||
pdf_client.set_workspace("demo.example@actualreports.com") | ||
|
||
|
||
# For defaults of document_format, response_format, access and other API defaults, please check the `Default Values` section of Readme | ||
# Generate a new Document | ||
new_pdf = pdf_client.create_document( | ||
template_id=48484, | ||
data={"name": "Sameer Kumar"}, | ||
document_format="pdf", | ||
response_format="url", | ||
) | ||
|
||
# Fetch All Templates | ||
all_templates = pdf_client.all_templates() | ||
print(all_templates) | ||
|
||
# Advanced optional fields => | ||
# Fetch all templates and filter them by a tag | ||
all_templates = pdf_client.all_templates(tags=["test_tag"]) | ||
print(all_templates) | ||
|
||
# Fetch all templates and filter them by a access type | ||
all_templates = pdf_client.all_templates(access=["private"]) | ||
|
||
|
||
# Get template info by ID | ||
template = pdf_client.get_template(template_id=48484) | ||
|
||
# Create a new template | ||
new_template = pdf_client.create_template(name="some new template") | ||
|
||
|
||
# Duplicate an existing template | ||
# `name` is optional. You can create a template copy without specifying the name | ||
copy_template = pdf_client.create_template_copy( | ||
template_id=48484, name="Copied template" | ||
) | ||
|
||
|
||
# Get a one-click link to web editor | ||
# Just forms a url | ||
editor_url = pdf_client.get_editor_url(template_id=48484, data={"name": "Sameer"}) |
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 |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
|
||
""" | ||
pdfgeneratorapi | ||
~~~~~~~ | ||
~~~~~~~~~~~~~~~ | ||
Setup for PDFGeneratorAPI | ||
""" | ||
|
||
|
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,3 +1,3 @@ | ||
PDF_GENERATOR_KEY="6bbfbd37fce6ed418fb1ba2ee38b0be2a89745cab507b53d3befb8e29493234e" | ||
PDF_GENERATOR_SECRET="7af96b0e40ee232a7946c7f45aabe1d13d470cf123d06f25ba1b5f5e5a2b58b7" | ||
PDF_GENERATOR_WORKSPACE="sam@sameerkumar.website" | ||
PDF_GENERATOR_KEY="61e5f04ca1794253ed17e6bb986c1702" | ||
PDF_GENERATOR_SECRET="68db1902ad1bb26d34b3f597488b9b28" | ||
PDF_GENERATOR_WORKSPACE="demo.example@actualreports.com" |