-
Notifications
You must be signed in to change notification settings - Fork 17
pdfshift adaptor documentation #698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b334bf7
fix: add pdf generator documentation
hunterachieng aaadb3f
fix: update docs and examples for pdfShift
hunterachieng e594c20
add pdf example
hunterachieng dc775a5
fix pdf examples and docs
hunterachieng 0bca9b1
fix: update pdf docs docs
hunterachieng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,26 @@ | ||
// Generate a PDF document from a HTML string | ||
|
||
fn(state => { | ||
const { data } = state; | ||
|
||
state.pdfHTMLContent = `<html> | ||
<body style="font-family: Arial, sans-serif; font-size: 14px;"> | ||
<h1>Sales Report</h1> | ||
<p>Date: ${data.date}</p> | ||
<p>Total Sales: $${data.totalSales}</p> | ||
</body> | ||
</html>`; | ||
|
||
return state; | ||
}); | ||
|
||
generatePDF($.pdfHTMLContent, { | ||
sandbox: true, | ||
filename: 'trials.pdf', | ||
}); | ||
|
||
fn(state => { | ||
const { data } = state; | ||
console.log(`Download PDF in 48 hours from ${data.url}`); | ||
return { ...state, pdfData: data }; | ||
}); |
This file contains hidden or 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 hidden or 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,41 @@ | ||
--- | ||
title: PDFShift Adaptor | ||
--- | ||
|
||
## About PDFShift | ||
|
||
[PDFShift](https://pdfshift.io/) is a solution designed to automate document | ||
conversion tasks. | ||
|
||
## Integration Options | ||
|
||
PDFShift has a REST API that enables external services like OpenFn to pull data | ||
from PDFShift, or push data from external apps to PDFShift. This option is | ||
suited for scheduled, bulk syncs or workflows that must update data in PDFShift | ||
with external information. See [functions](/adaptors/packages/pdfshift-docs) for | ||
more on how to use this adaptor to work with the API. | ||
|
||
## Authentication | ||
|
||
See [PDFShift docs](https://docs.pdfshift.io/#authentication) for the latest on | ||
supported authentication methods. When integrating with PDFShift via OpenFn, | ||
only one primary authentication method is supported. | ||
|
||
Api Key (requires api key created after authenticating in PDFShift). See this | ||
adaptor's [Configuration docs](/adaptors/packages/pdfshift-configuration-schema) | ||
for the required authentication parameters. | ||
|
||
See platform docs on | ||
[managing credentials](/documentation/manage-projects/manage-credentials) for | ||
how to configure a credential in OpenFn. If working locally or if using a Raw | ||
JSON credential type, then your configuration will look something like this: | ||
|
||
```json | ||
{ | ||
"apiKey": "sk_563874gfvftdv2t28462763fy23d28" | ||
} | ||
``` | ||
|
||
### Helpful Links | ||
|
||
1. [PDFShift Documentation](https://docs.pdfshift.io/#introduction) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.