Skip to content

Commit 6d65a60

Browse files
committed
Update documentation and examples makefile.
1 parent e96f9bf commit 6d65a60

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Diff for: doc/pdfio.3

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH pdfio 3 "pdf read/write library" "2024-12-22" "pdf read/write library"
1+
.TH pdfio 3 "pdf read/write library" "2024-12-26" "pdf read/write library"
22
.SH NAME
33
pdfio \- pdf read/write library
44
.SH Introduction
@@ -1028,6 +1028,8 @@ pdfioContentTextShowJustified draws an array of literal strings with offsets bet
10281028

10291029

10301030
.SH Examples
1031+
.PP
1032+
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.
10311033
.SS Read PDF Metadata
10321034
.PP
10331035
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
20682070
doclink_t *l = dd\->links + dd\->num_links;
20692071
// Pointer to this link record
20702072

2071-
if (!strcmp(frag\->url, "@"))
2073+
if (!strcmp(frag\->url, "@"))
20722074
{
20732075
// Use mapped text as link target...
20742076
char targetlink[129]; // Targeted link
20752077

20762078
targetlink[0] = '#';
2077-
make_target_name(targetlink + 1, frag\->text, sNzeof(targetlink) \- 1);
2079+
make_target_name(targetlink + 1, frag\->text, sizeof(targetlink) \- 1);
20782080

20792081
l\->url = pdfioStringCreate(dd\->pdf, targetlink);
20802082
}

Diff for: doc/pdfio.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,7 @@ <h4 id="page-stream-functions">Page Stream Functions</h4>
11481148
</li>
11491149
</ul>
11501150
<h2 class="title" id="examples">Examples</h2>
1151+
<p>PDFio includes several example programs that are typically installed to the <code>/usr/share/doc/pdfio/examples</code> or <code>/usr/local/share/doc/pdfio/examples</code> directories. A makefile is included to build them.</p>
11511152
<h3 class="title" id="read-pdf-metadata">Read PDF Metadata</h3>
11521153
<p>The <code>pdfioinfo.c</code> example program opens a PDF file and prints the title, author, creation date, and number of pages:</p>
11531154
<pre><code class="language-c"><span class="directive">#include &lt;pdfio.h&gt;</span>
@@ -2027,13 +2028,13 @@ <h5 id="rendering-a-line-in-a-paragraph-heading-or-table-cell">Rendering a Line
20272028
doclink_t *l = dd-&gt;links + dd-&gt;num_links;
20282029
<span class="comment">// Pointer to this link record</span>
20292030

2030-
<span class="reserved">if</span> (!strcmp(frag-&gt;url, <span class="string">&quot;@&quot;</span>))
2031+
ï<span class="reserved">if</span> (!strcmp(frag-&gt;url, <span class="string">&quot;@&quot;</span>))
20312032
{
20322033
<span class="comment">// Use mapped text as link target...</span>
20332034
<span class="reserved">char</span> targetlink[<span class="number">129</span>]; <span class="comment">// Targeted link</span>
20342035

20352036
targetlink[<span class="number">0</span>] = <span class="string">'#'</span>;
2036-
make_target_name(targetlink + <span class="number">1</span>, frag-&gt;text, s¾zeof(targetlink) - <span class="number">1</span>);
2037+
make_target_name(targetlink + <span class="number">1</span>, frag-&gt;text, <span class="reserved">sizeof</span>(targetlink) - <span class="number">1</span>);
20372038

20382039
l-&gt;url = pdfioStringCreate(dd-&gt;pdf, targetlink);
20392040
}

Diff for: doc/pdfio.md

+4
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,10 @@ escaping, as needed:
864864
Examples
865865
========
866866

867+
PDFio includes several example programs that are typically installed to the
868+
`/usr/share/doc/pdfio/examples` or `/usr/local/share/doc/pdfio/examples`
869+
directories. A makefile is included to build them.
870+
867871

868872
Read PDF Metadata
869873
-----------------

Diff for: examples/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313

1414
# Common options
15-
#CFLAGS = -g $(CPPFLAGS)
16-
CFLAGS = -g -fsanitize=address $(CPPFLAGS)
17-
CPPFLAGS = -I..
18-
LIBS = -L.. -lpdfio -lz
15+
CFLAGS = -g $(CPPFLAGS)
16+
#CFLAGS = -g -fsanitize=address $(CPPFLAGS)
17+
CPPFLAGS = -I.. -I/usr/local/include
18+
LIBS = -L.. -L/usr/local/lib -lpdfio -lz
1919

2020

2121
# Targets

0 commit comments

Comments
 (0)