{"id":30278291,"url":"https://github.com/alihassan143/htmltopdfwidgets","last_synced_at":"2025-08-16T12:35:51.365Z","repository":{"id":152379757,"uuid":"625882987","full_name":"alihassan143/htmltopdfwidgets","owner":"alihassan143","description":"Html To Pdf","archived":false,"fork":false,"pushed_at":"2025-08-14T18:40:21.000Z","size":514,"stargazers_count":19,"open_issues_count":4,"forks_count":33,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-14T20:33:46.480Z","etag":null,"topics":["dart","flutter","html","pdf","widgets"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/htmltopdfwidgets","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alihassan143.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://www.buymeacoffee.com/alihassan13"]}},"created_at":"2023-04-10T10:12:29.000Z","updated_at":"2025-08-14T18:40:24.000Z","dependencies_parsed_at":"2023-06-14T09:45:19.170Z","dependency_job_id":"7c5d7cff-6fe4-4935-a358-d316210e0bb2","html_url":"https://github.com/alihassan143/htmltopdfwidgets","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/alihassan143/htmltopdfwidgets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihassan143%2Fhtmltopdfwidgets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihassan143%2Fhtmltopdfwidgets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihassan143%2Fhtmltopdfwidgets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihassan143%2Fhtmltopdfwidgets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alihassan143","download_url":"https://codeload.github.com/alihassan143/htmltopdfwidgets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihassan143%2Fhtmltopdfwidgets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270709088,"owners_count":24631992,"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-08-16T02:00:11.002Z","response_time":91,"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":["dart","flutter","html","pdf","widgets"],"created_at":"2025-08-16T12:35:47.844Z","updated_at":"2025-08-16T12:35:51.350Z","avatar_url":"https://github.com/alihassan143.png","language":"Dart","funding_links":["https://www.buymeacoffee.com/alihassan13"],"categories":[],"sub_categories":[],"readme":"# HTMLtoPDFWidgets\n\n\nHTMLtoPDFWidgets is a Flutter package that allows you to convert HTML and Markdown content into PDF documents with support for various Rich Text Editor formats. With this package, you can effortlessly generate PDF files that include elements such as lists, paragraphs, images, quotes, and headings.\n\n## Help Maintenance\n\nI've been maintaining quite many repos these days and burning out slowly. If you could help me cheer up, buying me a cup of coffee will make my life really happy and get much energy out of it.\n\n\u003ca href=\"https://www.buymeacoffee.com/alihassan13\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\n## Features\n\n- Convert HTML content to PDF documents in Flutter apps\n- Support for Markdown to PDF conversion\n- Rich Text Editor formatting support\n- Seamless integration with your Flutter project\n- Lightweight and easy to use\n\n## Installation\n\nAdd the following dependency to your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  htmltopdfwidgets: ^1.0.5\n```\n\n## Usage\n\nTo use HTMLtoPDFWidgets in your Flutter project, follow these simple steps:\n\n1. Import the package:\n\n```dart\nimport 'package:htmltopdfwidgets/htmltopdfwidgets.dart';\n```\n\n2. Convert HTML to PDF:\n\n```dart\nfinal htmlContent = '''\n  \u003ch1\u003eHeading Example\u003c/h1\u003e\n  \u003cp\u003eThis is a paragraph.\u003c/p\u003e\n  \u003cimg src=\"image.jpg\" alt=\"Example Image\" /\u003e\n  \u003cblockquote\u003eThis is a quote.\u003c/blockquote\u003e\n  \u003cul\u003e\n    \u003cli\u003eFirst item\u003c/li\u003e\n    \u003cli\u003eSecond item\u003c/li\u003e\n    \u003cli\u003eThird item\u003c/li\u003e\n  \u003c/ul\u003e\n''';\n\n  var filePath = 'test/example.pdf';\n  var file = File(filePath);\n  final newpdf = Document();\n  List\u003cWidget\u003e widgets = await HTMLToPdf().convert(htmlContent);\n  newpdf.addPage(MultiPage(\n      maxPages: 200,\n      build: (context) {\n        return widgets;\n      }));\n  await file.writeAsBytes(await newpdf.save());\n```\n3. Converting Markdown to PDF:\n\n```dart\nfinal markDown = '''\n  # Basic Markdown Demo\n---\nThe Basic Markdown Demo shows the effect of the four Markdown extension sets\non formatting basic and extended Markdown tags.\n\n## Overview\n\nThe Dart [markdown](https://pub.dev/packages/markdown) package parses Markdown\ninto HTML. The flutter_markdown package builds on this package using the\nabstract syntax tree generated by the parser to make a tree of widgets instead\nof HTML elements.\n\nThe markdown package supports the basic block and inline Markdown syntax\nspecified in the original Markdown implementation as well as a few Markdown\nextensions. The markdown package uses extension sets to make extension\nmanagement easy. There are four pre-defined extension sets; none, Common Mark,\nGitHub Flavored, and GitHub Web. The default extension set used by the\nflutter_markdown package is GitHub Flavored.\n\nThe Basic Markdown Demo shows the effect each of the pre-defined extension sets\nhas on a test Markdown document with basic and extended Markdown tags. Use the\nExtension Set dropdown menu to select an extension set and view the Markdown\nwidget's output.\n\n## Comments\n\nSince GitHub Flavored is the default extension set, it is the initial setting\nfor the formatted Markdown view in the demo.\n''';\n\n  final List\u003cWidget\u003e markdownWidgets = await HTMLToPdf().convertMarkdown(markDown);\nfinal markdownPdf = Document();\nmarkdownPdf.addPage(MultiPage(\n  build: (context) =\u003e markdownWidgets,\n));\nawait File('markdown_example.pdf').writeAsBytes(await markdownPdf.save());\n```\n\nFor more details on usage and available options, please refer to the [API documentation](https://pub.dev/documentation/htmltopdfwidgets/latest).\n\n## Example\n\nYou can find a complete example in the [example](https://github.com/alihassan143/htmltopdfwidgets/tree/main/example) directory of this repository.\n\n## License\n\nThis package is licensed under the [MIT License](https://github.com/alihassan143/htmltopdfwidgets/blob/main/LICENSE).\n\n## Contributing\n\nContributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the [GitHub repository](https://github.com/alihassan143/htmltopdfwidgets).\n\n## Acknowledgments\n\nSpecial thanks to the Appflowy editor:\nI use their Html To Document plugin as reference\n\n- Appflowy ([@AppFlowy-IO](https://github.com/AppFlowy-IO/appflowy-editor))\n\n\n\nHappy PDF generation with HTMLtoPDFWidgets in your Flutter apps!\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falihassan143%2Fhtmltopdfwidgets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falihassan143%2Fhtmltopdfwidgets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falihassan143%2Fhtmltopdfwidgets/lists"}