{"id":23338398,"url":"https://github.com/abhirockzz/fn-text2pdf","last_synced_at":"2025-04-07T13:43:51.055Z","repository":{"id":79125030,"uuid":"163973065","full_name":"abhirockzz/fn-text2pdf","owner":"abhirockzz","description":"A Go function which converts a text file to PDF using the gofpdf library","archived":false,"fork":false,"pushed_at":"2019-01-10T05:05:07.000Z","size":10,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T16:33:00.094Z","etag":null,"topics":["faas","fnproject","go","golang","oracle-cloud-infrastructure","oracle-functions","orafunc-la","serverless"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhirockzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-03T12:55:41.000Z","updated_at":"2019-01-10T05:05:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2b4503f-3496-425d-a1ec-85837b800a43","html_url":"https://github.com/abhirockzz/fn-text2pdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-text2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-text2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-text2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-text2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhirockzz","download_url":"https://codeload.github.com/abhirockzz/fn-text2pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666003,"owners_count":20975785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faas","fnproject","go","golang","oracle-cloud-infrastructure","oracle-functions","orafunc-la","serverless"],"created_at":"2024-12-21T03:13:48.851Z","updated_at":"2025-04-07T13:43:51.024Z","avatar_url":"https://github.com/abhirockzz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Function for converting text to PDF\n\nThis Function converts a text file to PDF. It reads a text (`.txt`) file from a Oracle Cloud Infrastructure Object Storage Bucket, converts it into PDF and stores the converted file in the same bucket (with a `.pdf` extension)\n\n- It's written in Go and uses [gofpdf](https://github.com/jung-kurt/gofpdf) for text to PDF conversion \n- Uses the [OCI Go SDK](https://github.com/oracle/oci-go-sdk) to execute Object Storage read and write operations\n- A custom Dockerfile is used to build the function\n\n## Pre-requisites\n\n- Start by cloning this repository\n- [Create Oracle Cloud Infrastructure Object Storage bucket](https://docs.cloud.oracle.com/iaas/Content/Object/Tasks/managingbuckets.htm#usingconsole)\n- Collect the following information for you OCI tenancy (you'll need these in subsequent steps) - Tenancy OCID, User OCID of a user in the tenancy, OCI private key, OCI public key passphrase, OCI region, Object Storage namespace and name of the bucket you just created\n- Copy your OCI private key to folder. If you don't already have one, [please follow the documentation](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#How)\n\n\n### Switch to correct context\n\n- `fn use context \u003cyour context name\u003e`\n- Check using `fn ls apps`\n\n## Create application\n\n`fn create app text2pdf --annotation oracle.com/oci/subnetIds=\u003cSUBNETS\u003e --config TENANT_OCID=\u003cTENANT_OCID\u003e --config USER_OCID=\u003cUSER_OCID\u003e --config FINGERPRINT=\u003cFINGERPRINT\u003e --config PASSPHRASE=\u003cPASSPHRASE\u003e --config REGION=\u003cREGION\u003e --config PRIVATE_KEY_NAME=\u003cPRIVATE_KEY_NAME\u003e --config NAMESPACE=\u003cNAMESPACE\u003e --config BUCKET_NAME=\u003cBUCKET_NAME\u003e`\n\ne.g.\n\n`fn create app text2pdf --annotation oracle.com/oci/subnetIds='[\"ocid1.subnet.oc1.phx.aaaaaaaaghmsma7mpqhqdhbgnby25u2zo4wqlrrcskvu7jg56dryxt3hgvkz\"]' --config TENANT_OCID=ocid1.tenancy.oc1..aaaaaaaaydrjm77otncda2xn7qtv7l3hqnd3zxn2u6siwdhniibwfv4wwhta --config USER_OCID=ocid1.user.oc1..aaaaaaaa4seqx6jeyma46ldy4cbuv35q4l26scz5p4rkz3rauuoioo26qwmq --config FINGERPRINT=41:82:5f:44:ca:a1:2e:58:d2:63:6a:af:52:d5:3d:04 --config PASSPHRASE=1987 --config REGION=us-phoenix-1 --config PRIVATE_KEY_NAME=oci_private_key.pem --config NAMESPACE=oracle-functions --config BUCKET_NAME=test-bucket`\n\n### Check\n\n`fn inspect app text2pdf`\n\n## Deploy the application\n\n- `cd fn-text2pdf` \n- `fn -v deploy --app text2pdf --build-arg PRIVATE_KEY_NAME=\u003cprivate_key_name\u003e` e.g. `fn -v deploy --app text2pdf --build-arg PRIVATE_KEY_NAME=oci_private_key.pem`\n\n## Test\n\nA sample text file (`lorem.txt`) has been provided to test the function\n\n- Upload file to your object storage bucket,\n- and then test using `echo -n 'lorem.txt' | fn invoke text2pdf convert`\n\nIf successful, you should see the following output - `PDF lorem.pdf written to storage bucket - test-bucket`. Now, you can download the PDF (`lorem.pdf`) from your Object Storage bucket\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Ffn-text2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhirockzz%2Ffn-text2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Ffn-text2pdf/lists"}