{"id":32521902,"url":"https://github.com/swagfin/semanticxamlprint","last_synced_at":"2025-10-28T06:46:10.150Z","repository":{"id":153157443,"uuid":"622568114","full_name":"swagfin/SemanticXamlPrint","owner":"swagfin","description":"An Xaml parser that translates to a windows print Drawing","archived":false,"fork":false,"pushed_at":"2024-01-21T15:37:15.000Z","size":401,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-21T16:39:11.265Z","etag":null,"topics":["generator","pdf","pdf-generation","printing","printing-engine","receipt","receipt-printer","thermal-printer","xaml-style"],"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/swagfin.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-02T13:56:48.000Z","updated_at":"2023-10-07T10:40:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0f97c5a-ebc0-4f46-b885-aab56055274c","html_url":"https://github.com/swagfin/SemanticXamlPrint","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/swagfin/SemanticXamlPrint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swagfin%2FSemanticXamlPrint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swagfin%2FSemanticXamlPrint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swagfin%2FSemanticXamlPrint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swagfin%2FSemanticXamlPrint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swagfin","download_url":"https://codeload.github.com/swagfin/SemanticXamlPrint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swagfin%2FSemanticXamlPrint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281397322,"owners_count":26493908,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["generator","pdf","pdf-generation","printing","printing-engine","receipt","receipt-printer","thermal-printer","xaml-style"],"created_at":"2025-10-28T06:46:05.049Z","updated_at":"2025-10-28T06:46:10.133Z","avatar_url":"https://github.com/swagfin.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SemanticXamlPrint\n\nSimple Library to help you with creating receipts using simple Xaml like syntax. This library uses System.Drawing to generate and print receipts\n\n## Overview\n\n* Generate a receipt i.e. Thermal 80mm receipt or A4 receipt\n* Uses Xaml like Syntax to generate a receipt template\n\n## Install \n\n*NuGet Package*\n```\nInstall-Package SemanticXamlPrint\n```\nhttps://nuget.org/packages/SemanticXamlPrint\n\n## Usage Example\n\n```cs\n    class Program\n    {\n        static void Main(string[] args)\n        {\n\n            //Get Template Contents\n            byte[] xamlFileBytes = File.ReadAllBytes(\"custom.grid.template\");\n            //Use SemanticXamlPrint Parser \n            IXamlComponent xamlComponent = DefaultXamlParser.Parse(xamlFileBytes);\n\n            PrintDocument printDocument = new PrintDocument();\n            printDocument.PrintPage += (obj, eventAgs) =\u003e\n            {\n                //Use SemanticXamlPrint Draw Extension \n\t\teventAgs.DrawXamlComponent(xamlComponent);\n            };\n            printDocument.Print();\n\n            Console.ReadLine();\n            Environment.Exit(0);\n        }\n    }\n```\n\n## Results\n\n![Result](https://github.com/swagfin/SemanticXamlPrint/blob/a3a0b443bc8e1c7d3eb9ee6b9e9a92643a14901d/Screenshots/sample-grid.jpg)\n\n\n## File custom.grid.template\n```xaml\n\u003cTemplate font=\"Calibri\" FontSize=\"10\" MaxWidth=\"290\" MarginTop=\"10\"\u003e\n\n\t\u003cGrid ColumnWidths=\"1*4*2\" BorderStyle=\"Solid\"\u003e\n\t\t\u003cGridRow\u003e\n\t\t\t\u003cData Grid.Column=\"0\" FontStyle=\"Bold\" Align=\"Center\"\u003eQTY\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"1\" FontStyle=\"Bold\"\u003eITEM DESC.\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"2\" FontStyle=\"Bold\" Align=\"Right\"\u003eAMOUNT\u003c/Data\u003e\n\t\t\u003c/GridRow\u003e\n\t\u003c/Grid\u003e\n\n\t\u003cGrid ColumnWidths=\"1*4*2\"\u003e\n\t\t\u003cGridRow\u003e\n\t\t\t\u003cData Grid.Column=\"0\" Align=\"Center\"\u003e1\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"1\" TextWrap =\"True\"\u003eChips with Vegetable Salad at a Discounted Price\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"2\" Align=\"Right\"\u003e250.00\u003c/Data\u003e\n\t\t\u003c/GridRow\u003e\n\n\t\t\u003cGridRow\u003e\n\t\t\t\u003cData Grid.Column=\"0\" Align=\"Center\"\u003e1\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"1\" TextWrap =\"True\"\u003eHEINKEN\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"2\" Align=\"Right\"\u003e300.00\u003c/Data\u003e\n\t\t\u003c/GridRow\u003e\n\t\t\u003cGridRow\u003e\n\t\t\t\u003cData Grid.Column=\"0\" Align=\"Center\"\u003e1\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"1\" TextWrap =\"True\"\u003ePILSNER\u003c/Data\u003e\n\t\t\t\u003cData Grid.Column=\"2\" Align=\"Right\"\u003e250.00\u003c/Data\u003e\n\t\t\u003c/GridRow\u003e\n\t\u003c/Grid\u003e\n\u003c/Template\u003e\n```\n\n## Check out more examples on the Demo Project\n[SemanticXamlPrint.Demo](https://github.com/swagfin/SemanticXamlPrint/tree/master/SemanticXamlPrint.Demo)\n\n## Supported Xaml Components\n\n### 1. Template\n\n```xaml\n\u003cTemplate font=\"Calibri\" FontSize=\"10\" MaxWidth=\"290\" MarginTop=\"10\"\u003e\n   \u003c!--Other Components Here--\u003e\n\u003c/Template\u003e\n```\n\n### 2. Data\n```xaml\n\u003cData FontStyle=\"Bold\" FontSize=\"11\" TextWrap =\"True\" Align=\"Center\"\u003eI like to Text Wrap\u003c/Data\u003e\n```\n\n### 3. Image\n\n```xaml\n\u003cImage Source=\"logo.png\" Width=\"100\" Height=\"100\" /\u003e\n```\n\n### 4. Grid + GridRow\n\n```xaml\n\u003cGrid ColumnWidths=\"1*4*2\" BorderStyle=\"Solid\"\u003e\n\t\u003cGridRow\u003e\n\t\t\u003cData Grid.Column=\"0\" FontStyle=\"Bold\"\u003eColumn 1\u003c/Data\u003e\n\t\t\u003cData Grid.Column=\"1\" FontStyle=\"Bold\"\u003eColumn 2\u003c/Data\u003e\n\t\t\u003cData Grid.Column=\"2\" FontStyle=\"Bold\" Align=\"Right\"\u003eColumn 3\u003c/Data\u003e\n\t\u003c/GridRow\u003e\n\u003c/Grid\u003e\n```\n\n### 5. DataRow + DataRowCell\n\n```xaml\n\u003cDataRow\u003e\n\t\u003cDataRowCell FontStyle=\"Bold\" X=\"0\"\u003eITEM DESC.\u003c/DataRowCell\u003e\n\t\u003cDataRowCell FontStyle=\"Bold\" X=\"120\"\u003eRATE\u003c/DataRowCell\u003e\n\t\u003cDataRowCell FontStyle=\"Bold\" X=\"170\"\u003eQTY\u003c/DataRowCell\u003e\n\t\u003cDataRowCell FontStyle=\"Bold\" X=\"220\"\u003eAMOUNT\u003c/DataRowCell\u003e\n\u003c/DataRow\u003e\n```\n\n### 6. Line\n\n```xaml\n\u003cLine Style=\"Dash\" /\u003e\n```\n\n### 7. LineBreak\n\n```xaml\n\u003cLineBreak/\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswagfin%2Fsemanticxamlprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswagfin%2Fsemanticxamlprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswagfin%2Fsemanticxamlprint/lists"}