資源簡(jiǎn)介
可以使用MCU生成PDF格式文件,采用C 語(yǔ)言方式,方便移植

代碼片段和文件信息
#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
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????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
評(píng)論
共有 條評(píng)論