From 6d65a609e5abfd4c6a5765ff3237a6b8436a02e4 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 26 Dec 2024 15:12:56 -0500 Subject: [PATCH] Update documentation and examples makefile. --- doc/pdfio.3 | 8 +++++--- doc/pdfio.html | 5 +++-- doc/pdfio.md | 4 ++++ examples/Makefile | 8 ++++---- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/doc/pdfio.3 b/doc/pdfio.3 index defe5f4..8029add 100644 --- a/doc/pdfio.3 +++ b/doc/pdfio.3 @@ -1,4 +1,4 @@ -.TH pdfio 3 "pdf read/write library" "2024-12-22" "pdf read/write library" +.TH pdfio 3 "pdf read/write library" "2024-12-26" "pdf read/write library" .SH NAME pdfio \- pdf read/write library .SH Introduction @@ -1028,6 +1028,8 @@ pdfioContentTextShowJustified draws an array of literal strings with offsets bet .SH Examples +.PP +PDFio includes several example programs that are typically installed to the /usr/share/doc/pdfio/examples or /usr/local/share/doc/pdfio/examples directories. A makefile is included to build them. .SS Read PDF Metadata .PP The pdfioinfo.c example program opens a PDF file and prints the title, author, creation date, and number of pages: @@ -2068,13 +2070,13 @@ We then loops through the fragments for the current line, drawing checkboxes, im doclink_t *l = dd\->links + dd\->num_links; // Pointer to this link record - if (!strcmp(frag\->url, "@")) + if (!strcmp(frag\->url, "@")) { // Use mapped text as link target... char targetlink[129]; // Targeted link targetlink[0] = '#'; - make_target_name(targetlink + 1, frag\->text, sNzeof(targetlink) \- 1); + make_target_name(targetlink + 1, frag\->text, sizeof(targetlink) \- 1); l\->url = pdfioStringCreate(dd\->pdf, targetlink); } diff --git a/doc/pdfio.html b/doc/pdfio.html index 9427a95..8709c10 100644 --- a/doc/pdfio.html +++ b/doc/pdfio.html @@ -1148,6 +1148,7 @@

Page Stream Functions

Examples

+

PDFio includes several example programs that are typically installed to the /usr/share/doc/pdfio/examples or /usr/local/share/doc/pdfio/examples directories. A makefile is included to build them.

Read PDF Metadata

The pdfioinfo.c example program opens a PDF file and prints the title, author, creation date, and number of pages:

#include <pdfio.h>
@@ -2027,13 +2028,13 @@ 
Rendering a Line doclink_t *l = dd->links + dd->num_links; // Pointer to this link record - if (!strcmp(frag->url, "@")) + ïif (!strcmp(frag->url, "@")) { // Use mapped text as link target... char targetlink[129]; // Targeted link targetlink[0] = '#'; - make_target_name(targetlink + 1, frag->text, sūzeof(targetlink) - 1); + make_target_name(targetlink + 1, frag->text, sizeof(targetlink) - 1); l->url = pdfioStringCreate(dd->pdf, targetlink); } diff --git a/doc/pdfio.md b/doc/pdfio.md index 6e75a6d..773fda6 100644 --- a/doc/pdfio.md +++ b/doc/pdfio.md @@ -864,6 +864,10 @@ escaping, as needed: Examples ======== +PDFio includes several example programs that are typically installed to the +`/usr/share/doc/pdfio/examples` or `/usr/local/share/doc/pdfio/examples` +directories. A makefile is included to build them. + Read PDF Metadata ----------------- diff --git a/examples/Makefile b/examples/Makefile index 7a0d134..88a944f 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -12,10 +12,10 @@ # Common options -#CFLAGS = -g $(CPPFLAGS) -CFLAGS = -g -fsanitize=address $(CPPFLAGS) -CPPFLAGS = -I.. -LIBS = -L.. -lpdfio -lz +CFLAGS = -g $(CPPFLAGS) +#CFLAGS = -g -fsanitize=address $(CPPFLAGS) +CPPFLAGS = -I.. -I/usr/local/include +LIBS = -L.. -L/usr/local/lib -lpdfio -lz # Targets