{"id":17268356,"url":"https://github.com/gen2brain/go-fitz","last_synced_at":"2025-05-15T03:04:24.077Z","repository":{"id":37405378,"uuid":"45365472","full_name":"gen2brain/go-fitz","owner":"gen2brain","description":"Golang wrapper for the MuPDF Fitz library","archived":false,"fork":false,"pushed_at":"2024-12-18T08:36:21.000Z","size":404938,"stargazers_count":497,"open_issues_count":6,"forks_count":100,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-14T01:05:44.813Z","etag":null,"topics":["docx","epub","fitz","golang","golang-wrapper","mupdf","pdf","pptx","xlsx"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gen2brain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-02T01:29:00.000Z","updated_at":"2025-04-08T23:13:58.000Z","dependencies_parsed_at":"2025-01-17T15:13:40.217Z","dependency_job_id":null,"html_url":"https://github.com/gen2brain/go-fitz","commit_stats":{"total_commits":160,"total_committers":13,"mean_commits":"12.307692307692308","dds":"0.13124999999999998","last_synced_commit":"f1c7716a999d9e4deb2d470a48eddc36180472f4"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fgo-fitz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fgo-fitz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fgo-fitz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fgo-fitz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gen2brain","download_url":"https://codeload.github.com/gen2brain/go-fitz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804803,"owners_count":21164134,"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":["docx","epub","fitz","golang","golang-wrapper","mupdf","pdf","pptx","xlsx"],"created_at":"2024-10-15T08:13:09.171Z","updated_at":"2025-04-14T01:06:03.297Z","avatar_url":"https://github.com/gen2brain.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## go-fitz\n[![Build Status](https://github.com/gen2brain/go-fitz/actions/workflows/test.yml/badge.svg)](https://github.com/gen2brain/go-fitz/actions)\n[![GoDoc](https://godoc.org/github.com/gen2brain/go-fitz?status.svg)](https://godoc.org/github.com/gen2brain/go-fitz)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gen2brain/go-fitz?branch=master)](https://goreportcard.com/report/github.com/gen2brain/go-fitz)\n\nGo wrapper for [MuPDF](http://mupdf.com/) fitz library that can extract pages from PDF, EPUB, MOBI, DOCX, XLSX and PPTX documents as IMG, TXT, HTML or SVG.\n\n### Build tags\n\n* `extlib` - use external MuPDF library\n* `static` - build with static external MuPDF library (used with `extlib`)\n* `pkgconfig` - enable pkg-config (used with `extlib`)\n* `musl` - use musl compiled library\n* `nocgo` - experimental [purego](https://github.com/ebitengine/purego) implementation (can also be used with `CGO_ENABLED=0`)\n\n### Notes\n\nThe bundled libraries are built without CJK fonts, if you need them you must use the external library.\n\nCalling e.g. Image() or Text() methods concurrently for the same document is not supported.\n\nPurego implementation requires `libffi` and `libmupdf` shared libraries on runtime.\nYou must set `fitz.FzVersion` in your code or set `FZ_VERSION` environment variable to exact version of the shared library. \n    \n### Example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image/jpeg\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/gen2brain/go-fitz\"\n)\n\nfunc main() {\n\tdoc, err := fitz.New(\"test.pdf\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer doc.Close()\n\n\ttmpDir, err := os.MkdirTemp(os.TempDir(), \"fitz\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Extract pages as images\n\tfor n := 0; n \u003c doc.NumPage(); n++ {\n\t\timg, err := doc.Image(n)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tf, err := os.Create(filepath.Join(tmpDir, fmt.Sprintf(\"test%03d.jpg\", n)))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\terr = jpeg.Encode(f, img, \u0026jpeg.Options{jpeg.DefaultQuality})\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tf.Close()\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fgo-fitz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgen2brain%2Fgo-fitz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fgo-fitz/lists"}