{"id":19535598,"url":"https://github.com/miyako/4d-plugin-pdf-kit","last_synced_at":"2025-09-04T02:39:37.449Z","repository":{"id":4413328,"uuid":"5550922","full_name":"miyako/4d-plugin-pdf-kit","owner":"miyako","description":"Basic PDF manipulation using PDFKit","archived":false,"fork":false,"pushed_at":"2024-07-05T15:52:56.000Z","size":11539,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T14:11:19.291Z","etag":null,"topics":["4d-plugin"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miyako.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-25T11:36:27.000Z","updated_at":"2024-08-27T04:43:38.000Z","dependencies_parsed_at":"2022-09-20T23:12:04.308Z","dependency_job_id":null,"html_url":"https://github.com/miyako/4d-plugin-pdf-kit","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-pdf-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-pdf-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-pdf-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-pdf-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miyako","download_url":"https://codeload.github.com/miyako/4d-plugin-pdf-kit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251001454,"owners_count":21520949,"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":["4d-plugin"],"created_at":"2024-11-11T02:19:15.940Z","updated_at":"2025-09-04T02:39:37.438Z","avatar_url":"https://github.com/miyako.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![version](https://img.shields.io/badge/version-20%2B-E23089)\n![platform](https://img.shields.io/static/v1?label=platform\u0026message=mac-intel%20|%20mac-arm\u0026color=blue)\n[![license](https://img.shields.io/github/license/miyako/4d-plugin-pdf-kit)](LICENSE)\n![downloads](https://img.shields.io/github/downloads/miyako/4d-plugin-pdf-kit/total)\n\n4d-plugin-pdf-kit\n=================\n\nPerform basic PDF manipulation on macOS.\n\n### Examples\n\n* Document\n\n```4d\n$filePath:=Get 4D folder(Current resources folder)+\"sample.pdf\"\nDOCUMENT TO BLOB($filePath;$pdfData)\n\n$version:=PDF Get ducument version ($pdfData)\n$text:=PDF Get document text ($pdfData)\n\n$filePath:=Get 4D folder(Current resources folder)+\"sample.png\"\n  //read image file as single pdf page\nREAD PICTURE FILE($filePath;$image)\n\n$pdfImageData:=PDF Data from picture ($image)\n\n  //insert 1 page\nPDF INSERT PAGES ($pdfData;1;$pdfImageData)\n\n$filePath:=System folder(Desktop)+\"image_test.pdf\"\nBLOB TO DOCUMENT($filePath;$pdfData)\n```\n\n* pages\n\n```4d\n$filePath:=Get 4D folder(Current resources folder)+\"sample.pdf\"\nDOCUMENT TO BLOB($filePath;$pdfData)\n\n$countPages:=PDF Count pages ($pdfData)\n\nPDF REMOVE PAGE ($pdfData;1)\n$countPages:=PDF Count pages ($pdfData)\nPDF REMOVE PAGE ($pdfData;$countPages)\n\n$filePath:=System folder(Desktop)+\"remove_test.pdf\"\nBLOB TO DOCUMENT($filePath;$pdfData)\n\n$filePath:=Get 4D folder(Current resources folder)+\"sample.pdf\"\nDOCUMENT TO BLOB($filePath;$pdfData)\n\nPDF EXCHANGE PAGES ($pdfData;1;2)\n\n$filePath:=System folder(Desktop)+\"exchange_test.pdf\"\nBLOB TO DOCUMENT($filePath;$pdfData)\n\n$filePath:=Get 4D folder(Current resources folder)+\"sample.pdf\"\nDOCUMENT TO BLOB($filePath;$pdfData)\n\nPDF SET PAGE ROTATION ($pdfData;1;90)\n\n$filePath:=System folder(Desktop)+\"rotation_test.pdf\"\nBLOB TO DOCUMENT($filePath;$pdfData)\n\n$filePath:=Get 4D folder(Current resources folder)+\"sample.pdf\"\nDOCUMENT TO BLOB($filePath;$pdfData)\n\nPDF GET PAGE ($pdfData;1;$pageData;$pageLabel;$pageContent)\n\n  //insert 1 page\nPDF INSERT PAGES ($pdfData;1;$pageData)\n\n  //insert many pages\nPDF INSERT PAGES ($pdfData;11;$pdfData)\n\n$filePath:=System folder(Desktop)+\"insert_test.pdf\"\nBLOB TO DOCUMENT($filePath;$pdfData)\n```\n\n* atrributes\n\n```4d\n$filePath:=Get 4D folder(Current resources folder)+\"sample.pdf\"\nDOCUMENT TO BLOB($filePath;$pdfData)\n\nARRAY TEXT($keys;0)\nARRAY TEXT($values;0)\n\nPDF GET DOCUMENT ATTRIBUTES ($pdfData;$keys;$values)\n\n  //modifiable attributes; original value will be used if not specified\nARRAY TEXT($keys;5)\nARRAY TEXT($values;5)\n\n$keys{1}:=PDF_AUTHOR\n$values{1}:=\"miyako\"\n\n$keys{2}:=PDF_CREATOR\n$values{2}:=\"keisuke\"\n\n$keys{3}:=PDF_KEYWORDS\n$values{3}:=\"4D,keisuke,miyako\"  //comma separated words\n\n$keys{4}:=PDF_SUBJECT\n$values{4}:=\"sample\"\n\n$keys{5}:=PDF_TITLE\n$values{5}:=\"sample\"\n\nIf (False)\n  //these attributes are set automatically, can't be modified by code\n$keys{0}:=PDF_PRODUCER\n$keys{0}:=PDF_CREATION_DATE\n$keys{0}:=PDF_MODIFICATION_DATE\nEnd if \n\nPDF SET DOCUMENT ATTRIBUTES ($pdfData;$keys;$values)\n```\n\n* annotation\n\n```4d\n$filePath:=Get 4D folder(Current resources folder)+\"sample_annotation.pdf\"\nDOCUMENT TO BLOB($filePath;$pdfData)\n\n  //if type=Ink; contents=SVG style path string\n  //if type=Line; contents=x,y width,height\n  //if type=Text|FreeText; contents=contents\n  //if type=Stamp; contents=name\n  //if type=Link; contents=URL|page label (x,y)\n\nARRAY TEXT($types;0)\nARRAY TEXT($coordinates;0)\nARRAY TEXT($colors;0)\nARRAY TEXT($contents;0)\n\nPDF GET PAGE ANNOTATION ($pdfData;1;$types;$coordinates;$colors;$contents)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-pdf-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiyako%2F4d-plugin-pdf-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-pdf-kit/lists"}