资源简介
可以使用MCU生成PDF格式文件,采用C 语言方式,方便移植

代码片段和文件信息
#include
#include
#include “pdfgen.h“
int main(int argc char *argv[])
{
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);
int i;
int height;
int bm;
pdf_set_font(pdf “Times-BoldItalic“);
pdf_append_page(pdf);
height = pdf_add_text_wrap(pdf NULL
“This is a great big long string that I hope will wrap properly “
“around several lines.\nI‘ve put some embedded line breaks in to “
“see how it copes with them. Hopefully it all works properly.\n\n\n“
“We even include multiple breaks\n“
“thisisanenourmouswordthatwillneverfitandwillhavetobecut“
16 60 600 PDF_RGB(0 0 0) 300);
pdf_add_rectangle(pdf NULL 60 600 + 16 300 -height 1 PDF_RGB(0 0 0));
pdf_add_ppm(pdf NULL 10 10 20 30 “teapot.ppm“);
pdf_add_jpeg(pdf NULL 100 500 50 150 “penguin.jpg“);
pdf_add_barcode(pdf NULL PDF_BARCODE_128A 50 300 200 100 “ABCDEF“ PDF_RGB(0 0 0));
pdf_add_text(pdf NULL “Page One“ 10 20 30 PDF_RGB(0xff 0 0));
pdf_add_text(pdf NULL “PjGQji“ 18 20 130 PDF_RGB(0 0xff 0xff));
#if 1
pdf_add_line(pdf NULL 10 24 100 24 4 PDF_RGB(0xff 0 0));
pdf_add_rectangle(pdf NULL 150 150 100 100 4 PDF_RGB(0 0 0xff));
pdf_add_filled_rectangle(pdf NULL 150 450 100 100 4 PDF_RGB(0 0xff 0));
pdf_add_text(pdf NULL ““ 20 20 30 PDF_RGB(0 0 0));
pdf_add_text(pdf NULL “Date (YYYY-MM-DD):“ 20 220 30 PDF_RGB(0 0 0));
bm = pdf_add_bookmark(pdf NULL -1 “First page“);
pdf_append_page(pdf);
pdf_add_text(pdf NULL “Page Two“ 10 20 30 PDF_RGB(0 0 0));
pdf_add_text(pdf NULL “This is some weird text () \\ # : - Wi-Fi“ 10 50 60 PDF_RGB(0 0 0));
pdf_add_text(pdf NULL “Control characters ( ) < > [ ] { } / % \n \r \t \b \f ending“ 10 50 45 PDF_RGB(0 0 0));
pdf_add_text(pdf NULL “This one has a new line in it\nThere it was“ 10 50 80 PDF_RGB(0 0 0));
pdf_add_text(pdf NULL “This is a really long line that will go off the edge of the screen because it is so long. I like long text. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog“ 10 100 100 PDF_RGB(0 0 0));
pdf_set_font(pdf “Helvetica-Bold“);
pdf_add_text(pdf NULL “This is a really long line that will go off the edge of the screen because it is so long. I like long text. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog“ 10 100 130 PDF_RGB(0 0 0));
pdf_set_font(pdf “ZapfDingbats“);
pdf_add_text(pdf NULL “This is a really long line that will go off the edge of the screen because it is so long. I like long text. The quick brown fox jumped over the lazy dog. The quick b
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-05-09 03:29 PDFGen-master\
文件 587 2017-05-09 03:29 PDFGen-master\Makefile
文件 952 2017-05-09 03:29 PDFGen-master\README.md
文件 299 2017-05-09 03:29 PDFGen-master\TODO
文件 4092 2017-05-09 03:29 PDFGen-master\main.c
文件 60216 2017-05-09 03:29 PDFGen-master\pdfgen.c
文件 53764 2017-05-09 03:29 PDFGen-master\pdfgen.dox
文件 10766 2017-05-09 03:29 PDFGen-master\pdfgen.h
文件 2192 2017-05-09 03:29 PDFGen-master\penguin.jpg
文件 196623 2017-05-09 03:29 PDFGen-master\teapot.ppm
- 上一篇:个人网站设计论文文献综述
- 下一篇:Discuz论坛批量发贴机
相关资源
- arm cortex m0 rtl code
- 基于STM32的嵌入式双目图像采集系统设
- 基于protues的信号发生器,protues详细教
- 基于arm cortex M3 的LED控制源代码
- Proteus仿真的单片机控制步进电机及液
- ARMCortex-M3权威指南(第二版)
- 嵌入式系统设计与应用 基于ARM Cort
- 选ARM7还是选Cortex-M3转载,经典的必看
- ARMCortex-M3权威指南中文版第二版
- CM3权威指南CnR2(pdf)中文版
- STM32F1系列单片机,通过TIM4生成4路P
- Cortex-M4实验指导书
- ARM-Cortex-M底层技术
- 新手怎样学习单片机,推荐一套很好
- ARM Cortex-M3 技术参考手册(中文版)
- ARM Cortex-M处理器入门
- arm-cortex-a9技术参考手册
- 基于CortexM4的俄罗斯方块游戏代码加文
- 一天快速单片机入门,51单片机
- MPU6050三轴陀螺仪串口读取数据并显示
- ARM Cortex-M3嵌入式开发详解基于NXP LP
- 飞思卡尔MC9S12单片机完整版说明书(
- 用于ti am335x arm cortex a9的vxworksbsp源码
- Cortex-A9 ARM 体系结构与接口技术
- 资源:ZED-Board从入门到精通一:ZYNQ结
- STM32F4IAR工程模版
- 三星Exynos4412使用手册 Cortex-A9使用手册
- TI Cortex-M3 BootLoader资料
- 《轻松玩转ARM Cortex-M0+微控制器基于飞
- 三天入门Cortex-M4-Kinetis系列
评论
共有 条评论