{"id":30047336,"url":"https://github.com/san-soni30/filetocanvas","last_synced_at":"2026-04-16T05:01:47.578Z","repository":{"id":306891434,"uuid":"1027559010","full_name":"san-soni30/FileToCanvas","owner":"san-soni30","description":"A lightweight web tool to convert images and PDFs into Fabric.js canvas code. Supports base64 or URL embedding with live preview and export. Built with HTML, JavaScript, Bootstrap, Fabric.js, and PDF.js.","archived":false,"fork":false,"pushed_at":"2025-09-08T08:34:19.000Z","size":3059,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-08T09:23:52.561Z","etag":null,"topics":["bootstrap5","git","github","html-css-javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/san-soni30.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-28T07:35:55.000Z","updated_at":"2025-09-08T08:34:23.000Z","dependencies_parsed_at":"2025-07-28T09:34:46.380Z","dependency_job_id":"f5dec0ee-ade6-4eaf-9621-22eecf6cd4c8","html_url":"https://github.com/san-soni30/FileToCanvas","commit_stats":null,"previous_names":["san-soni30/filetocanvas"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/san-soni30/FileToCanvas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san-soni30%2FFileToCanvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san-soni30%2FFileToCanvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san-soni30%2FFileToCanvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san-soni30%2FFileToCanvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/san-soni30","download_url":"https://codeload.github.com/san-soni30/FileToCanvas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san-soni30%2FFileToCanvas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31872036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"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":["bootstrap5","git","github","html-css-javascript"],"created_at":"2025-08-07T09:39:22.921Z","updated_at":"2026-04-16T05:01:47.572Z","avatar_url":"https://github.com/san-soni30.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎨 File to Canvas.js Converter\n\nConvert PNG, JPEG, or PDF files into a **Canvas.js** (Fabric.js) object and view the generated code for easy use in your web projects.  \nThis tool also supports **AI-powered image generation** through an integrated **n8n workflow**, allowing you to generate visuals from text prompts directly on the canvas.\n\n---\n\n## 🚀 Features\n\n- 🖼 Upload image files (`.png`, `.jpg`, `.jpeg`) or PDF documents.  \n- 🤖 Generate images from text prompts via **n8n workflow** integration.  \n- 📄 Render files directly onto an HTML5 `\u003ccanvas\u003e` using **Fabric.js**.  \n- 💻 Export canvas state as **Canvas.js code** (JSON format).  \n- 🔗 Option to embed images as **base64** or external URL.  \n- 📋 Copy or clear generated code easily from the UI.  \n- 🧼 Clean **Bootstrap 5.3 UI** with responsive layout.  \n\n---\n\n## 📂 File Structure\n\n\nfile-to-canvasjs-converter/\n│\n├── index.html          # Main HTML structure\n├── style.css           # Custom styles\n├── app.js              # Core logic (Fabric.js, PDF.js, n8n workflow integration)\n└── README.md           # Project documentation\n\n\n---\n\n## 📸 Screenshot\n\n![Preview](image.png)\n\n---\n\n## 🧰 Technologies Used\n\n- **HTML5, CSS3, JavaScript (ES6)**  \n- [Bootstrap 5.3](https://getbootstrap.com/)  \n- [Fabric.js 5.3](http://fabricjs.com/)  \n- [PDF.js](https://mozilla.github.io/pdf.js/)  \n- **n8n** for AI image generation workflow  \n\n---\n\n## 🔧 How It Works\n\n1. **Upload File**: Choose any supported file type (`.png`, `.jpg`, `.jpeg`, `.pdf`).  \n2. **Generate Image**: (Optional) Enter a text prompt and generate an image via **n8n workflow**.  \n3. **Preview Canvas**: The canvas displays the uploaded background image, first page of a PDF, or generated AI image.  \n4. **Generate Code**: Click **\"Generate Code\"** to view the `canvas.loadFromJSON()` object.  \n5. **Copy/Use Code**: Toggle the **base64** option or copy the code to reuse in your projects.  \n\n---\n\n## 📦 Setup\n\n1. Clone or download this repository:  \n   - git clone https://github.com/san-soni30/FileToCanvas.git\n\n\n2. Open `index.html` in your browser.\n3. Upload a file or generate an AI image, then generate Canvas.js code for your projects.\n\n---\n\n## ⚠️ Notes\n\n* PDF rendering only displays the **first page**.\n* Image background is scaled to fit the canvas.\n* Use the **Include Base64** checkbox to decide how the image is embedded.\n* n8n workflow requires a configured webhook endpoint for AI image generation.\n\n---\n\n## 🙌 Contributions\n\nPull requests and improvements are welcome! If you'd like to add more file format support, AI features, or workflow enhancements, feel free to fork this project.\n\n---\n\n## 🎥 Demo\n\n🌐 [Watch Live Demo](https://youtu.be/7ngcZvR5Jd8)\n\n---\n\nHappy coding! 💻✨","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsan-soni30%2Ffiletocanvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsan-soni30%2Ffiletocanvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsan-soni30%2Ffiletocanvas/lists"}