Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AndreRenaud/PDFGen
Simple C PDF Writer/Generation library
https://github.com/AndreRenaud/PDFGen
c pdf pdf-document pdf-generation simple-api
Last synced: 2 months ago
JSON representation
Simple C PDF Writer/Generation library
- Host: GitHub
- URL: https://github.com/AndreRenaud/PDFGen
- Owner: AndreRenaud
- License: unlicense
- Created: 2013-05-29T02:01:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-20T22:46:46.000Z (10 months ago)
- Last Synced: 2024-08-04T10:02:48.142Z (6 months ago)
- Topics: c, pdf, pdf-document, pdf-generation, simple-api
- Language: C
- Homepage:
- Size: 923 KB
- Stars: 487
- Watchers: 33
- Forks: 116
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PDFGen
======Simple C PDF Creation/Generation library.
All contained a single C-file with header and no external library dependencies.Useful for embedding into other programs that require rudimentary PDF output.
Supports the following PDF features
* Text of various fonts/sizes/colours/rotation
* Primitive drawing elements
* Lines
* Rectangles
* Filled Rectangles
* Polygons
* Filled Polygons
* Bezier curves
* Bookmarks
* Barcodes (Code-128 & Code-39)
* Embedded images
* PPM/PGM (binary format only)
* JPEG
* PNG (Alpha Channels are not supported)
* BMPExample usage
=============
```c
#include "pdfgen.h"int main(void) {
struct pdf_info info = {
.creator = "My software",
.producer = "My software",
.title = "My document",
.author = "My name",
.subject = "My subject",
.date = "Today"
};
struct pdf_doc *pdf = pdf_create(PDF_A4_WIDTH, PDF_A4_HEIGHT, &info);
pdf_set_font(pdf, "Times-Roman");
pdf_append_page(pdf);
pdf_add_text(pdf, NULL, "This is text", 12, 50, 20, PDF_BLACK);
pdf_add_line(pdf, NULL, 50, 24, 150, 24, 3, PDF_BLACK);
pdf_save(pdf, "output.pdf");
pdf_destroy(pdf);
return 0;
}
```License
=======
[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)The source here is public domain.
If you find it useful, please drop me a line at [email protected].Builds
======
Build status: [![GitHub Actions](https://github.com/AndreRenaud/PDFGen/workflows/Build%20and%20Test/badge.svg)](https://github.com/AndreRenaud/PDFGen/actions)Appveyor status: [![Build status](https://ci.appveyor.com/api/projects/status/3qpsmr06xg5gx74j/branch/master?svg=true)](https://ci.appveyor.com/project/AndreRenaud/pdfgen/branch/master)
Code Coverage: [![Coverage Status](https://coveralls.io/repos/github/AndreRenaud/PDFGen/badge.svg?branch=master)](https://coveralls.io/github/AndreRenaud/PDFGen?branch=master)
Coverity scan: [![Coverity scan](https://scan.coverity.com/projects/11942/badge.svg)](https://scan.coverity.com/projects/andrerenaud-pdfgen)
Static Analysis
===============
This is a code base that I use to test static analysis tools. As such the build system is quite a bit more complex than should be necessary for a project of this size.## Language Bindings
- [RingPDFGen](https://github.com/ring-lang/ring/tree/master/extensions/ringpdfgen)