项目
在 GitHub 查看
AndreRenaud/PDFGen
关于
简单的 C 语言 PDF 编写与生成库
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文PDFGen
Simple C PDF Creation/Generation library. All contained in 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 (including TrueType Fonts)
- Primitive drawing elements
- Lines
- Rectangles
- Filled Rectangles
- Polygons
- Filled Polygons
- Bezier curves
- Circles / Ellipses
- Custom Paths
- Bookmarks / Links
- Barcodes
- Code-128A
- Code-39
- EAN-13
- UPC-A
- EAN-8
- UPC-E
- QR codes
- Embedded images
- PPM/PGM/PBM (binary & ASCII formats)
- JPEG
- PNG (Alpha Channels are not supported)
- BMP
- Password protected/encrypted output (RC4 40-bit)
Example usage
#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
The source here is public domain. If you find it useful, please drop me a line at [email protected].
Builds
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
探索相关项目
加载中…