资源简介
可以使用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论坛批量发贴机
相关资源
- DS1302+1602液晶+测温多组闹铃
- 用单片机驱动继电器的方法
- 基于单片机的音乐播放器的设计与制
- cortex-A9 4412通过USB摄像头采集视频液晶
- ucos2在cortex-A8上的移植
- 8x8LED点阵显示学号及姓名
- ARM Cortex-M0权威指南(中文高清PDF)
- 贴片STC12C5A60S2的原理图和PCB库
- Xilinx Zynq-7000 嵌入式系统设计与实现
- Cortex-M3权威指南(中文版详尽版).
- ARM Cortex-A53 MPCore开发手册
- 嵌入式系统原理及应用----基于ARM Co
- STM32 Cortex M3 ARM单片机纯汇编及MDK配置
- Keil.ARMCortex_DFP.0.0.1.pack
- The definitive guide to the ARM Cortex-M3.pdf
- ARM Cortex-M7 内核编程技术说明文档
- ARMCortexM4中文手册.rar
- Cortex-M4技术参考手册
- Cortex-M3 STM32F103VET6管脚分布图
- 新PCB-15w408as+adc -ADS1115程序 -USB电压电
- stm32f10x固件库文件cortexm3_macro.h stm32
- Exynos4412 开发板资料
- Cortex M4技术参考手册
- 51单片机,按键控制流水灯,流水灯控
- TI Cortex-M4 TM4C123GH6PM例程
- cortexm3_macro
- 在LPC1114上移植uCos ii
- 基于单片机的简易十字路口交通灯设
- 安卓接受单片机蓝牙数据
- ALIENTEK MINISTM32 汉字显示实验
评论
共有 条评论