{"id":18969184,"url":"https://github.com/nicolasalmerge/newharu","last_synced_at":"2025-04-19T15:02:02.747Z","repository":{"id":115088561,"uuid":"507693923","full_name":"NicolasAlmerge/NewHaru","owner":"NicolasAlmerge","description":"PDF Creation Library based on the C LibHaru library","archived":false,"fork":false,"pushed_at":"2024-04-05T11:48:44.000Z","size":3433,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T09:05:37.630Z","etag":null,"topics":["cpp","cpp17","cpp20","libharu","object-oriented","object-oriented-programming","oop","pdf","pdf-generation"],"latest_commit_sha":null,"homepage":"https://nicolasalmerge.github.io/NewHaru/","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/NicolasAlmerge.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-26T22:02:03.000Z","updated_at":"2024-03-21T12:40:27.000Z","dependencies_parsed_at":"2024-01-28T12:49:58.183Z","dependency_job_id":"912e43cc-97fa-4fbb-9cc8-984fea906a25","html_url":"https://github.com/NicolasAlmerge/NewHaru","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/NicolasAlmerge%2FNewHaru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasAlmerge%2FNewHaru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasAlmerge%2FNewHaru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasAlmerge%2FNewHaru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicolasAlmerge","download_url":"https://codeload.github.com/NicolasAlmerge/NewHaru/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249213763,"owners_count":21231096,"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":["cpp","cpp17","cpp20","libharu","object-oriented","object-oriented-programming","oop","pdf","pdf-generation"],"created_at":"2024-11-08T14:52:07.924Z","updated_at":"2025-04-19T15:02:02.723Z","avatar_url":"https://github.com/NicolasAlmerge.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NewHaru\n\nPDF Creation C++ Library, made by [Nicolas Almerge](https://github.com/NicolasAlmerge).\n\nIt is based on the C library [LibHaru](https://github.com/libharu/libharu), but provides an easier, cleaner and simpler syntax with object oriented patterns, exception handling and flexibility.\n\n## Usage\n\n```cpp\n#include \"include/NewHaru.hpp\"\n#include \"iostream\"\n\nint main() {\n    pdf::Document document;\n\n    // Print 'true' or 'false' instead of '1' and '0' for boolean types\n    std::cout \u003c\u003c std::boolalpha;\n\n    try {\n        // Open the document\n        document.open();\n\n        // Get font 'Helvetica'\n        pdf::Font font = document.getFont(\"Helvetica\");\n\n        // Add a page at the end of the document\n        pdf::Page page = document.addPage();\n\n        // Set the pdf creation date to December 10th, 2002 at 12:15:30 PM\n        document.setAttribute(\n            pdf::enums::DateTimeAttribute::CREATION_DATE,\n            {2000, 12, 10, 12, 15, 30}\n        );\n\n        // Set font and size\n        page.setFontAndSize(font, 12);\n\n        // Write text at specified positions\n        page.writeText(\"This is a test\\n\", {50, 50});\n        page.writeText(\"This is a second test\\n\", {150, 50});\n\n        // Create a new text annotation and set the icon to a help icon\n        pdf::TextAnnotation annotation = page.createTextAnnotation(\n            \"Hi there!\", {200, 200, 200, 200}\n        );\n        annotation.setIcon(pdf::enums::AnnotationIcon::HELP);\n\n        // Save to file\n        document.saveToFile(\"output.pdf\");\n    } catch (const pdf::excepts::Exception\u0026 e) {\n        // Print the exception name and description in case one occurred\n        std::cout \u003c\u003c e.getFullDescription() \u003c\u003c std::endl;\n    }\n\n    return 0;\n}\n```\n\n## Compilation\n\nFor MacOS, you first need to install [Homebrew](https://brew.sh).\n\nAfter installing, you should install [libharu](https://formulae.brew.sh/formula/libharu) using:\n\n```sh\nbrew install libharu\n```\n\nThen, you can compile your program by running:\n\n```sh\ng++ -std=c++17 -o output -O2 -Wall program.cpp NewHaru/src/*.cpp -I$(brew --prefix)/include/ -L$(brew --prefix)/lib/ -lhpdf -lpng -lz -lm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolasalmerge%2Fnewharu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolasalmerge%2Fnewharu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolasalmerge%2Fnewharu/lists"}