{"id":18936403,"url":"https://github.com/vaporexampleslab/mcxprint","last_synced_at":"2026-03-21T03:30:16.206Z","repository":{"id":133119465,"uuid":"194897161","full_name":"VaporExamplesLab/MCxPrint","owner":"VaporExamplesLab","description":null,"archived":false,"fork":false,"pushed_at":"2019-11-11T18:20:20.000Z","size":203,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T21:26:27.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/VaporExamplesLab.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-07-02T16:15:58.000Z","updated_at":"2019-11-11T18:20:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"685d2de7-31c6-48f8-b4a2-1163a738bd39","html_url":"https://github.com/VaporExamplesLab/MCxPrint","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/VaporExamplesLab%2FMCxPrint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VaporExamplesLab%2FMCxPrint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VaporExamplesLab%2FMCxPrint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VaporExamplesLab%2FMCxPrint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VaporExamplesLab","download_url":"https://codeload.github.com/VaporExamplesLab/MCxPrint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239937702,"owners_count":19721482,"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":[],"created_at":"2024-11-08T12:07:19.100Z","updated_at":"2026-03-21T03:30:16.163Z","avatar_url":"https://github.com/VaporExamplesLab.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MCxPrint\n\n\u003ca id=\"toc\"\u003e\u003c/a\u003e\n[Usage](#linkUsage) •\n[Examples](#linkSetup) •\n[Setup](#linkSetup) •\n[Resources](#linkResources)\n\n_`MCxPrint` is a platform-agnostic, pure Swift package which programmatically generates printable SVG files from JSON input. The SVG files are also converted to PDF via Cairo `svg2pdf`._ \n\nThe `MCxPrint` Swift package is structured to provide both a command line tool and framework for inclusion in other Swift Packages. The command line tool supports both desktop and server backend workflows. Although, the current document layout focus is labels, the framework is intended to be extensible so that other layouts can be added.\n\n\n## Setup \u003ca id=\"linkSetup\"\u003e\u003c/a\u003e[▴](#toc)\n\n**Data Input**\n\nBook label JSON data files are read from `/var/spool/mcxprint_spool/`. Each layout type has one-to-one association with a subdirectory within `mcxprint_spool`. Currently implemented directories are:\n\n* `labelfile`\n* `labelbook`\n\n\n**Typography**\n\n`MCxPrint` uses JSON-base font metrics generated by \u003ccode\u003e[MCxFontMetrics](https://github.com/VaporExamplesLab/MCxFontMetrics)\u003c/code\u003e A `MCxPrint` `\u003cPostscriptFontName\u003e_\u003cPointSize\u003e.json` for each font used needs to be placed in `/opt/local/fontmetics/`. The corresponding font must also be installed on the system.\n\n**PDF Generation**\n\nAt this development phase, PDF generations is based on Cairo `svg2pdf`. At some future date PDF generation would be switched to something like [PureSwift/Cairo](https://github.com/PureSwift/Cairo).\n\n_macOS_\n\n``` sh\nbrew install svg2pdf\n```\n\n_Ubuntu_\n\nIf Inscape is installed, then the following scripts can be added.  Apply `chmod +x` to the script files. Place the scripts someplace know to the `$PATH` such as `~/bin/`, `/usr/local/bin` or `/opt/local/bin/` \n\n`svg2pdf`\n\n``` sh\n#!/bin/bash\n\nfor i in $@; do\n  inkscape --without-gui --export-pdf=\"$(basename $i .svg).pdf\" $i\ndone\n```\n\n`svg2png`\n\n``` bash\n#!/bin/bash\n\nfor i in $@; do\n  inkscape --without-gui --export-png=\"$(basename $i .svg).png\" $i\ndone\n```\n\nAlternately, [CairoSVG](https://cairosvg.org/) could be setup up on systems with Python 3.5+.\n\n## Template Examples \u003ca id=\"linkOutput\"\u003e\u003c/a\u003e[▴](#toc)\n\nThe library book label is sized for the Brother PT 24mm (1\") laminated labels.\n\n![](README_files/ExampleLabelBook.png)\n\nThe library file label is sized for the Avery 5027 label sheet or equivalent. \n\n![](README_files/ExampleLabelFile.png)\n\n## Resources \u003ca id=\"linkResources\"\u003e\u003c/a\u003e[▴](#toc)\n\n* [StackOverflow: Determine String bounding box in portable Swift? ⇗](https://stackoverflow.com/questions/56548870/determine-string-bounding-box-in-portable-swift)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaporexampleslab%2Fmcxprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaporexampleslab%2Fmcxprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaporexampleslab%2Fmcxprint/lists"}